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

Commit bb60061a authored by Leon Scroggins's avatar Leon Scroggins Committed by Automerger Merge Worker
Browse files

Merge "Update transparent region when cutouts update" into tm-dev am: 005eea08

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17261837

Change-Id: Iab5abe1bb437762b2fcd90cbbac43910d865a914
parents c92a0084 005eea08
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView {
    override fun onAttachedToWindow() {
        super.onAttachedToWindow()
        updateCutout()
        updateProtectionBoundingPath()
        onUpdate()
    }

    fun onDisplayChanged(displayId: Int) {
@@ -93,6 +95,7 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView {
        if (displayId == display.displayId) {
            updateCutout()
            updateProtectionBoundingPath()
            onUpdate()
        }
    }

@@ -100,8 +103,13 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView {
        displayRotation = rotation
        updateCutout()
        updateProtectionBoundingPath()
        onUpdate()
    }

    // Called after the cutout and protection bounding path change. Subclasses
    // should make any changes that need to happen based on the change.
    open fun onUpdate() = Unit

    @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
    public override fun onDraw(canvas: Canvas) {
        super.onDraw(canvas)
+4 −0
Original line number Diff line number Diff line
@@ -114,6 +114,10 @@ class ScreenDecorHwcLayer(context: Context, displayDecorationSupport: DisplayDec
        }
    }

    override fun onUpdate() {
        parent.requestTransparentRegion(this)
    }

    override fun onDraw(canvas: Canvas) {
        // If updating onDraw, also update gatherTransparentRegion
        if (useInvertedAlphaColor) {