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

Commit b742d45a authored by shawnlin's avatar shawnlin
Browse files

Fixed cutout not drawn when it's inside rounded corner rect

We may clear the color(if useInvertedAlphaColor is true) of the rounded
corner rects before drawing rounded corners. If a cutout happens to be
inside one of there rects, it will be cleared, so we should draw rounded
corners before cutout.

Bug: 223952603
Test: manual: select punch hole or corner cutout in the settings.
Change-Id: I57298a849bbf5f286e154bf903705dbdfa5930ab
parent 14de9cb2
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -119,9 +119,13 @@ class ScreenDecorHwcLayer(context: Context, displayDecorationSupport: DisplayDec
        if (useInvertedAlphaColor) {
        if (useInvertedAlphaColor) {
            canvas.drawColor(bgColor)
            canvas.drawColor(bgColor)
        }
        }

        // We may clear the color(if useInvertedAlphaColor is true) of the rounded corner rects
        // before drawing rounded corners. If the cutout happens to be inside one of these rects, it
        // will be cleared, so we have to draw rounded corners before cutout.
        drawRoundedCorners(canvas)
        // Cutouts are drawn in DisplayCutoutBaseView.onDraw()
        // Cutouts are drawn in DisplayCutoutBaseView.onDraw()
        super.onDraw(canvas)
        super.onDraw(canvas)
        drawRoundedCorners(canvas)


        debugTransparentRegionPaint?.let {
        debugTransparentRegionPaint?.let {
            calculateTransparentRect()
            calculateTransparentRect()