Merge "Add RGBA 10:10:10:2 format for surfaces"
This commit is contained in:
@ -29,65 +29,66 @@ public class PixelFormat {
|
||||
|
||||
/** @hide */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({RGBA_8888, RGBX_8888, RGBA_F16, RGB_888, RGB_565})
|
||||
public @interface Format { };
|
||||
@IntDef({RGBA_8888, RGBX_8888, RGBA_F16, RGBA_1010102, RGB_888, RGB_565})
|
||||
public @interface Format { }
|
||||
|
||||
// NOTE: these constants must match the values from graphics/common/x.x/types.hal
|
||||
|
||||
public static final int UNKNOWN = 0;
|
||||
public static final int UNKNOWN = 0;
|
||||
|
||||
/** System chooses a format that supports translucency (many alpha bits) */
|
||||
public static final int TRANSLUCENT = -3;
|
||||
public static final int TRANSLUCENT = -3;
|
||||
|
||||
/**
|
||||
* System chooses a format that supports transparency
|
||||
* (at least 1 alpha bit)
|
||||
*/
|
||||
public static final int TRANSPARENT = -2;
|
||||
public static final int TRANSPARENT = -2;
|
||||
|
||||
/** System chooses an opaque format (no alpha bits required) */
|
||||
public static final int OPAQUE = -1;
|
||||
public static final int OPAQUE = -1;
|
||||
|
||||
public static final int RGBA_8888 = 1;
|
||||
public static final int RGBX_8888 = 2;
|
||||
public static final int RGB_888 = 3;
|
||||
public static final int RGB_565 = 4;
|
||||
public static final int RGBA_8888 = 1;
|
||||
public static final int RGBX_8888 = 2;
|
||||
public static final int RGB_888 = 3;
|
||||
public static final int RGB_565 = 4;
|
||||
|
||||
@Deprecated
|
||||
public static final int RGBA_5551 = 6;
|
||||
public static final int RGBA_5551 = 6;
|
||||
@Deprecated
|
||||
public static final int RGBA_4444 = 7;
|
||||
public static final int RGBA_4444 = 7;
|
||||
@Deprecated
|
||||
public static final int A_8 = 8;
|
||||
public static final int A_8 = 8;
|
||||
@Deprecated
|
||||
public static final int L_8 = 9;
|
||||
public static final int L_8 = 9;
|
||||
@Deprecated
|
||||
public static final int LA_88 = 0xA;
|
||||
public static final int LA_88 = 0xA;
|
||||
@Deprecated
|
||||
public static final int RGB_332 = 0xB;
|
||||
public static final int RGB_332 = 0xB;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link android.graphics.ImageFormat#NV16
|
||||
* ImageFormat.NV16} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int YCbCr_422_SP= 0x10;
|
||||
public static final int YCbCr_422_SP = 0x10;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link android.graphics.ImageFormat#NV21
|
||||
* ImageFormat.NV21} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int YCbCr_420_SP= 0x11;
|
||||
public static final int YCbCr_420_SP = 0x11;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link android.graphics.ImageFormat#YUY2
|
||||
* ImageFormat.YUY2} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int YCbCr_422_I = 0x14;
|
||||
public static final int YCbCr_422_I = 0x14;
|
||||
|
||||
public static final int RGBA_F16 = 0x16;
|
||||
public static final int RGBA_F16 = 0x16;
|
||||
public static final int RGBA_1010102 = 0x2B;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link android.graphics.ImageFormat#JPEG
|
||||
@ -103,6 +104,7 @@ public class PixelFormat {
|
||||
switch (format) {
|
||||
case RGBA_8888:
|
||||
case RGBX_8888:
|
||||
case RGBA_1010102:
|
||||
info.bitsPerPixel = 32;
|
||||
info.bytesPerPixel = 4;
|
||||
break;
|
||||
@ -149,6 +151,7 @@ public class PixelFormat {
|
||||
case PixelFormat.RGBA_5551:
|
||||
case PixelFormat.RGBA_8888:
|
||||
case PixelFormat.RGBA_F16:
|
||||
case PixelFormat.RGBA_1010102:
|
||||
case PixelFormat.TRANSLUCENT:
|
||||
case PixelFormat.TRANSPARENT:
|
||||
return true;
|
||||
@ -176,6 +179,7 @@ public class PixelFormat {
|
||||
case RGB_888:
|
||||
case RGB_565:
|
||||
case RGBA_F16:
|
||||
case RGBA_1010102:
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user