Prepare ui-graphics/ui-text for future upstreaming: extract skiko implementation into separate module#3126
Open
Ivan Matkov (MatkovIvan) wants to merge 7 commits into
Open
Prepare ui-graphics/ui-text for future upstreaming: extract skiko implementation into separate module#3126Ivan Matkov (MatkovIvan) wants to merge 7 commits into
Ivan Matkov (MatkovIvan) wants to merge 7 commits into
Conversation
1a3662d to
2181d8d
Compare
ApoloApps
reviewed
Jun 17, 2026
ApoloApps
reviewed
Jun 17, 2026
ApoloApps
reviewed
Jun 17, 2026
2c65a47 to
8a2981a
Compare
| @@ -222,6 +223,7 @@ androidXMultiplatform { | |||
| // TODO: Move to commonTest? | |||
| implementation(project(":compose:material:material")) | |||
| implementation(project(":compose:foundation:foundation")) | |||
| implementation(project(":compose:ui:ui-skiko")) | |||
Collaborator
There was a problem hiding this comment.
Suggested change
| implementation(project(":compose:ui:ui-skiko")) |
skikoMain already contains it.
Collaborator
Author
There was a problem hiding this comment.
Removed
| @@ -1,88 +0,0 @@ | |||
| /* | |||
Collaborator
There was a problem hiding this comment.
Could you please separate moving files and changing them into separate commits? Without doing so, it is difficult to review.
Collaborator
Author
There was a problem hiding this comment.
Not sure I understand the specific shape you are requesting here.
This PR is not just about renaming but about extracting the logic into a new module and converting previous classes/functions to wrappers.
What moving do you mean? And despite of the answer - do you really want to have a separate commit with inconsistent/not-compilable state?
Collaborator
Author
There was a problem hiding this comment.
Done
8a2981a to
56cdec3
Compare
Add the empty :compose:ui:ui-skiko Gradle module (settings include and build script) that the following commits populate with the relocated Skiko graphics and text backends. No source code yet.
319ca27 to
5ca6bb6
Compare
Pure relocation: every change is a rename of byte-identical content from ui-graphics into the new ui-skiko module. No build-script or logic changes here, so the follow-up commit's diff shows only the new bindings and delegation rather than the ~3k-line relocation. Relocated as-is: Canvas/Paint/Path/PathEffect/PathMeasure/PathIterator/ ImageBitmap/GraphicsLayer/Blur/Rects impls, the matrix helpers, the Skia-interop Desktop*/Native*/Actuals sources, and the Skiko graphics tests. Does not build on its own; completed by the next commit.
Make ui-graphics' nonAndroidMain Skia-free by resolving Skia through runtime-registered @InternalComposeUiApi Platform* bindings, completing the relocation from the previous commit. Also reconfigures ui-graphics/build.gradle for the Skia-free source-set topology. - ui-graphics keeps thin expect/actual delegators that resolve a registered PlatformGraphics implementation at runtime. - The Skia-holding expect-class actuals (Shader, ColorFilter, BlurEffect/OffsetEffect/RenderEffect) become Skiko-free via the PlatformBindings pattern: an opaque Platform* binding in ui-graphics, implemented in ui-skiko. - Public Skia-interop extensions (skiaPaint, skiaImageFilter, asComposePath, ...) are published from ui-skiko keeping their original package and @file:JvmName facade anchors, preserving desktop binary compatibility. Deprecated Skia-returning members that cannot be extensions delegate through a temporary SkikoGraphicsCompat registry. - BlendMode/SkiaVertexMode conversion helpers are gathered into the new SkiaConversions.nonAndroid.kt. API baselines are regenerated in a later commit.
Pure relocation: every change is a rename of byte-identical content from ui-text into ui-skiko, mirroring the graphics move. No build-script or logic changes here. Relocated as-is: paragraph building/intrinsics/layout, char helpers, the font subsystem (FontFamilyResolver, font loading, PlatformFont), locale and text-paint impls, and the Skiko text tests. Does not build on its own; completed by the next commit.
Make ui-text's nonAndroidMain Skia-free by resolving Skia through a runtime-registered text implementation, completing the relocation from the previous commit. Also extends ui-skiko/build.gradle with the text source sets and reconfigures ui-text/build.gradle. - ui-text keeps expect/actual delegators; the org.jetbrains.skia paragraph, font and text-paint code lives in ui-skiko. - The font subsystem is ui-text's own public API with per-platform loadTypeface actuals, so the unavoidable public Skia-typed surface stays in ui-text's skikoMain compat layer (Skia-free nonAndroidMain -> Skia skikoMain -> platform leaves); only the implementation moves. - ComposeUiSkikoRuntime.registerSkikoComposeImplementation() now wires both the graphics and text implementations (plus the temporary SkikoGraphicsCompat bridge). API baselines are regenerated in a later commit.
Wire registerSkikoComposeImplementation() into the Skiko-backed Compose entry points so the ui-graphics/ui-text registries are populated before any scene is created: desktop ComposePanel/ComposeWindowPanel, macOS ComposeWindow, iOS ComposeContainer, web ComposeWindowInternal, ImageComposeScene, and the ui-test rules. Adds the :compose:ui:ui-skiko dependency to the modules that rely on the Skiko backend transitively (ui, ui-test, ui-test-junit4, foundation). Tests reach the backend through a SkikoComposeTestBase per affected test source set, which registers the implementation in its init block so that it is available to subclass field initializers. The base class is duplicated per module because those test source sets share no test-scoped module: ui-text and ui-skiko tests cannot depend on ui-test without a dependency cycle, and a single shared class in a main source set would ship test support code in a production artifact.
Record the post-extraction public API. ui-graphics/ui-text baselines shrink by the relocation-only removals (the Skia-interop extensions and helpers now published from ui-skiko under identical package + facade names); no other public declarations change. Desktop binary compatibility is preserved through the @file:JvmName facade anchors and the HIDDEN split-facade shims in ui-skiko.
5ca6bb6 to
d2be866
Compare
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.
CMP-9813 Extract
ui-graphics/ui-textskiko implementation intoui-skikomoduleCMP-9814 Runtime registration of
ui-skikoRelease Notes
N/A