Skip to content

[DO NOT MERGE]: Introduce Graphite Native Metal#1184

Draft
hub-bla wants to merge 12 commits intoJetBrains:masterfrom
hub-bla:graphite_native_metal
Draft

[DO NOT MERGE]: Introduce Graphite Native Metal#1184
hub-bla wants to merge 12 commits intoJetBrains:masterfrom
hub-bla:graphite_native_metal

Conversation

@hub-bla
Copy link
Copy Markdown

@hub-bla hub-bla commented Mar 24, 2026

SKIKO-1128

This PR introduces the initial version of the Graphite API in Skiko using native Metal.
Please note that a separate PR for Graphite packaging must be merged before this one can be finalized

@hub-bla hub-bla marked this pull request as draft March 24, 2026 10:00
}

@ExperimentalSkikoApi
fun makeFromBackendTexture(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An option to avoid using graphite package here - make it an extension function inside graphite package

fun Surface.Companion.makeFromBackendTexture(...)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I'll move it

}
}

internal abstract class GraphiteContextHandler(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move it into graphite package?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can but ContextHandler can't be sealed then. If thats fine then sure


import org.jetbrains.skia.gpu.SkiaGpuBackend

object SkikoFlags {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently flags are platform-dependent (built-in properties on Desktop).

I see it's used only in MacOsMetalRedrawer, so maybe it might be regular argument there

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's currently used only in MacOsMetalRedrawer because I only made the Graphite-based context handler for native macOS for now. In general I think that flag (or flags) related to GPU backend should be available to all platforms so we know at runtime which backend is available

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