From ad1c5cf963e85d2efe7b34c07e076dbf6b6ab7d0 Mon Sep 17 00:00:00 2001 From: Omprakash Dhyade Date: Thu, 5 Aug 2010 16:28:37 -0700 Subject: frameworks/base: Swap width and height of temporary buffer only with orientation change Current code swaps the width and height by assuming that aspect ratio of the buffer width and height will be same as that of the layout clip width and height. That is not always true. Change the check to orientation change. Change-Id: Ie387f3a7369025427484e4173cbde7a08df2b9d7 --- services/surfaceflinger/LayerBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/surfaceflinger/LayerBuffer.cpp') diff --git a/services/surfaceflinger/LayerBuffer.cpp b/services/surfaceflinger/LayerBuffer.cpp index 5c21593db2..0869283d27 100644 --- a/services/surfaceflinger/LayerBuffer.cpp +++ b/services/surfaceflinger/LayerBuffer.cpp @@ -540,7 +540,7 @@ status_t LayerBuffer::BufferSource::initTempBuffer() const const ISurface::BufferHeap& buffers(mBufferHeap); uint32_t w = mLayer.mTransformedBounds.width(); uint32_t h = mLayer.mTransformedBounds.height(); - if (buffers.w * h != buffers.h * w) { + if (mLayer.getOrientation() & (Transform::ROT_90 | Transform::ROT_270)) { int t = w; w = h; h = t; } -- cgit v1.2.3-59-g8ed1b