- 14 Feb, 2025 1 commit
-
-
Thomas Vos authored
My app is used a lot in the background, and I noticed high CPU usage in the native macOS version. With this PR, CPU usage is reduced when window is invisible by disabling drawing. This was already implemented for the JVM, and that behaviour is now copied to native macOS. So the code is similar to JVM parts in: - https://github.com/JetBrains/skiko/blob/master/skiko/src/awtMain/kotlin/org/jetbrains/skiko/redrawer/MetalRedrawer.kt - https://github.com/JetBrains/skiko/blob/master/skiko/src/awtMain/objectiveC/macos/MetalRedrawer.mm The draw function is now suspend, which required moving some other functions around. I tried to keep the implementation similar to the JVM version. # Testing Tested using `./gradlew runNative` in `samples/SkiaMultiplatformSample`. Now the CPU usage is reduced a lot when moving another (non transparent) app over the window. # Old behaviour https://github.com/user-attachments/assets/60ad3398-3f44-4e2f-aca7-44a4607d0840 # New behaviour with 300ms timeout See reduction in CPU usage when window is invisible https://github.com/user-attachments/assets/106efdeb-0044-4411-9b26-5a6b8886ff04 # New behaviour without 300ms timeout https://github.com/user-attachments/assets/b986548b-d7ab-497b-9ddb-5b46ca016f83
-
- 12 Feb, 2025 2 commits
-
-
Igor Demin authored
Fixes https://youtrack.jetbrains.com/issue/CMP-7603/Fix-Maven-Central-publication for Skiko Just a quick fix that adds an updated library. For a proper fix I created an issue https://youtrack.jetbrains.com/issue/SKIKO-1003/Unify-Maven-publication-of-Skiko-with-Compose
-
Alovchin91 authored
Official Skia documentation suggests that it's [_highly recommended_](https://skia.org/docs/user/build/#highly-recommended-build-with-clang-cl) to build Skia with Clang-CL on Windows, and that this dramatically improves Skia performance with Software rendering and in other areas. This corresponds with my experience, so here it is. Related Skia-pack PR: https://github.com/JetBrains/skia-pack/pull/64 Prerequisite: #1024
-
- 11 Feb, 2025 1 commit
-
-
Alovchin91 authored
This PR is split-off from and is a prerequisite of Clang-cl PR: #1020 BreakIterator.clone() is broken on JVM and seemingly leads to a use-after-free behaviour. Clang-cl makes this issue more visible, likely due to address sanitisation. Explanation why it is deleted in an internal channel: https://jetbrains.slack.com/archives/C02DDNREC77/p1738678000232729 * `breakIteratorCloneTest` is failing with an access violation in Debug mode with additional checks, so using it wasn't safe * it is not used anywhere This is a breaking change and will require bumping Skiko version to 0.9.0.
-
- 05 Feb, 2025 1 commit
-
-
Shagen Ogandzhanian authored
-
- 31 Jan, 2025 1 commit
-
-
Ivan Matkov authored
Required to fix https://youtrack.jetbrains.com/issue/CMP-7508 Test: covered by existing tests
-
- 30 Jan, 2025 1 commit
-
-
Ivan Matkov authored
It is a simplified adoption of Android's `RenderNode`. ```kt /** * <p>RenderNode is used to build hardware accelerated rendering hierarchies. Each RenderNode * contains both a display list as well as a set of properties that affect the rendering of the * display list. RenderNodes are used internally for all Views by default and are not typically * used directly.</p> * * <p>RenderNodes are used to divide up the rendering content of a complex scene into smaller * pieces that can then be updated individually more cheaply. Updating part of the scene only needs * to update the display list or properties of a small number of RenderNode instead of redrawing * everything from scratch. A RenderNode only needs its display list re-recorded when its content * alone should be changed. RenderNodes can also be transformed without re-recording the display * list through the transform properties.</p> ``` This is a more correct approach to make `GraphicsLayer` in Compose invalidation independently. - Moved drawing callback to C++ side to avoid extra interop costs - Switched from `SkPicture` placeholder to custom `SkDrawable` implementation
-
- 27 Jan, 2025 1 commit
-
-
Igor Demin authored
Needed to run benchmarks without vsync interference. The code extracted from Direct3DSwingRedrawer with minimal changes. - implementation for other API will be added when it is needed (Metal is considered later) - there are no plans to make commonMain abstraction in `skiko` as it is not needed at the moment ## Testing - manually in benchmarks with this code: ``` @OptIn(ExperimentalSkikoApi::class) class DirectXGraphicsContext() : DesktopGraphicsContext { private val context = DirectXOffscreenContext() private var texture: DirectXOffscreenContext.Texture? = null override fun surface(width: Int, height: Int): Surface { texture?.close() texture = context.Texture(width, height) return Surface.makeFromBackendRenderTarget( context.directContext, texture!!.backendRenderTarget, SurfaceOrigin.TOP_LEFT, SurfaceColorFormat.BGRA_8888, ColorSpace.sRGB, SurfaceProps(pixelGeometry = PixelGeometry.UNKNOWN) ) ?: throw IllegalStateException("Can't create Surface") } override suspend fun awaitGPUCompletion() { texture?.waitForCompletion() } override fun close() { texture?.close() context.close() } } interface DesktopGraphicsContext : GraphicsContext, AutoCloseable ``` - new test for SkiaSwingLayer - new test for DirectXOffscreenContext
-
- 24 Jan, 2025 1 commit
-
-
Ivan Matkov authored
Currently fails with ``` Error: This request has been automatically failed because it uses a deprecated version of `actions/upload-artifact: v3`. Learn more: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/ ```
-
- 20 Jan, 2025 2 commits
-
-
-
Ivan Matkov authored
That approach worked but had performance issues. Also, `SkPicture` is immutable by design, so we shouldn't try to change that. #1014 is a more correct and efficient way to implement it
-
- 15 Jan, 2025 1 commit
-
-
Alexander Maryanovsky authored
-
- 14 Jan, 2025 2 commits
-
-
Ivan Matkov authored
-
Ivan Matkov authored
New `PictureFilterCanvas` class that allows override picture rendering during drawing Required for https://github.com/JetBrains/compose-multiplatform-core/pull/1766
-
- 13 Jan, 2025 1 commit
- 07 Jan, 2025 1 commit
-
-
Oleksandr Karpovich authored
This is an alternative (better) fix for https://youtrack.jetbrains.com/issue/CMP-6721 Similar change is skia is required too: https://github.com/JetBrains/skia-pack/pull/60
-
- 12 Dec, 2024 2 commits
-
-
Oleksandr Karpovich authored
-
Oleksandr Karpovich authored
Reason: macos-12 is deprecated and not available anymore https://github.com/actions/runner-images/issues/10721 (Several previous CI runs were incomplete bacause of this: https://github.com/JetBrains/skiko/actions, including a commit merged to master - https://github.com/JetBrains/skiko/commit/bccb17a47610b17ee5e297d3665b4fc0625da9e1)
-
- 09 Dec, 2024 1 commit
-
-
jakub-senohrabek-jb authored
In order to use two different versions of skiko in one app (using multiple classloaders), it is required to use the unpacking strategy, as the skiko.library.path is a system property, which is same for all classloaders. This change will allow to use presigned natives shipped together with the app, while still being able to use multiple versions as the property skiko.library.path will be loaded from current classloader resources, with fallback to system property. Co-authored-by:Jakub Senohrabek <jakub@senohrabek.net>
-
- 03 Dec, 2024 1 commit
-
-
Oleksandr Karpovich authored
-
- 01 Nov, 2024 1 commit
-
-
Pavel authored
-
- 31 Oct, 2024 1 commit
-
-
Pavel authored
Co-authored-by:Oleksandr Karpovich <a.n.karpovich@gmail.com>
-
- 29 Oct, 2024 1 commit
-
-
Oleksandr Karpovich authored
-
- 22 Oct, 2024 1 commit
-
-
Sam Wang authored
Fix for https://youtrack.jetbrains.com/issue/CMP-6722/Excessive-garbage-generation-from-redrawing Previously, the `draw` method would allocate a `BufferedImage` on every redraw, which is wasteful. This fix changed `SwingOffscreenRenderer` to reuse the same instance of `BufferedImage` and only clear it on redraws. Only changing the draw size would allocate a new `BufferedImage`.
-
- 18 Oct, 2024 1 commit
-
-
Artem Bobrov authored
Co-authored-by:Artem Bobrov <artem.bobrov@jetbrains.com>
-
- 25 Sep, 2024 2 commits
-
-
Oleksandr Karpovich authored
-
Victor Kropp authored
-
- 18 Sep, 2024 2 commits
-
-
Andrei Salavei authored
Fixes the following error when calling `URIHandler_openUri` on iOS 18: ``` The caller of UIApplication.openURL(_:) needs to migrate to the non-deprecated UIApplication.open(_:options:completionHandler:). Force returning false (NO). ``` Fixes: https://youtrack.jetbrains.com/issue/CMP-6699
-
Ivan Matkov authored
Support configurable vertical centering for implementing Compose's `LineHeightStyle.Alignment`. https://youtrack.jetbrains.com/issue/CMP-2602 See also: - https://github.com/JetBrains/skia/pull/5 - https://github.com/JetBrains/compose-multiplatform-core/pull/1569
-
- 17 Sep, 2024 1 commit
-
-
Igor Demin authored
Fixes https://youtrack.jetbrains.com/issue/CMP-5856/Desktop-ComposePanel-size-breaks-with-.fillMax-modifiers#focus=Comments-27-10632441.0-0 Fixes https://youtrack.jetbrains.com/issue/CMP-5968/Compose-content-is-rendered-in-the-wrong-place-in-IJ-when-using-AWT-compositing Regression after https://github.com/JetBrains/skiko/pull/661/files#diff-910a6e28fda20a00bc98c6a8a04f74ab701d79e841b9baddf146b810e610572fR363 (`setBounds` is called more often, but not enough as `ancestorMoved`) When a panel changes its position without changing its size, `doLayout` isn't called because the content itself wasn't changed. But we still need to update the bounds of the underlying layer. ## Testing - https://youtrack.jetbrains.com/issue/CMP-5856/Desktop-ComposePanel-size-breaks-with-.fillMax-modifiers#focus=Comments-27-10632441.0-0 isn't reproducible after the fix - there are no resize glitches ## Release Notes ### Fixes - Fix bounds of ComposePanel in IntelliJ on macOs
-
- 09 Sep, 2024 1 commit
-
-
Oleksandr Karpovich authored
Adding a new flag `-Pskiko.wasm.withProfiling=true` which adds `--profiling` flag to emcc, so it preserves the function names - makes it easier to use the browser profiler. By default, it's disabled.
-
- 16 Aug, 2024 1 commit
-
-
Shagen Ogandzhanian authored
-
- 14 Aug, 2024 1 commit
-
-
Niclas authored
-
- 12 Aug, 2024 2 commits
-
-
Niclas authored
See https://github.com/JetBrains/skiko/issues/973
-
Oleksandr Karpovich authored
Skia-pack used in this skiko: https://github.com/JetBrains/skia-pack/releases/tag/m126-1d69d9b-2
-
- 07 Aug, 2024 1 commit
-
-
Shagen Ogandzhanian authored
This is supposed to be fix for https://github.com/JetBrains/skiko/issues/967 The idea is pass strings as (utf8) byte arrays directly through the border just like we do it on native
-
- 05 Aug, 2024 1 commit
-
-
Oleksandr Karpovich authored
The download directory path now depends on the buildType: Debug and Release ___ It affected our buildServer CI pipeline where it builds Release first and then Debug. And downloadTask was considered UP-TO-DATE when Debug build was attempted. Therefore the build used "Release" version of skia instead of "Debug. " Added a Debug build to the githiub workflow too.
-
- 02 Aug, 2024 1 commit
-
-
Pavel authored
Add a flag to control number of buffers used by Metal. Add a flag to control Vsync on window resize (#968) #### Number of buffers MacOS [doc](https://developer.apple.com/documentation/quartzcore/cametallayer/2938720-maximumdrawablecount?language=objc). As far as I know AWT uses double buffering by default. So we would like to experiment with this setting in Fleet. Also I expect that double buffering should reduce user interaction latency. #### Control VSync on window resize I've noticed that on Linux and Windows we don't wait for VSync when repainting synchronously, but only on macOS we do. I suspect that locking EDT when we are waiting for VSync might lead to problems with app responsivenes. So it would be nice to experiment with this setting.
-
- 30 Jul, 2024 1 commit
-
-
Elijah Semyonov authored
Usage of main-thread AppKit APIs in other thread is assumed to lead to the crash. Second attempt for https://github.com/JetBrains/skiko/pull/958. Structure display link control reactively around Wake/Sleep and Screen change notifications. --------- Co-authored-by:
Igor Demin <igordmn@users.noreply.github.com>
-
- 23 Jul, 2024 1 commit
-
-
Shagen Ogandzhanian authored
One still can use optional platfrom-specific skia dependencies using exactly the property which was used before, however, by default all build targets are using the same version of skia prebuilt artefacts.
-