get rid of HAL pixelformats 5551 and 4444

Change-Id: I39409103144c1ba09078c4ddc323a58987fb09ea
This commit is contained in:
Mathias Agopian 2013-07-26 14:49:50 -07:00
parent dd533712f8
commit c2414bb098
7 changed files with 16 additions and 42 deletions

View File

@ -61,8 +61,8 @@ enum {
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;

View File

@ -656,8 +656,6 @@ void GLConsumer::computeCurrentTransformMatrixLocked() {
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;

View File

@ -23,42 +23,32 @@ namespace android {
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;
}

View File

@ -2051,8 +2051,6 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
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);

View File

@ -560,8 +560,6 @@ uint32_t hwcTestColor2Pixel(uint32_t format, ColorFract color, float alpha)
{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 @@ void hwcTestSetPixel(GraphicBuffer *gBuf, unsigned char *buf,
{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 @@ void hwcTestColorConvert(uint32_t fromFormat, uint32_t toFormat,
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},
};

View File

@ -46,8 +46,6 @@ const struct hwcTestGraphicFormat {
{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},
};

View File

@ -582,8 +582,6 @@ bool Layer::getOpacityForFormat(uint32_t format) {
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)