summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Hung <arthurhung@google.com>2021-06-22 03:27:27 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-06-22 03:27:27 +0000
commit4aa928154b233b893a0ac4c2fffed8f2fb4f9a95 (patch)
tree15785b21724e9f5a134c95be1e54b6069f2e1330
parent769add28779ff4f9aec5aec9a61334c1af7bd0f6 (diff)
parentb6aa9a0486bece3a93b4ffcfc76ed32f874a236d (diff)
downloadnative-4aa928154b233b893a0ac4c2fffed8f2fb4f9a95.tar.gz
Merge "Update transform hint from relayout window (2/2)" into sc-dev
-rw-r--r--libs/gui/BLASTBufferQueue.cpp5
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp6
2 files changed, 10 insertions, 1 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index 184d24257d..364c939c18 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -205,6 +205,11 @@ void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width,
applyTransaction = true;
}
+ if (mSurfaceControl != nullptr) {
+ mTransformHint = mSurfaceControl->getTransformHint();
+ mBufferItemConsumer->setTransformHint(mTransformHint);
+ }
+
ui::Size newSize(width, height);
if (mRequestedSize != newSize) {
mRequestedSize.set(newSize);
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index e01ea5c027..b99531b790 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2857,7 +2857,9 @@ void SurfaceFlinger::processDisplayChanged(const wp<IBinder>& displayToken,
(currentState.orientedDisplaySpaceRect != drawingState.orientedDisplaySpaceRect)) {
display->setProjection(currentState.orientation, currentState.layerStackSpaceRect,
currentState.orientedDisplaySpaceRect);
- mDefaultDisplayTransformHint = display->getTransformHint();
+ if (display->isPrimary()) {
+ mDefaultDisplayTransformHint = display->getTransformHint();
+ }
}
if (currentState.width != drawingState.width ||
currentState.height != drawingState.height) {
@@ -6912,6 +6914,8 @@ sp<Layer> SurfaceFlinger::handleLayerCreatedLocked(const sp<IBinder>& handle, bo
parent->addChild(layer);
}
+ layer->updateTransformHint(mDefaultDisplayTransformHint);
+
if (state->initialProducer != nullptr) {
mGraphicBufferProducerList.insert(state->initialProducer);
LOG_ALWAYS_FATAL_IF(mGraphicBufferProducerList.size() > mMaxGraphicBufferProducerListSize,