summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2015-06-10 17:52:50 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-06-10 17:52:50 +0000
commit355950c1fc19c35c75203ea761882168f0980181 (patch)
treeb814d85d53a175dc41df0256fe60861c0bbe5e2b /services
parent633b35b4dcadc772fae5bc35404db965b18d370f (diff)
parentd177e044d129bbecc3900a7fcd442b354de768df (diff)
downloadframeworks_native-355950c1fc19c35c75203ea761882168f0980181.zip
frameworks_native-355950c1fc19c35c75203ea761882168f0980181.tar.gz
frameworks_native-355950c1fc19c35c75203ea761882168f0980181.tar.bz2
am d177e044: Merge "SF: Swap w/h when capturing rotated screenshots" into mnc-dev
* commit 'd177e044d129bbecc3900a7fcd442b354de768df': SF: Swap w/h when capturing rotated screenshots
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp8
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)",