Skip to content

[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
masterfrom
pjBooms/fix-benchmarks-compilation
Open

[benchmarks] CMP-10298: Extract Compose scene API into versioned modules for cross-version compatibility#5629
Nikita Lipsky (pjBooms) wants to merge 1 commit into
masterfrom
pjBooms/fix-benchmarks-compilation

Conversation

@pjBooms

Copy link
Copy Markdown
Contributor

Benchmarks used internal Compose UI API (CanvasLayersComposeScene,
ComposeScene.render) directly in MeasureComposable.kt, which broke
when 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 before
    PR compose-multiplatform-core#3012 (≤1.11.x, 1.12.0-alpha01, alpha02 dev builds <4221),
    using ComposeScene.render(canvas, nanoTime).
  • :compose-scene-impl-2 — implementation for Compose versions after
    PR compose-multiplatform-core#3012 (1.12.0-alpha02+dev4221+), using FrameRecomposer with
    performFrame(), measureAndLayout(), and draw().

The correct impl module is auto-selected in settings.gradle.kts
based on the Compose version (from libs.versions.toml or
-Pcompose.version), and mapped as :compose-scene-impl so
MeasureComposable.kt uses only the stable BenchmarkComposeScene
interface without any @InternalComposeUiApi usage.

Fixes CMP-10298

Testing

Tested manually.

Release Notes

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant