get rid of HAL pixelformats 5551 and 4444
Change-Id: I39409103144c1ba09078c4ddc323a58987fb09ea
diff --git a/include/ui/PixelFormat.h b/include/ui/PixelFormat.h
index d06728b..627cfb6 100644
--- a/include/ui/PixelFormat.h
+++ b/include/ui/PixelFormat.h
@@ -61,8 +61,8 @@
PIXEL_FORMAT_RGB_888 = HAL_PIXEL_FORMAT_RGB_888, // 3x8-bit RGB
PIXEL_FORMAT_RGB_565 = HAL_PIXEL_FORMAT_RGB_565, // 16-bit RGB
PIXEL_FORMAT_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888, // 4x8-bit BGRA
- PIXEL_FORMAT_RGBA_5551 = HAL_PIXEL_FORMAT_RGBA_5551, // 16-bit ARGB
- PIXEL_FORMAT_RGBA_4444 = HAL_PIXEL_FORMAT_RGBA_4444, // 16-bit ARGB
+ PIXEL_FORMAT_RGBA_5551 = 6, // 16-bit ARGB
+ PIXEL_FORMAT_RGBA_4444 = 7, // 16-bit ARGB
};
typedef int32_t PixelFormat;
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index 92f07eb..bd1671d 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -656,8 +656,6 @@
case PIXEL_FORMAT_RGB_888:
case PIXEL_FORMAT_RGB_565:
case PIXEL_FORMAT_BGRA_8888:
- case PIXEL_FORMAT_RGBA_5551:
- case PIXEL_FORMAT_RGBA_4444:
// We know there's no subsampling of any channels, so we
// only need to shrink by a half a pixel.
shrinkAmount = 0.5;
diff --git a/libs/ui/PixelFormat.cpp b/libs/ui/PixelFormat.cpp
index 15e99ab..d2d103a 100644
--- a/libs/ui/PixelFormat.cpp
+++ b/libs/ui/PixelFormat.cpp
@@ -23,42 +23,32 @@
ssize_t bytesPerPixel(PixelFormat format) {
switch (format) {
- case HAL_PIXEL_FORMAT_RGBA_8888:
- case HAL_PIXEL_FORMAT_RGBX_8888:
- case HAL_PIXEL_FORMAT_BGRA_8888:
+ case PIXEL_FORMAT_RGBA_8888:
+ case PIXEL_FORMAT_RGBX_8888:
+ case PIXEL_FORMAT_BGRA_8888:
return 4;
- case HAL_PIXEL_FORMAT_RGB_888:
+ case PIXEL_FORMAT_RGB_888:
return 3;
- case HAL_PIXEL_FORMAT_RGB_565:
- case HAL_PIXEL_FORMAT_RGBA_5551:
- case HAL_PIXEL_FORMAT_RGBA_4444:
+ case PIXEL_FORMAT_RGB_565:
+ case PIXEL_FORMAT_RGBA_5551:
+ case PIXEL_FORMAT_RGBA_4444:
return 2;
- case HAL_PIXEL_FORMAT_YCbCr_422_SP:
- case HAL_PIXEL_FORMAT_YCbCr_422_I:
- case HAL_PIXEL_FORMAT_YCrCb_420_SP:
- case HAL_PIXEL_FORMAT_YV12:
- return 1;
}
return BAD_VALUE;
}
ssize_t bitsPerPixel(PixelFormat format) {
switch (format) {
- case HAL_PIXEL_FORMAT_RGBA_8888:
- case HAL_PIXEL_FORMAT_RGBX_8888:
- case HAL_PIXEL_FORMAT_BGRA_8888:
+ case PIXEL_FORMAT_RGBA_8888:
+ case PIXEL_FORMAT_RGBX_8888:
+ case PIXEL_FORMAT_BGRA_8888:
return 32;
- case HAL_PIXEL_FORMAT_RGB_888:
+ case PIXEL_FORMAT_RGB_888:
return 24;
- case HAL_PIXEL_FORMAT_RGB_565:
- case HAL_PIXEL_FORMAT_RGBA_5551:
- case HAL_PIXEL_FORMAT_RGBA_4444:
- case HAL_PIXEL_FORMAT_YCbCr_422_SP:
- case HAL_PIXEL_FORMAT_YCbCr_422_I:
+ case PIXEL_FORMAT_RGB_565:
+ case PIXEL_FORMAT_RGBA_5551:
+ case PIXEL_FORMAT_RGBA_4444:
return 16;
- case HAL_PIXEL_FORMAT_YCrCb_420_SP:
- case HAL_PIXEL_FORMAT_YV12:
- return 12;
}
return BAD_VALUE;
}
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index 0ed5727..bbbda76 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -2051,8 +2051,6 @@
case HAL_PIXEL_FORMAT_RGB_888:
case HAL_PIXEL_FORMAT_RGB_565:
case HAL_PIXEL_FORMAT_BGRA_8888:
- case HAL_PIXEL_FORMAT_RGBA_5551:
- case HAL_PIXEL_FORMAT_RGBA_4444:
break;
default:
return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
diff --git a/opengl/tests/hwc/hwcTestLib.cpp b/opengl/tests/hwc/hwcTestLib.cpp
index d567e6e..9b224e2 100644
--- a/opengl/tests/hwc/hwcTestLib.cpp
+++ b/opengl/tests/hwc/hwcTestLib.cpp
@@ -560,8 +560,6 @@
{HAL_PIXEL_FORMAT_RGB_888, false, 3, 0, 8, 8, 8, 16, 8, 0, 0},
{HAL_PIXEL_FORMAT_RGB_565, true, 2, 0, 5, 5, 6, 11, 5, 0, 0},
{HAL_PIXEL_FORMAT_BGRA_8888, false, 4, 16, 8, 8, 8, 0, 8, 24, 8},
- {HAL_PIXEL_FORMAT_RGBA_5551, true , 2, 0, 5, 5, 5, 10, 5, 15, 1},
- {HAL_PIXEL_FORMAT_RGBA_4444, false, 2, 12, 4, 0, 4, 4, 4, 8, 4},
{HAL_PIXEL_FORMAT_YV12, true, 3, 16, 8, 8, 8, 0, 8, 0, 0},
};
@@ -614,8 +612,6 @@
{HAL_PIXEL_FORMAT_RGB_888, 3},
{HAL_PIXEL_FORMAT_RGB_565, 2},
{HAL_PIXEL_FORMAT_BGRA_8888, 4},
- {HAL_PIXEL_FORMAT_RGBA_5551, 2},
- {HAL_PIXEL_FORMAT_RGBA_4444, 2},
};
if (gBuf->getPixelFormat() == HAL_PIXEL_FORMAT_YV12) {
@@ -813,10 +809,6 @@
0, 0, 31, 31, 0, 0, 63, 63, 0, 0, 31, 31},
{HAL_PIXEL_FORMAT_BGRA_8888, true, false,
0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255},
- {HAL_PIXEL_FORMAT_RGBA_5551, true, false,
- 0, 0, 31, 31, 0, 0, 31, 31, 0, 0, 31, 31},
- {HAL_PIXEL_FORMAT_RGBA_4444, true, false,
- 0, 0, 15, 15, 0, 0, 15, 15, 0, 0, 15, 15},
{HAL_PIXEL_FORMAT_YV12, false, true,
0, 16, 235, 255, 0, 16, 240, 255, 0, 16, 240, 255},
};
diff --git a/opengl/tests/hwc/hwcTestLib.h b/opengl/tests/hwc/hwcTestLib.h
index d7d5837..d403308 100644
--- a/opengl/tests/hwc/hwcTestLib.h
+++ b/opengl/tests/hwc/hwcTestLib.h
@@ -46,8 +46,6 @@
{HAL_PIXEL_FORMAT_RGB_888, "RGB888", 1, 1},
{HAL_PIXEL_FORMAT_RGB_565, "RGB565", 1, 1},
{HAL_PIXEL_FORMAT_BGRA_8888, "BGRA8888", 1, 1},
- {HAL_PIXEL_FORMAT_RGBA_5551, "RGBA5551", 1, 1},
- {HAL_PIXEL_FORMAT_RGBA_4444, "RGBA4444", 1, 1},
{HAL_PIXEL_FORMAT_YV12, "YV12", 2, 2},
};
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index c2b52f6..401b0f3 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -582,8 +582,6 @@
switch (format) {
case HAL_PIXEL_FORMAT_RGBA_8888:
case HAL_PIXEL_FORMAT_BGRA_8888:
- case HAL_PIXEL_FORMAT_RGBA_5551:
- case HAL_PIXEL_FORMAT_RGBA_4444:
return false;
}
// in all other case, we have no blending (also for unknown formats)