summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-09-14 18:10:30 -0700
committerMathias Agopian <mathias@google.com>2009-09-14 18:10:30 -0700
commit64a7c6bf5b73c1a401cb2aa8dfad3898166ae326 (patch)
treefe2f128d94e4576d7b353df06ef816cf3ceb181c
parente7f47f50ad0a97e32c87104e56f311db910e98f1 (diff)
downloadframeworks_base-64a7c6bf5b73c1a401cb2aa8dfad3898166ae326.zip
frameworks_base-64a7c6bf5b73c1a401cb2aa8dfad3898166ae326.tar.gz
frameworks_base-64a7c6bf5b73c1a401cb2aa8dfad3898166ae326.tar.bz2
add support for RGBX_8888 surfaces in SurfaceFlinger
-rw-r--r--libs/surfaceflinger/Buffer.cpp3
-rw-r--r--libs/surfaceflinger/Layer.cpp3
-rw-r--r--libs/surfaceflinger/LayerBase.cpp6
3 files changed, 10 insertions, 2 deletions
diff --git a/libs/surfaceflinger/Buffer.cpp b/libs/surfaceflinger/Buffer.cpp
index 4a7c55e..65650aa 100644
--- a/libs/surfaceflinger/Buffer.cpp
+++ b/libs/surfaceflinger/Buffer.cpp
@@ -106,6 +106,9 @@ status_t Buffer::initSize(uint32_t w, uint32_t h, PixelFormat format,
// the requested flags should be honored.
usage = reqUsage | BufferAllocator::USAGE_HW_TEXTURE;
}
+
+ if (format == PIXEL_FORMAT_RGBX_8888)
+ format = PIXEL_FORMAT_RGBA_8888;
err = allocator.alloc(w, h, format, usage, &handle, &stride);
if (err == NO_ERROR) {
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp
index 6275910..1e7f1e6 100644
--- a/libs/surfaceflinger/Layer.cpp
+++ b/libs/surfaceflinger/Layer.cpp
@@ -176,6 +176,9 @@ void Layer::reloadTexture(const Region& dirty)
// this failed, for instance, because we don't support
// NPOT.
// FIXME: do something!
+ LOGD("layer=%p, glEGLImageTargetTexture2DOES(%d) "
+ "failed err=0x%04x",
+ this, mTextures[index].image, error);
mFlags &= ~DisplayHardware::DIRECT_TEXTURE;
} else {
// Everything went okay!
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp
index 1f22488..e08861d 100644
--- a/libs/surfaceflinger/LayerBase.cpp
+++ b/libs/surfaceflinger/LayerBase.cpp
@@ -590,7 +590,8 @@ regular:
glTexImage2D(GL_TEXTURE_2D, 0,
GL_RGBA, texture_w, texture_h, 0,
GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, data);
- } else if (t.format == GGL_PIXEL_FORMAT_RGBA_8888) {
+ } else if (t.format == GGL_PIXEL_FORMAT_RGBA_8888 ||
+ t.format == GGL_PIXEL_FORMAT_RGBX_8888) {
glTexImage2D(GL_TEXTURE_2D, 0,
GL_RGBA, texture_w, texture_h, 0,
GL_RGBA, GL_UNSIGNED_BYTE, data);
@@ -620,7 +621,8 @@ regular:
0, bounds.top, t.width, bounds.height(),
GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4,
t.data + bounds.top*t.stride*2);
- } else if (t.format == GGL_PIXEL_FORMAT_RGBA_8888) {
+ } else if (t.format == GGL_PIXEL_FORMAT_RGBA_8888 ||
+ t.format == GGL_PIXEL_FORMAT_RGBX_8888) {
glTexSubImage2D(GL_TEXTURE_2D, 0,
0, bounds.top, t.width, bounds.height(),
GL_RGBA, GL_UNSIGNED_BYTE,