From 6a531717cddf1d30be0946884d21c27e5b6b390c Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 13 Mar 2013 15:22:11 -0700 Subject: [PATCH] size IMemoryHeap properly for screenshots since we're using glReadPixels(), we only need to use the width (as opposed to the stride) of the source screenshot. Bug: 8374664 Change-Id: I145c80f4fff5444df7c77c4f52e70a7203caddbd --- services/surfaceflinger/SurfaceFlinger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index c0ce6590d..98f6dedcc 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2787,7 +2787,7 @@ status_t SurfaceFlinger::captureScreenImplLocked( sp buf(consumer->getCurrentBuffer()); sw = buf->getWidth(); sh = buf->getHeight(); - size_t size = buf->getStride() * sh * 4; + size_t size = sw * sh * 4; // allocate shared memory large enough to hold the // screen capture