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

Commit 74861ad4 authored by Peiyong Lin's avatar Peiyong Lin
Browse files

[SurfaceFlinger] Update comments to clarify transform.

Clarify the source coordinate space and destination coordinate space for
transforms.

Bug: N/A
Test: N/A
Change-Id: I93f6770f8a1f03f81e30e42a80c3196ccb1b0fee
parent d72053c6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2453,6 +2453,7 @@ InputWindowInfo Layer::fillInputInfo() {
        ySurfaceInset = std::round(ySurfaceInset * yScale);
    }

    // Transform the layer bounds from layer coordinate space to display coordinate space.
    Rect transformedLayerBounds = t.transform(layerBounds);

    // clamp inset to layer bounds
@@ -2477,7 +2478,7 @@ InputWindowInfo Layer::fillInputInfo() {
        transformedLayerBounds.bottom = tmp;
    }

    // Input coordinate should match the layer bounds.
    // Input coordinates should be in display coordinate space.
    info.frameLeft = transformedLayerBounds.left;
    info.frameTop = transformedLayerBounds.top;
    info.frameRight = transformedLayerBounds.right;
@@ -2490,7 +2491,7 @@ InputWindowInfo Layer::fillInputInfo() {
    // the final frame calculated.
    // 1. Take the original transform set on the window and get the inverse transform. This is
    //    used to get the final bounds in display space (ignorning the transform). Apply the
    //    inverse transform on the layerBounds to get the untransformed frame (in display space)
    //    inverse transform on the layerBounds to get the untransformed frame (in layer space)
    // 2. Take the top and left of the untransformed frame to get the real position on screen.
    //    Apply the layer transform on top/left so it includes any scale or rotation. These will
    //    be the new translation values for the transform.
+2 −1
Original line number Diff line number Diff line
@@ -1076,7 +1076,8 @@ private:
    sp<Layer> getRootLayer();

    // Cached properties computed from drawing state
    // Effective transform taking into account parent transforms and any parent scaling.
    // Effective transform taking into account parent transforms and any parent scaling, which is
    // a transform from the current layer coordinate space to display(screen) coordinate space.
    ui::Transform mEffectiveTransform;

    // Bounds of the layer before any transformation is applied and before it has been cropped