diff options
author | Dan Stoza <stoza@google.com> | 2015-06-09 16:44:40 -0700 |
---|---|---|
committer | Dan Stoza <stoza@google.com> | 2015-06-09 16:46:20 -0700 |
commit | 3502416204d9dbd905012ee586d8bd145323809f (patch) | |
tree | 196be9d1faa468cf52b0fc437ce2c362806883a9 /services/surfaceflinger | |
parent | 3d0518565a5e704dc8020a96c5bb3a96a093f4cd (diff) | |
download | frameworks_native-3502416204d9dbd905012ee586d8bd145323809f.zip frameworks_native-3502416204d9dbd905012ee586d8bd145323809f.tar.gz frameworks_native-3502416204d9dbd905012ee586d8bd145323809f.tar.bz2 |
SF: Swap w/h when capturing rotated screenshots
Swaps width and height when capturing a screenshot that is rotated by
90 or 270 degrees.
Bug: 8433742
Change-Id: Ibf0b604f541e3cc271e56fe0ad04dc366beb5d79
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 1388ce8..a426ad6 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3320,8 +3320,12 @@ status_t SurfaceFlinger::captureScreenImplLocked( ATRACE_CALL(); // get screen geometry - const uint32_t hw_w = hw->getWidth(); - const uint32_t hw_h = hw->getHeight(); + uint32_t hw_w = hw->getWidth(); + uint32_t hw_h = hw->getHeight(); + + if (rotation & Transform::ROT_90) { + std::swap(hw_w, hw_h); + } if ((reqWidth > hw_w) || (reqHeight > hw_h)) { ALOGE("size mismatch (%d, %d) > (%d, %d)", |