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

Commit 9484f0c8 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Revert^2 "Don't draw QS if not visible"

This reverts commit f26007d5.

Reason for revert: Revert was not necessary. No perf regression, just moving from one metric to another. https://b.corp.google.com/issues/413411524#comment22

Bug: 413411524
Fixes: 404575233
Change-Id: I6531fc52fb950f41ab9c9a4087f10ef66672a7d5
parent f26007d5
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -472,6 +472,7 @@ constructor(
    }

    override fun setQsVisible(qsVisible: Boolean) {
        containerView?.qsVisible = qsVisible
        viewModel.isQsVisible = qsVisible
    }

@@ -1154,6 +1155,14 @@ private class FrameLayoutTouchPassthrough(
            }
        }

    var qsVisible: Boolean = false
        set(value) {
            if (value != field) {
                field = value
                invalidate()
            }
        }

    private var dirtyClipData = false

    private val clipEnabled
@@ -1192,8 +1201,14 @@ private class FrameLayoutTouchPassthrough(
            canvas.clipOutPath(currentClippingPath)
            canvas.translate(0f, translationY)
        }
        if (qsVisible) {
            // If QS should not be visible, there's no need to draw this tree at all. We do this
            // in the view (instead of in compose) so it's completely synchronized with the clip.
            // As this FrameLayout doesn't have any content, and the ComposeView is the only child,
            // this is equivalent to blocking the draw in `drawChild`.
            super.dispatchDraw(canvas)
        }
    }

    override fun isTransformedTouchPointInView(
        x: Float,