summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerDim.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-10-26 20:12:37 -0700
committerMathias Agopian <mathias@google.com>2009-10-27 13:13:29 -0700
commit54ba51dff21de666c5ae3bf3abd4f0634ebb0676 (patch)
tree58a69dccdbfd227b9de3c58a416de45d2a8d3513 /libs/surfaceflinger/LayerDim.cpp
parent36bc94173c957f33f70bcd16c369951f5b2dc3f6 (diff)
downloadframeworks_native-54ba51dff21de666c5ae3bf3abd4f0634ebb0676.zip
frameworks_native-54ba51dff21de666c5ae3bf3abd4f0634ebb0676.tar.gz
frameworks_native-54ba51dff21de666c5ae3bf3abd4f0634ebb0676.tar.bz2
fix [2143798] Need to figure out how to do video
Use EGLImageKHR instead of copybit directly. We now have the basis to use streaming YUV textures (well, in fact we already are). When/if we use the GPU instead of the MDP we'll need to make sure it supports the appropriate YUV format. Also make sure we compile if EGL_ANDROID_image_native_buffer is not supported
Diffstat (limited to 'libs/surfaceflinger/LayerDim.cpp')
-rw-r--r--libs/surfaceflinger/LayerDim.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/surfaceflinger/LayerDim.cpp b/libs/surfaceflinger/LayerDim.cpp
index 538dc77..fd61e30 100644
--- a/libs/surfaceflinger/LayerDim.cpp
+++ b/libs/surfaceflinger/LayerDim.cpp
@@ -55,8 +55,8 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h)
sHeight = h;
sUseTexture = false;
-#ifdef DIM_WITH_TEXTURE
-
+#if defined(DIM_WITH_TEXTURE) && defined(EGL_ANDROID_image_native_buffer)
+
#warning "using a texture to implement LayerDim"
/* On some h/w like msm7K, it is faster to use a texture because the
@@ -69,7 +69,6 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h)
uint32_t flags = hw.getFlags();
if (LIKELY(flags & DisplayHardware::DIRECT_TEXTURE)) {
- // TODO: api to pass the usage flags
sp<GraphicBuffer> buffer = new GraphicBuffer(w, h, PIXEL_FORMAT_RGB_565,
GraphicBuffer::USAGE_SW_WRITE_OFTEN |
GraphicBuffer::USAGE_HW_TEXTURE);
@@ -123,7 +122,7 @@ void LayerDim::onDraw(const Region& clip) const
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glColor4x(0, 0, 0, alpha);
-#ifdef DIM_WITH_TEXTURE
+#if defined(DIM_WITH_TEXTURE) && defined(EGL_ANDROID_image_native_buffer)
if (sUseTexture) {
glBindTexture(GL_TEXTURE_2D, sTexId);
glEnable(GL_TEXTURE_2D);