summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerDim.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-06-25 16:21:32 -0700
committerMathias Agopian <mathias@google.com>2009-06-25 16:21:32 -0700
commit958b3cac99cef204767b9c8f5bb8e20cbe1fc97b (patch)
tree049f6e81a2b1f9cf74fa43c74a93eaf29b3f9bee /libs/surfaceflinger/LayerDim.cpp
parent240c9fe59e9db5807c88796f60889acc44ba845c (diff)
downloadframeworks_native-958b3cac99cef204767b9c8f5bb8e20cbe1fc97b.zip
frameworks_native-958b3cac99cef204767b9c8f5bb8e20cbe1fc97b.tar.gz
frameworks_native-958b3cac99cef204767b9c8f5bb8e20cbe1fc97b.tar.bz2
use 1/16 the size (20KB) for the dim texture in the copybit/msm case
Diffstat (limited to 'libs/surfaceflinger/LayerDim.cpp')
-rw-r--r--libs/surfaceflinger/LayerDim.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/surfaceflinger/LayerDim.cpp b/libs/surfaceflinger/LayerDim.cpp
index 5cb883c..4114a42 100644
--- a/libs/surfaceflinger/LayerDim.cpp
+++ b/libs/surfaceflinger/LayerDim.cpp
@@ -63,6 +63,12 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h)
* This burns a full-screen worth of graphic memory.
*/
+ // copybit supports 4x scaling, so we only need to allocate 1/16 of the
+ // buffer.
+ // FIXME: we have to add 1px because the mdp fails
+ w = w/4 + 1;
+ h = h/4 + 1;
+
const DisplayHardware& hw(flinger->graphicPlane(0).displayHardware());
uint32_t flags = hw.getFlags();
@@ -93,7 +99,7 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h)
// initialize the texture with zeros
GGLSurface t;
buffer->lock(&t, GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_OFTEN);
- memset(t.data, 0, t.width * t.stride * 2);
+ memset(t.data, 0, t.stride * t.height * 2);
buffer->unlock();
sUseTexture = true;
}