diff options
author | Dan Stoza <stoza@google.com> | 2015-06-10 17:28:32 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-10 17:28:33 +0000 |
commit | d177e044d129bbecc3900a7fcd442b354de768df (patch) | |
tree | fc539edeeb8c1821abbb0231b7c607a165ef4dd7 /services | |
parent | 2560442a1ed7e21b9d941218d2e9e203626fa731 (diff) | |
parent | 3502416204d9dbd905012ee586d8bd145323809f (diff) | |
download | frameworks_native-d177e044d129bbecc3900a7fcd442b354de768df.zip frameworks_native-d177e044d129bbecc3900a7fcd442b354de768df.tar.gz frameworks_native-d177e044d129bbecc3900a7fcd442b354de768df.tar.bz2 |
Merge "SF: Swap w/h when capturing rotated screenshots" into mnc-dev
Diffstat (limited to 'services')
-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)", |