From 6213bd900145b9189c7d87aec8a2714a66c8d057 Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Fri, 8 May 2020 17:42:25 -0700 Subject: Provide a fixed transform hint if the layer is in a fixed orientation 1/2 The transform hint is used to prevent allocating a buffer of a different size when a layer is rotated. The producer can choose to consume the hint and allocate the buffer with the same size. Provide the graphic producer a transform hint if the layer and its children are in an orientation different from the display's orientation. The caller is responsible for clearing this transform hint if the layer is no longer in a fixed orientation. Bug: 152919661 Test: atest VulkanPreTransformTest Test: confirm with winscope trace, buffers are allocated taking into account the transform hint in fixed orientation scenarios Test: go/wm-smoke Change-Id: Iea9dcf909921802a5be5c44dd61be3274f36bbd8 --- services/surfaceflinger/BufferQueueLayer.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'services/surfaceflinger/BufferQueueLayer.cpp') diff --git a/services/surfaceflinger/BufferQueueLayer.cpp b/services/surfaceflinger/BufferQueueLayer.cpp index f4e630e4d8..5d807681b2 100644 --- a/services/surfaceflinger/BufferQueueLayer.cpp +++ b/services/surfaceflinger/BufferQueueLayer.cpp @@ -58,8 +58,9 @@ void BufferQueueLayer::onLayerDisplayed(const sp& releaseFence) { } } -void BufferQueueLayer::setTransformHint(uint32_t orientation) const { - mConsumer->setTransformHint(orientation); +void BufferQueueLayer::setTransformHint(ui::Transform::RotationFlags displayTransformHint) const { + BufferLayer::setTransformHint(displayTransformHint); + mConsumer->setTransformHint(mTransformHint); } std::vector BufferQueueLayer::getOccupancyHistory(bool forceFlush) { @@ -493,10 +494,6 @@ void BufferQueueLayer::onFirstRef() { if (!mFlinger->isLayerTripleBufferingDisabled()) { mProducer->setMaxDequeuedBufferCount(2); } - - if (const auto display = mFlinger->getDefaultDisplayDeviceLocked()) { - updateTransformHint(display); - } } status_t BufferQueueLayer::setDefaultBufferProperties(uint32_t w, uint32_t h, PixelFormat format) { -- cgit v1.2.3-59-g8ed1b