summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lentine <mlentine@google.com>2014-08-20 15:32:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-19 22:53:25 +0000
commit2cfbef255b0e1b1b8fad3cba0e447d79a7b8203b (patch)
treea4413b765f8fafde10840c8b814cf456f9c5c471
parent62205596b9848d9d7d9de90aa0f5682d6ce17ea3 (diff)
parent7b90258c7b1b6caf7fbbf62423723d0f4cdc79aa (diff)
downloadframeworks_native-2cfbef255b0e1b1b8fad3cba0e447d79a7b8203b.zip
frameworks_native-2cfbef255b0e1b1b8fad3cba0e447d79a7b8203b.tar.gz
frameworks_native-2cfbef255b0e1b1b8fad3cba0e447d79a7b8203b.tar.bz2
Merge "Fix inverse orientation when original is not applied first." into lmp-dev
-rw-r--r--services/surfaceflinger/Layer.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 2bbb223..a36ddd9 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -348,8 +348,17 @@ FloatRect Layer::computeCrop(const sp<const DisplayDevice>& hw) const {
int winWidth = s.active.w;
int winHeight = s.active.h;
if (invTransform & NATIVE_WINDOW_TRANSFORM_ROT_90) {
- invTransform ^= NATIVE_WINDOW_TRANSFORM_FLIP_V |
- NATIVE_WINDOW_TRANSFORM_FLIP_H;
+ // If the activeCrop has been rotate the ends are rotated but not
+ // the space itself so when transforming ends back we can't rely on
+ // a modification of the axes of rotation. To account for this we
+ // need to reorient the inverse rotation in terms of the current
+ // axes of rotation.
+ bool is_h_flipped = (invTransform & NATIVE_WINDOW_TRANSFORM_FLIP_H) != 0;
+ bool is_v_flipped = (invTransform & NATIVE_WINDOW_TRANSFORM_FLIP_V) != 0;
+ if (is_h_flipped == is_v_flipped) {
+ invTransform ^= NATIVE_WINDOW_TRANSFORM_FLIP_V |
+ NATIVE_WINDOW_TRANSFORM_FLIP_H;
+ }
winWidth = s.active.h;
winHeight = s.active.w;
}