10#if __ANDROID_API__ >= 26
14namespace AHardwareBufferUtils {
16SkColorType GetSkColorTypeFromBufferFormat(uint32_t bufferFormat) {
17 switch (bufferFormat) {
18 case AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM:
20 case AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM:
22 case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
24 case AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM:
26 case AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM:
28 case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
30#if __ANDROID_API__ >= 33
31 case AHARDWAREBUFFER_FORMAT_R8_UNORM:
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kRGB_888x_SkColorType
pixel with 8 bits each for red, green, blue; in 32-bit word
@ kRGBA_1010102_SkColorType
10 bits for red, green, blue; 2 bits for alpha; in 32-bit word