diff options
author | Alec Mouri <alecmouri@google.com> | 2019-06-20 14:12:17 -0700 |
---|---|---|
committer | Alec Mouri <alecmouri@google.com> | 2019-06-20 14:12:17 -0700 |
commit | 21fab7521e3d908987f2affe480d4d1a71d61f4d (patch) | |
tree | 7b0fa0c8c7fb3b94124282fabc579987eafd89ee | |
parent | 4f65d3377b9f3b83fa75b94ccc7b459b98376b11 (diff) | |
download | native-21fab7521e3d908987f2affe480d4d1a71d61f4d.tar.gz |
[SurfaceFlinger] Fix screenshot orientation in landscape
Change I0f7db422399985a1ff17da3faa946ff0943e58f7 defined a reverse
mapping for use by screenshots, e.g. a 90 degree rotation would be
passed down to SurfaceFlinger as 270 degrees. Change
I644bff547bed7d24284b8a6e7899a567d1f4cddf accidentally removed this
mapping, so adding it back into SurfaceFlinger.
Bug: 133849373
Test: adb screencap when phone is in landscape
Change-Id: I9d12551587307fa9f8028e78649545064051b46e
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index dd75868443..928bbb5ad6 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -5606,6 +5606,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); } |