Skip to content

Commit 7b49b4b

Browse files
pixelflingerAndroid (Google) Code Review
authored andcommitted
Merge "deprecate L_8, LA_88 and RGB_332 in sdk"
2 parents 6513dae + e9d4c71 commit 7b49b4b

File tree

6 files changed

+24
-14
lines changed

6 files changed

+24
-14
lines changed

api/current.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8629,14 +8629,14 @@ package android.graphics {
86298629
method public static void getPixelFormatInfo(int, android.graphics.PixelFormat);
86308630
field public static final int A_8 = 8; // 0x8
86318631
field public static final deprecated int JPEG = 256; // 0x100
8632-
field public static final int LA_88 = 10; // 0xa
8632+
field public static final deprecated int LA_88 = 10; // 0xa
86338633
field public static final int L_8 = 9; // 0x9
86348634
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
8635+
field public static final deprecated int RGBA_4444 = 7; // 0x7
8636+
field public static final deprecated int RGBA_5551 = 6; // 0x6
86378637
field public static final int RGBA_8888 = 1; // 0x1
86388638
field public static final int RGBX_8888 = 2; // 0x2
8639-
field public static final int RGB_332 = 11; // 0xb
8639+
field public static final deprecated int RGB_332 = 11; // 0xb
86408640
field public static final int RGB_565 = 4; // 0x4
86418641
field public static final int RGB_888 = 3; // 0x3
86428642
field public static final int TRANSLUCENT = -3; // 0xfffffffd

graphics/java/android/graphics/PixelFormat.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@ public class PixelFormat
3939
public static final int RGB_888 = 3;
4040
public static final int RGB_565 = 4;
4141

42+
@Deprecated
4243
public static final int RGBA_5551 = 6;
44+
@Deprecated
4345
public static final int RGBA_4444 = 7;
4446
public static final int A_8 = 8;
4547
public static final int L_8 = 9;
48+
@Deprecated
4649
public static final int LA_88 = 0xA;
50+
@Deprecated
4751
public static final int RGB_332 = 0xB;
4852

4953

include/ui/PixelFormat.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ enum {
6464
PIXEL_FORMAT_RGBA_5551 = HAL_PIXEL_FORMAT_RGBA_5551, // 16-bit ARGB
6565
PIXEL_FORMAT_RGBA_4444 = HAL_PIXEL_FORMAT_RGBA_4444, // 16-bit ARGB
6666
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
7067
};
7168

7269
typedef int32_t PixelFormat;
@@ -80,10 +77,12 @@ struct PixelFormatInfo {
8077
};
8178

8279
enum { // components
83-
ALPHA = 1,
84-
RGB = 2,
85-
RGBA = 3,
86-
OTHER = 0xFF
80+
ALPHA = 1,
81+
RGB = 2,
82+
RGBA = 3,
83+
L = 4,
84+
LA = 5,
85+
OTHER = 0xFF
8786
};
8887

8988
struct szinfo {

libs/ui/PixelFormat.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ static Info const sPixelFormatInfos[] = {
4848
{ 4, 32, {32,24, 24,16, 16, 8, 8, 0 }, PixelFormatInfo::RGBA },
4949
{ 2, 16, { 1, 0, 16,11, 11, 6, 6, 1 }, PixelFormatInfo::RGBA },
5050
{ 2, 16, { 4, 0, 16,12, 12, 8, 8, 4 }, PixelFormatInfo::RGBA },
51-
{ 1, 8, { 8, 0, 0, 0, 0, 0, 0, 0 }, PixelFormatInfo::ALPHA}
51+
{ 1, 8, { 8, 0, 0, 0, 0, 0, 0, 0 }, PixelFormatInfo::ALPHA},
52+
{ 1, 8, { 0, 0, 8, 0, 8, 0, 8, 0 }, PixelFormatInfo::L },
53+
{ 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 },
5255
};
5356

5457
static const Info* gGetPixelFormatTable(size_t* numEntries) {

services/surfaceflinger/Layer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
160160
// this surfaces pixel format
161161
PixelFormatInfo info;
162162
status_t err = getPixelFormatInfo(format, &info);
163-
if (err) return err;
163+
if (err) {
164+
ALOGE("unsupported pixelformat %d", format);
165+
return err;
166+
}
164167

165168
// the display's pixel format
166169
const DisplayHardware& hw(graphicPlane(0).displayHardware());
@@ -170,6 +173,7 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
170173
// never allow a surface larger than what our underlying GL implementation
171174
// can handle.
172175
if ((uint32_t(w)>maxSurfaceDims) || (uint32_t(h)>maxSurfaceDims)) {
176+
ALOGE("dimensions too large %u x %u", uint32_t(w), uint32_t(h));
173177
return BAD_VALUE;
174178
}
175179

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ sp<ISurface> SurfaceFlinger::createSurface(
12851285
return surfaceHandle;
12861286
}
12871287

1288-
//ALOGD("createSurface for pid %d (%d x %d)", pid, w, h);
1288+
//ALOGD("createSurface for (%d x %d), name=%s", w, h, name.string());
12891289
sp<Layer> normalLayer;
12901290
switch (flags & eFXSurfaceMask) {
12911291
case eFXSurfaceNormal:

0 commit comments

Comments
 (0)