Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5af281f4 authored by Michael Lentine's avatar Michael Lentine
Browse files

Fix HWComposer Surface Crop when surface is rotated

Bug: 15091149

Change-Id: I97ecd8af9636da9403fafdb3f9b846f95053ebb7
parent 812e039a
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -332,7 +332,7 @@ 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);
@@ -340,8 +340,8 @@ FloatRect Layer::computeCrop(const sp<const DisplayDevice>& hw) const {

        float insetL = winCrop.left                  * xScale;
        float insetT = winCrop.top                   * yScale;
        float insetR = (winWidth  - winCrop.right ) * xScale;
        float insetB = (winHeight - winCrop.bottom) * yScale;
        float insetR = (s.active.w - winCrop.right ) * xScale;
        float insetB = (s.active.h - winCrop.bottom) * yScale;

        crop.left   += insetL;
        crop.top    += insetT;