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 committed by The Android Automerger
parent b4477d5638
commit 397ff875b2

View File

@ -2783,7 +2783,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