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

Commit d15025f0 authored by Massimo Carli's avatar Massimo Carli Committed by Android (Google) Code Review
Browse files

Merge "[80/n] Use single surface as default strategy" into main

parents 9d832146 a254dd28
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -44,15 +44,14 @@ class LetterboxControllerStrategy @Inject constructor(
        // Decides whether to use a single surface or multiple surfaces for the letterbox.
        // The primary trade-off is memory usage versus rendering performance.
        //
        // A single surface is used for letterboxes with rounded corners on opaque activities
        // and always for Bubble. In all other cases, such as for letterboxes with straight corners
        // or for those with rounded corners on a translucent activity, we use multiple surfaces to
        // ensure better performance.
        // The multi surfaces approach is only used when the activity is transparent. The single
        // surface approach is the default one because it is easier and less expensive to handle.
        // TODO(b/377875146): Improve heuristic for single/multiple surfaces
        currentMode = when {
            event.isBubble -> SINGLE_SURFACE
            event.isTranslucent -> MULTIPLE_SURFACES
            letterboxConfiguration.isLetterboxActivityCornersRounded() -> SINGLE_SURFACE
            else -> MULTIPLE_SURFACES
            else -> SINGLE_SURFACE
        }
        supportsInputSurface = event.supportsInput
    }
+2 −2
Original line number Diff line number Diff line
@@ -98,11 +98,11 @@ class LetterboxControllerStrategyTest : ShellTestCase() {
    }

    @Test
    fun `LetterboxMode is MULTIPLE_SURFACES with no rounded corners`() {
    fun `LetterboxMode is SINGLE_SURFACE with no rounded corners`() {
        runTestScenario { r ->
            r.configureRoundedCornerRadius(false)
            r.configureLetterboxMode()
            r.checkLetterboxModeIsMultiple()
            r.checkLetterboxModeIsSingle()
        }
    }