diff options
author | Mathias Agopian <mathias@google.com> | 2013-08-21 18:55:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-21 18:55:19 +0000 |
commit | a525483dc73df39a72c9b4865102a86704b3622c (patch) | |
tree | f9483fd28065be4fd22b4bdcaa09d64d940b8530 /services | |
parent | d2cf8c2f07b4285a224acd262e6f052c37dbc0b0 (diff) | |
parent | 0e8f1443b87f9009159cef6394de48894f98f826 (diff) | |
download | frameworks_native-a525483dc73df39a72c9b4865102a86704b3622c.zip frameworks_native-a525483dc73df39a72c9b4865102a86704b3622c.tar.gz frameworks_native-a525483dc73df39a72c9b4865102a86704b3622c.tar.bz2 |
Merge "Fix a bug where non-cropped layer could be scaled incorrectly" into klp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 7150fa1..d88f6d0 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -287,7 +287,13 @@ FloatRect Layer::computeCrop(const sp<const DisplayDevice>& hw) const { // pixels in the buffer. // FIXME: the 3 lines below can produce slightly incorrect clipping when we have // a viewport clipping and a window transform. we should use floating point to fix this. - Rect activeCrop(s.transform.transform(s.active.crop)); + + Rect activeCrop(s.active.w, s.active.h); + if (!s.active.crop.isEmpty()) { + activeCrop = s.active.crop; + } + + activeCrop = s.transform.transform(activeCrop); activeCrop.intersect(hw->getViewport(), &activeCrop); activeCrop = s.transform.inverse().transform(activeCrop); |