diff options
author | 2012-02-24 14:58:36 -0800 | |
---|---|---|
committer | 2012-02-24 14:58:36 -0800 | |
commit | e9d4c71f47f74ee9a4a490f62769ad010a17d19b (patch) | |
tree | 8227f4727eb45324bf96bb18e4290f206f19108f | |
parent | 2d77b5332ac4ef5b252fbd8f56a195e0fce03292 (diff) |
deprecate L_8, LA_88 and RGB_332 in sdk
re-add support for pixelformats L_8, LA_88 and RGB_332 in libui
for backward compatibility.
This may or may not fix 6058926
Bug: 6049685
Change-Id: Ic1b8b4cc994522f7fe664da64c0ef76b98bc6d53
-rw-r--r-- | api/current.txt | 8 | ||||
-rw-r--r-- | graphics/java/android/graphics/PixelFormat.java | 4 | ||||
-rw-r--r-- | include/ui/PixelFormat.h | 13 | ||||
-rw-r--r-- | libs/ui/PixelFormat.cpp | 5 | ||||
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 6 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 2 |
6 files changed, 24 insertions, 14 deletions
diff --git a/api/current.txt b/api/current.txt index 0a83fe00b0fc..44a97cda62b5 100644 --- a/api/current.txt +++ b/api/current.txt @@ -8615,14 +8615,14 @@ package android.graphics { method public static void getPixelFormatInfo(int, android.graphics.PixelFormat); field public static final int A_8 = 8; // 0x8 field public static final deprecated int JPEG = 256; // 0x100 - field public static final int LA_88 = 10; // 0xa + field public static final deprecated int LA_88 = 10; // 0xa field public static final int L_8 = 9; // 0x9 field public static final int OPAQUE = -1; // 0xffffffff - field public static final int RGBA_4444 = 7; // 0x7 - field public static final int RGBA_5551 = 6; // 0x6 + field public static final deprecated int RGBA_4444 = 7; // 0x7 + field public static final deprecated int RGBA_5551 = 6; // 0x6 field public static final int RGBA_8888 = 1; // 0x1 field public static final int RGBX_8888 = 2; // 0x2 - field public static final int RGB_332 = 11; // 0xb + field public static final deprecated int RGB_332 = 11; // 0xb field public static final int RGB_565 = 4; // 0x4 field public static final int RGB_888 = 3; // 0x3 field public static final int TRANSLUCENT = -3; // 0xfffffffd diff --git a/graphics/java/android/graphics/PixelFormat.java b/graphics/java/android/graphics/PixelFormat.java index 182f14d60e11..f7c202f8dca3 100644 --- a/graphics/java/android/graphics/PixelFormat.java +++ b/graphics/java/android/graphics/PixelFormat.java @@ -39,11 +39,15 @@ public class PixelFormat public static final int RGB_888 = 3; public static final int RGB_565 = 4; + @Deprecated public static final int RGBA_5551 = 6; + @Deprecated public static final int RGBA_4444 = 7; public static final int A_8 = 8; public static final int L_8 = 9; + @Deprecated public static final int LA_88 = 0xA; + @Deprecated public static final int RGB_332 = 0xB; diff --git a/include/ui/PixelFormat.h b/include/ui/PixelFormat.h index fc260c4f4b1d..9f3e267139c7 100644 --- a/include/ui/PixelFormat.h +++ b/include/ui/PixelFormat.h @@ -64,9 +64,6 @@ enum { 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_A_8 = 8, // 8-bit A - - // New formats can be added if they're also defined in - // pixelflinger/format.h }; typedef int32_t PixelFormat; @@ -80,10 +77,12 @@ struct PixelFormatInfo { }; enum { // components - ALPHA = 1, - RGB = 2, - RGBA = 3, - OTHER = 0xFF + ALPHA = 1, + RGB = 2, + RGBA = 3, + L = 4, + LA = 5, + OTHER = 0xFF }; struct szinfo { diff --git a/libs/ui/PixelFormat.cpp b/libs/ui/PixelFormat.cpp index 6993dac6998a..fc1d3c29db11 100644 --- a/libs/ui/PixelFormat.cpp +++ b/libs/ui/PixelFormat.cpp @@ -48,7 +48,10 @@ static Info const sPixelFormatInfos[] = { { 4, 32, {32,24, 24,16, 16, 8, 8, 0 }, PixelFormatInfo::RGBA }, { 2, 16, { 1, 0, 16,11, 11, 6, 6, 1 }, PixelFormatInfo::RGBA }, { 2, 16, { 4, 0, 16,12, 12, 8, 8, 4 }, PixelFormatInfo::RGBA }, - { 1, 8, { 8, 0, 0, 0, 0, 0, 0, 0 }, PixelFormatInfo::ALPHA} + { 1, 8, { 8, 0, 0, 0, 0, 0, 0, 0 }, PixelFormatInfo::ALPHA}, + { 1, 8, { 0, 0, 8, 0, 8, 0, 8, 0 }, PixelFormatInfo::L }, + { 2, 16, {16, 8, 8, 0, 8, 0, 8, 0 }, PixelFormatInfo::LA }, + { 1, 8, { 0, 0, 8, 5, 5, 2, 2, 0 }, PixelFormatInfo::RGB }, }; static const Info* gGetPixelFormatTable(size_t* numEntries) { diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 4ee695398f62..efcdd8764275 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -160,7 +160,10 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, // this surfaces pixel format PixelFormatInfo info; status_t err = getPixelFormatInfo(format, &info); - if (err) return err; + if (err) { + ALOGE("unsupported pixelformat %d", format); + return err; + } // the display's pixel format const DisplayHardware& hw(graphicPlane(0).displayHardware()); @@ -170,6 +173,7 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, // never allow a surface larger than what our underlying GL implementation // can handle. if ((uint32_t(w)>maxSurfaceDims) || (uint32_t(h)>maxSurfaceDims)) { + ALOGE("dimensions too large %u x %u", uint32_t(w), uint32_t(h)); return BAD_VALUE; } diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 9d821dc47203..05b5bf5d5403 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1285,7 +1285,7 @@ sp<ISurface> SurfaceFlinger::createSurface( return surfaceHandle; } - //ALOGD("createSurface for pid %d (%d x %d)", pid, w, h); + //ALOGD("createSurface for (%d x %d), name=%s", w, h, name.string()); sp<Layer> normalLayer; switch (flags & eFXSurfaceMask) { case eFXSurfaceNormal: |