public final class HardwareConfigState
extends java.lang.Object
Bitmap.Config.HARDWARE
on
Android O+.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAXIMUM_FDS_FOR_HARDWARE_CONFIGS
700 with an error of 50 Bitmaps in between at two FDs each lets us use up to 800 FDs for
hardware Bitmaps.
|
static int |
DEFAULT_MIN_HARDWARE_DIMENSION
The minimum size in pixels a
Bitmap must be in both dimensions to be created with the
Bitmap.Config#HARDWARE configuration. |
Modifier and Type | Method and Description |
---|---|
static HardwareConfigState |
getInstance() |
boolean |
isHardwareConfigAllowed(int targetWidth,
int targetHeight,
boolean isHardwareConfigAllowed,
boolean isExifOrientationRequired) |
public static final int DEFAULT_MIN_HARDWARE_DIMENSION
Bitmap
must be in both dimensions to be created with the
Bitmap.Config#HARDWARE
configuration.
This is a quick check that lets us skip wasting FDs (see FD_SIZE_LIST
) on small
Bitmap
s with relatively low memory costs.
FD_SIZE_LIST
,
Constant Field Valuespublic static final int DEFAULT_MAXIMUM_FDS_FOR_HARDWARE_CONFIGS
Prior to P, the limit per process was 1024 FDs. In P, the limit was updated to 32k FDs per process.
Access to this variable will be removed in a future version without deprecation.
public static HardwareConfigState getInstance()
public boolean isHardwareConfigAllowed(int targetWidth, int targetHeight, boolean isHardwareConfigAllowed, boolean isExifOrientationRequired)