summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-06-30 15:43:47 -0700
committerMathias Agopian <mathias@google.com>2010-06-30 15:43:47 -0700
commita8f3e4e53cad835d0d57b85a6ce1b7416e95ba73 (patch)
treecad54a8bd807e224e6410cd7da2964e3bdee6595 /libs/surfaceflinger
parent5d8f41cab1c9d48b3d9066090674ec841a68a7aa (diff)
downloadframeworks_native-a8f3e4e53cad835d0d57b85a6ce1b7416e95ba73.zip
frameworks_native-a8f3e4e53cad835d0d57b85a6ce1b7416e95ba73.tar.gz
frameworks_native-a8f3e4e53cad835d0d57b85a6ce1b7416e95ba73.tar.bz2
fix live wallpapers on Droid
On omap3 h/w we force opaque formats to RGB_565 instead of RGBX_8888 because the GL driver doesn't support it. RGBX_8888 is always remapped to RGBA_8888. Change-Id: I0bfabeb98c8d3a399079e6797cf2a0ee95915324
Diffstat (limited to 'libs/surfaceflinger')
-rw-r--r--libs/surfaceflinger/Android.mk4
-rw-r--r--libs/surfaceflinger/SurfaceFlinger.cpp9
2 files changed, 13 insertions, 0 deletions
diff --git a/libs/surfaceflinger/Android.mk b/libs/surfaceflinger/Android.mk
index dbe351e..a14bfb5 100644
--- a/libs/surfaceflinger/Android.mk
+++ b/libs/surfaceflinger/Android.mk
@@ -20,6 +20,10 @@ LOCAL_SRC_FILES:= \
LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+ifeq ($(TARGET_BOARD_PLATFORM), omap3)
+ LOCAL_CFLAGS += -DNO_RGBX_8888
+endif
+
# need "-lrt" on Linux simulator to pick up clock_gettime
ifeq ($(TARGET_SIMULATOR),true)
ifeq ($(HOST_OS),linux)
diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp
index 23efd16..68e8f19 100644
--- a/libs/surfaceflinger/SurfaceFlinger.cpp
+++ b/libs/surfaceflinger/SurfaceFlinger.cpp
@@ -1263,10 +1263,19 @@ sp<Layer> SurfaceFlinger::createNormalSurface(
format = PIXEL_FORMAT_RGBA_8888;
break;
case PIXEL_FORMAT_OPAQUE:
+#ifdef NO_RGBX_8888
+ format = PIXEL_FORMAT_RGB_565;
+#else
format = PIXEL_FORMAT_RGBX_8888;
+#endif
break;
}
+#ifdef NO_RGBX_8888
+ if (format == PIXEL_FORMAT_RGBX_8888)
+ format = PIXEL_FORMAT_RGBA_8888;
+#endif
+
sp<Layer> layer = new Layer(this, display, client);
status_t err = layer->setBuffers(w, h, format, flags);
if (LIKELY(err != NO_ERROR)) {