Skip to content

Prepare ui-graphics/ui-text for future upstreaming: extract skiko implementation into separate module#3126

Draft
Ivan Matkov (MatkovIvan) wants to merge 4 commits into
jb-mainfrom
ivan.matkov/ui-skiko
Draft

Prepare ui-graphics/ui-text for future upstreaming: extract skiko implementation into separate module#3126
Ivan Matkov (MatkovIvan) wants to merge 4 commits into
jb-mainfrom
ivan.matkov/ui-skiko

Conversation

@MatkovIvan

@MatkovIvan Ivan Matkov (MatkovIvan) commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

CMP-9813 Extract ui-graphics/ui-text skiko implementation into ui-skiko module
CMP-9814 Runtime registration of ui-skiko

Release Notes

N/A

Move the Skia-backed implementation of ui-graphics into a new
:compose:ui:ui-skiko module, leaving ui-graphics' nonAndroidMain
Skia-free. The common code keeps thin expect/actual delegators that
resolve a registered ComposeUiGraphicsImplementation at runtime; the
real org.jetbrains.skia code lives in ui-skiko's Skiko*Support classes.

Source-set topology: commonMain -> nonAndroidMain (Skia-free) ->
skikoMain (Skia compat) -> desktop/native/web leaves.

- Canvas/Paint/Path/PathEffect/PathMeasure/PathIterator/ImageBitmap/
  Matrices/GraphicsLayer/Blur/Rects relocate to ui-skiko as registry-
  backed delegators.
- The Skia-holding expect-class actuals (Shader, ColorFilter,
  BlurEffect/OffsetEffect/RenderEffect) become Skiko-free via the
  PlatformBindings pattern: an opaque @InternalComposeUiApi Platform*
  binding in ui-graphics, implemented in ui-skiko.
- Public Skia-interop extensions (skiaPaint, skiaImageFilter,
  asComposePath, ...) move to 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.

API baselines are regenerated in a later commit.
Move the Skia-backed implementation of ui-text into ui-skiko, leaving
ui-text's nonAndroidMain Skia-free, mirroring the graphics extraction.
ui-text keeps expect/actual delegators resolving a registered
ComposeUiTextImplementation; the org.jetbrains.skia paragraph, font and
text-paint code lives in ui-skiko.

- Paragraph building, intrinsics, char helpers and the font subsystem
  (FontFamilyResolver, font loading, PlatformFont) relocate to 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 ComposeUIViewController, 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) and registers in the affected
test harnesses.
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.
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.

2 participants