diff options
author | Michael Lentine <mlentine@google.com> | 2014-08-07 13:40:48 -0700 |
---|---|---|
committer | Michael Lentine <mlentine@google.com> | 2014-08-07 13:44:14 -0700 |
commit | 5af281f4abb0401ebb4e614291a19780b71f236c (patch) | |
tree | b601ebde9360769714a05dfed82fb3a79c335ad3 | |
parent | 812e039aeb42c1a3c8bb8246c114f54115a335da (diff) | |
download | frameworks_native-5af281f4abb0401ebb4e614291a19780b71f236c.zip frameworks_native-5af281f4abb0401ebb4e614291a19780b71f236c.tar.gz frameworks_native-5af281f4abb0401ebb4e614291a19780b71f236c.tar.bz2 |
Fix HWComposer Surface Crop when surface is rotated
Bug: 15091149
Change-Id: I97ecd8af9636da9403fafdb3f9b846f95053ebb7
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index bbb5cfe..716d24e 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -332,16 +332,16 @@ FloatRect Layer::computeCrop(const sp<const DisplayDevice>& hw) const { winHeight = s.active.w; } const Rect winCrop = activeCrop.transform( - invTransform, s.active.w, s.active.h); + invTransform, winWidth, winHeight); // below, crop is intersected with winCrop expressed in crop's coordinate space float xScale = crop.getWidth() / float(winWidth); float yScale = crop.getHeight() / float(winHeight); - float insetL = winCrop.left * xScale; - float insetT = winCrop.top * yScale; - float insetR = (winWidth - winCrop.right ) * xScale; - float insetB = (winHeight - winCrop.bottom) * yScale; + float insetL = winCrop.left * xScale; + float insetT = winCrop.top * yScale; + float insetR = (s.active.w - winCrop.right ) * xScale; + float insetB = (s.active.h - winCrop.bottom) * yScale; crop.left += insetL; crop.top += insetT; |