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

Commit 5a350596 authored by Michael Lentine's avatar Michael Lentine Committed by Android (Google) Code Review
Browse files

Merge "Fix HWComposer Surface Crop when surface is rotated" into lmp-dev

parents bb6adf0d 5af281f4
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;