1. 12 Jun, 2025 2 commits
  2. 06 Jun, 2025 2 commits
  3. 28 May, 2025 1 commit
    • Thomas Vos's avatar
      Update linux-amd64 Dockerfile to Ubuntu 20.04 (#1062) · b4f463b9
      Thomas Vos authored
      Needed to add `ARG DEBIAN_FRONTEND=noninteractive` so installation does
      not get stuck, copied this from another Dockerfile.
      Also `binutils-2.26` was missing so replaced it with `binutils`, this is
      in line with the other docker files, but I am unsure if this could break
      anything.
      
      On my PC the image build is successful (using `build.sh` script). The
      `run.sh` script is also successful after adapting its paths to my local
      setup. Unsure about publishing.
      b4f463b9
  4. 27 May, 2025 1 commit
  5. 23 May, 2025 1 commit
  6. 09 May, 2025 1 commit
  7. 30 Apr, 2025 3 commits
    • Igor Demin's avatar
      Update runners to ubuntu-22.04 (docs.yml) (#1056) · 30df516c
      Igor Demin authored
      Continuation of https://github.com/JetBrains/skiko/pull/1055
      
      This runs only in master
      30df516c
    • Vladimir Kharitonov's avatar
      metal: accelerate swing rendering (#1031) · 1b7f65b7
      Vladimir Kharitonov authored
      This PR contain:
      1. Using shared metal textures with this JBR API -
      [SharedTextures](https://github.com/JetBrains/JetBrainsRuntimeApi/blob/main/src/com/jetbrains/SharedTextures.java).
      See `AcceleratedSwingPainter`.
      
      2. Not ultimate, but visible improvement of the not accelerated painting
      for Windows(~%25), and MacOS(~20%). Unfortunately, didn't manage to see
      a positive change on Linux with XRender pipeline(about the same,
      probably few percents down). With opengl pipeline it also got ~20%
      faster. But currently our pipeline on linux is XRender
      I got rid of make one extra copy of the raster image. See
      `SoftwareSwingPainter`
      
      `com.jetbrains:jbr-api` size is about 44kb
      
      Benchmarks:
      `Redraw` - time to prepare the offscreen image including sync, but not
      including fetching texture to the CPU RAM
      `Paint` - time to get the image from GPU(if needed) and draw onto
      `Graphics2D`
      `Total` - total time to deliver the frame
      
      ```
      MetalSwingRedrawer:
      Image size: 3200x2344
      Test: ClocksAwt
      MacBook Pro M1 Max
      java2d pipeline = Metal
                     Current   SoftwareSwingPainter   AcceleratedSwingPainter
      FPS              66             80                      141
      Redraw(ms)      7.13           7.13                     6.92
      Paint(ms)       7.65           6.07                     0.006
      Total(ms)      14.78          12.16                     6.92
      
      
      Direct3DSwingRedrawer
      Image size: 3176x2284
      Dell Prescision 5570, i9-12900H + GPU Nvidia
      Test: ClocksAwt
      java2d pipeline = GDI
                     Current   SoftwareSwingPainter
      FPS              32             41
      Redraw(ms)     12.58          11.57
      Paint(ms)      17.43          11.54
      Total(ms)      29.93          23.11
      
      
      LinuxOpenGLSwingRedrawer
      Image size: 3192x2230
      Dell Prescision 5570, i9-12900H + GPU Nvidia
      Test: ClocksAwt
      java2d pipeline = XRender
                     Current   SoftwareSwingPainter
      FPS              24             23
      Redraw(ms)     20.07          19.64
      Paint(ms)      19.69          22.73
      Total(ms)      39.77          42.39
      ```
      
      ---------
      Co-authored-by: 's avatarIgor Demin <igordmn@users.noreply.github.com>
      1b7f65b7
    • Igor Demin's avatar
      Update runners to ubuntu-22.04 (#1055) · e88dd9c3
      Igor Demin authored
      The current runners fail with:
      
      This is a scheduled Ubuntu 20.04 retirement. Ubuntu 20.04 LTS runner
      will be removed on 2025-04-15. For more details,
      see https://github.com/actions/runner-images/issues/11101
      
      GitHub Actions has encountered an internal error when running your job.
      e88dd9c3
  8. 22 Apr, 2025 1 commit
  9. 15 Apr, 2025 1 commit
    • Clément de La Bourdonnaye's avatar
      Make configureSignAndPublishDependencies use proper android task names (#1053) · 6955c19e
      Clément de La Bourdonnaye authored
      "AndroidRelease" should be used instead of "Android" since using the
      android plugin introduces release/debug variants.
      
      Note: `./gradlew publish -Pskiko.android.enabled=true` would still fail
      with the following, but this task is as I understand not used on CI and
      "build repo" seem to be a local thing.
      ```
      > Task :publishAndroidReleasePublicationToBuildRepoRepository FAILED
      
      FAILURE: Build failed with an exception.
      
      * What went wrong:
      A problem was found with the configuration of task ':publishAndroidReleasePublicationToBuildRepoRepository' (type 'PublishToMavenRepository').
        - Gradle detected a problem with the following location: '/Users/cdelabou/workspace/misc/skiko/skiko/build/libs/skiko-0.0.0-SNAPSHOT-javadoc.jar.asc'.
          
          Reason: Task ':publishAndroidReleasePublicationToBuildRepoRepository' uses this output of task ':signKotlinMultiplatformPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
      ```
      6955c19e
  10. 14 Apr, 2025 1 commit
    • Denis Bazhenov's avatar
      Using glFlush() instead of glFinish() (#1037) · c72df6cf
      Denis Bazhenov authored
      We have a situation on a Linux where a significant portion of time spent
      in EDT is spent inside a `glFinish()` call.
      
      OS: Linux bazhenov 6.11.0-19-generic #19~24.04.1-Ubuntu SMP
      PREEMPT_DYNAMIC Mon Feb 17 11:51:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
      Distribution: Ubuntu 24.04
      GPU: Intel Corporation AlderLake-S GT1 [8086:4680] (rev 0c) (Intel UHD
      Graphics 770)
      Driver: i915
      
      
      ![screenshot_from_2025-03-24_14-04-41](https://github.com/user-attachments/assets/a4ed84e1-d299-418e-912c-3f32b15bfaaa)
      
      According to the
      [documentation](https://registry.khronos.org/OpenGL-Refpages/gl4/html/glFinish.xhtml):
      
      > glFinish does not return until the effects of all previously called GL
      commands are complete. Such effects include all changes to GL state, all
      changes to connection state, and all changes to the frame buffer
      contents.
      
      It effectively means that there is no overlap in work being done on the
      CPU and GPU; we only start to prepare a new frame when we finish
      rendering the previous one. It makes sense in the context of direct
      draw, but AFAIK, Skiko has a swap chain of frame buffers (I assume 2?),
      so `glFlush()` should be enough. Probably, we can get away without
      `glFinish()`/`glFlush()` at all, because `glSwapBuffers()`, according to
      the documentation, is doing `glFlush()`, but I'm not an expert.
      
      Using `SkiaAwtSample`, I can confirm that performance is improved
      significantly (in both cases first 3 FPS samples are skipped).
      
      Before change
      
      ```
      [1039125906] FPS 36 (29-63)
      [1039127906] FPS 46 (29-62)
      [1039129906] FPS 43 (29-64)
      [1039131922] FPS 39 (29-64)
      [1039133923] FPS 42 (29-65)
      [1039135940] FPS 52 (29-63)
      [1039137957] FPS 36 (29-62)
      [1039139974] FPS 53 (29-66)
      [1039142008] FPS 34 (29-63)
      [1039144024] FPS 47 (30-66)
      ```
      
      After change
      
      ```
      [1038654097] FPS 60 (46-67)
      [1038656097] FPS 60 (57-65)
      [1038658114] FPS 60 (47-68)
      [1038660114] FPS 60 (41-67)
      [1038662114] FPS 60 (51-67)
      [1038664115] FPS 60 (47-67)
      [1038666115] FPS 60 (51-67)
      [1038668115] FPS 60 (51-67)
      [1038670127] FPS 60 (42-67)
      [1038672132] FPS 60 (48-67)
      ```
      c72df6cf
  11. 10 Apr, 2025 1 commit
  12. 09 Apr, 2025 1 commit
  13. 08 Apr, 2025 2 commits
    • Igor Demin's avatar
      Revert "SKIKO-1013: Migrate skiko android target to proper androidTarget using AGP" (#1044) · c1f28386
      Igor Demin authored
      Reverts JetBrains/skiko#1043
      
      ```
      ./gradlew publishKotlinMultiplatformPublicationToComposeRepoRepository
      ```
      Fails on CI
      c1f28386
    • Clément de La Bourdonnaye's avatar
      SKIKO-1013: Migrate skiko android target to proper androidTarget using AGP (#1043) · c4e8d4dc
      Clément de La Bourdonnaye authored
      This also fixes SKIKO-934 by making the dependency between
      `merge*JniLibFolders` and `unzip*` tasks explicit (the patch actually
      adds too much dependencies but this should be limited to android tasks).
      After this patch the android sample works from my configuration (might
      be worth checking if other issues are still relevant?).
      
      Few things to consider for review:
      - I've changed versions of Gradle / AGP / Kotlin until I got something
      working on both samples and library side.
      - If `ANDROID_SDK_ROOT` environment variable was specified on a CI
      before, it should now be `ANDROID_HOME` to work with android gradle
      plugin (internal utilities will work with both).
      - I've introduce some lazyness in configurations (`matching { ... }`),
      as android plugin and previous code would race (android seems to declare
      it's configurations quite late). If there's a better way to express it,
      please let me know!
      c4e8d4dc
  14. 31 Mar, 2025 1 commit
  15. 28 Mar, 2025 1 commit
  16. 27 Mar, 2025 1 commit
  17. 26 Mar, 2025 1 commit
  18. 19 Mar, 2025 2 commits
  19. 11 Mar, 2025 1 commit
  20. 10 Mar, 2025 1 commit
  21. 04 Mar, 2025 1 commit
  22. 28 Feb, 2025 1 commit
    • Alexander Maryanovsky's avatar
      Expose ICUs u_hasBinaryProperty (#1029) · 8620e193
      Alexander Maryanovsky authored
      This is needed to detect emojis in Compose Multiplatform.
      
      Also, it looks like the native implementations of
      `String.intCodePoints()` were broken. I fixed them by copying the
      relevant code from Compose.
      8620e193
  23. 24 Feb, 2025 1 commit
  24. 19 Feb, 2025 1 commit
  25. 14 Feb, 2025 1 commit
  26. 12 Feb, 2025 2 commits
  27. 11 Feb, 2025 1 commit
    • Alovchin91's avatar
      Remove BreakIterator.clone() method (#1024) · 3f95f4e7
      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.
      3f95f4e7
  28. 05 Feb, 2025 1 commit
  29. 31 Jan, 2025 1 commit
  30. 30 Jan, 2025 1 commit
    • Ivan Matkov's avatar
      Adoption of `RenderNode` approach (#1014) · 09dae793
      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
      09dae793
  31. 27 Jan, 2025 1 commit
    • Igor Demin's avatar
      DirectXOffscreenContext to allow drawing into offscreen texture (#1016) · 1af72c1c
      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
      1af72c1c
  32. 24 Jan, 2025 1 commit
  33. 20 Jan, 2025 1 commit