[benchmarks] CMP-10298: Extract Compose scene API into versioned modules for cross-version compatibility#5629
Open
Nikita Lipsky (pjBooms) wants to merge 1 commit into
Open
Conversation
…les for cross-version compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmarks used internal Compose UI API (
CanvasLayersComposeScene,ComposeScene.render) directly inMeasureComposable.kt, which brokewhen compose-multiplatform-core#3012 replaced the single
render()method with
FrameRecomposer+measureAndLayout()+draw()phases.Introduce a versioned abstraction layer:
:compose-scene-api— BenchmarkComposeScene interface (setContent,render,close) depending only on public Compose API.:compose-scene-impl-1— implementation for Compose versions beforePR compose-multiplatform-core#3012 (≤1.11.x,
1.12.0-alpha01,alpha02dev builds <4221),using ComposeScene.render(canvas, nanoTime).
:compose-scene-impl-2— implementation for Compose versions afterPR compose-multiplatform-core#3012 (
1.12.0-alpha02+dev4221+), usingFrameRecomposerwithperformFrame(),measureAndLayout(), anddraw().The correct impl module is auto-selected in
settings.gradle.ktsbased on the Compose version (from
libs.versions.tomlor-Pcompose.version), and mapped as:compose-scene-implsoMeasureComposable.ktuses only the stableBenchmarkComposeSceneinterface without any
@InternalComposeUiApiusage.Fixes CMP-10298
Testing
Tested manually.
Release Notes
N/A