We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6513dae + e9d4c71 commit 7b49b4bCopy full SHA for 7b49b4b
api/current.txt
@@ -8629,14 +8629,14 @@ package android.graphics {
8629
method public static void getPixelFormatInfo(int, android.graphics.PixelFormat);
8630
field public static final int A_8 = 8; // 0x8
8631
field public static final deprecated int JPEG = 256; // 0x100
8632
- field public static final int LA_88 = 10; // 0xa
+ field public static final deprecated int LA_88 = 10; // 0xa
8633
field public static final int L_8 = 9; // 0x9
8634
field public static final int OPAQUE = -1; // 0xffffffff
8635
- field public static final int RGBA_4444 = 7; // 0x7
8636
- 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
8637
field public static final int RGBA_8888 = 1; // 0x1
8638
field public static final int RGBX_8888 = 2; // 0x2
8639
- field public static final int RGB_332 = 11; // 0xb
+ field public static final deprecated int RGB_332 = 11; // 0xb
8640
field public static final int RGB_565 = 4; // 0x4
8641
field public static final int RGB_888 = 3; // 0x3
8642
field public static final int TRANSLUCENT = -3; // 0xfffffffd
graphics/java/android/graphics/PixelFormat.java
@@ -39,11 +39,15 @@ public class PixelFormat
39
public static final int RGB_888 = 3;
40
public static final int RGB_565 = 4;
41
42
+ @Deprecated
43
public static final int RGBA_5551 = 6;
44
45
public static final int RGBA_4444 = 7;
46
public static final int A_8 = 8;
47
public static final int L_8 = 9;
48
49
public static final int LA_88 = 0xA;
50
51
public static final int RGB_332 = 0xB;
52
53
include/ui/PixelFormat.h
@@ -64,9 +64,6 @@ enum {
64
PIXEL_FORMAT_RGBA_5551 = HAL_PIXEL_FORMAT_RGBA_5551, // 16-bit ARGB
65
PIXEL_FORMAT_RGBA_4444 = HAL_PIXEL_FORMAT_RGBA_4444, // 16-bit ARGB
66
PIXEL_FORMAT_A_8 = 8, // 8-bit A
67
-
68
- // New formats can be added if they're also defined in
69
- // pixelflinger/format.h
70
};
71
72
typedef int32_t PixelFormat;
@@ -80,10 +77,12 @@ struct PixelFormatInfo {
80
77
81
78
82
79
enum { // components
83
- ALPHA = 1,
84
- RGB = 2,
85
- RGBA = 3,
86
- OTHER = 0xFF
+ ALPHA = 1,
+ RGB = 2,
+ RGBA = 3,
+ L = 4,
+ LA = 5,
+ OTHER = 0xFF
87
88
89
struct szinfo {
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 },
54
+ { 1, 8, { 0, 0, 8, 5, 5, 2, 2, 0 }, PixelFormatInfo::RGB },
55
56
57
static const Info* gGetPixelFormatTable(size_t* numEntries) {
services/surfaceflinger/Layer.cpp
@@ -160,7 +160,10 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
160
// this surfaces pixel format
161
PixelFormatInfo info;
162
status_t err = getPixelFormatInfo(format, &info);
163
- if (err) return err;
+ if (err) {
164
+ ALOGE("unsupported pixelformat %d", format);
165
+ return err;
166
+ }
167
168
// the display's pixel format
169
const DisplayHardware& hw(graphicPlane(0).displayHardware());
@@ -170,6 +173,7 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
170
173
// never allow a surface larger than what our underlying GL implementation
171
174
// can handle.
172
175
if ((uint32_t(w)>maxSurfaceDims) || (uint32_t(h)>maxSurfaceDims)) {
176
+ ALOGE("dimensions too large %u x %u", uint32_t(w), uint32_t(h));
177
return BAD_VALUE;
178
}
179
services/surfaceflinger/SurfaceFlinger.cpp
@@ -1285,7 +1285,7 @@ sp<ISurface> SurfaceFlinger::createSurface(
1285
return surfaceHandle;
1286
1287
1288
- //ALOGD("createSurface for pid %d (%d x %d)", pid, w, h);
+ //ALOGD("createSurface for (%d x %d), name=%s", w, h, name.string());
1289
sp<Layer> normalLayer;
1290
switch (flags & eFXSurfaceMask) {
1291
case eFXSurfaceNormal:
0 commit comments