summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-06-24 19:22:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-06-24 19:22:17 +0000
commitfeb6af0eaf391e16c95bf45273f2d37bebdadc43 (patch)
treed82ce4a49c893dd71bfc3041640264f2975d876a
parent5e3645666e00d21144865177e6e8b3b740b4a4f7 (diff)
parent21fab7521e3d908987f2affe480d4d1a71d61f4d (diff)
downloadnative-feb6af0eaf391e16c95bf45273f2d37bebdadc43.tar.gz
Merge "[SurfaceFlinger] Fix screenshot orientation in landscape" into qt-dev
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 2579225675..2d319101b3 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -5613,6 +5613,11 @@ status_t SurfaceFlinger::captureScreen(uint64_t displayOrLayerStack, Dataspace*
captureOrientation = fromSurfaceComposerRotation(
static_cast<ISurfaceComposer::Rotation>(display->getOrientation()));
+ if (captureOrientation == ui::Transform::orientation_flags::ROT_90) {
+ captureOrientation = ui::Transform::orientation_flags::ROT_270;
+ } else if (captureOrientation == ui::Transform::orientation_flags::ROT_270) {
+ captureOrientation = ui::Transform::orientation_flags::ROT_90;
+ }
*outDataspace =
pickDataspaceFromColorMode(display->getCompositionDisplay()->getState().colorMode);
}