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
This commit is contained in:
Mathias Agopian 2013-03-13 15:22:11 -07:00
parent 35ffa6a868
commit 6a531717cd

View File

@ -2787,7 +2787,7 @@ status_t SurfaceFlinger::captureScreenImplLocked(
sp<GraphicBuffer> buf(consumer->getCurrentBuffer()); sp<GraphicBuffer> buf(consumer->getCurrentBuffer());
sw = buf->getWidth(); sw = buf->getWidth();
sh = buf->getHeight(); sh = buf->getHeight();
size_t size = buf->getStride() * sh * 4; size_t size = sw * sh * 4;
// allocate shared memory large enough to hold the // allocate shared memory large enough to hold the
// screen capture // screen capture