Skip to content

Commit 92bd90d

Browse files
Omprakash DhyadeNaomi Luis
authored andcommitted
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
1 parent 0f0dd44 commit 92bd90d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/surfaceflinger/LayerBuffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ status_t LayerBuffer::BufferSource::initTempBuffer() const
540540
const ISurface::BufferHeap& buffers(mBufferHeap);
541541
uint32_t w = mLayer.mTransformedBounds.width();
542542
uint32_t h = mLayer.mTransformedBounds.height();
543-
if (buffers.w * h != buffers.h * w) {
543+
if (mLayer.getOrientation() & (Transform::ROT_90 | Transform::ROT_270)) {
544544
int t = w; w = h; h = t;
545545
}
546546

0 commit comments

Comments
 (0)