1. 18 Apr, 2024 1 commit
  2. 17 Apr, 2024 1 commit
  3. 16 Apr, 2024 1 commit
    • Igor Demin's avatar
      Windows. Fix a crash on CI without `dcomp.dll` (#909) · 7a6f62bc
      Igor Demin authored
      ## Issues fixed
      
      Some CI don't have this library and when we run an application we have a
      crash:
      ```
      ...\skiko-windows-x64.dll: Can't find dependent libraries
      java.lang.UnsatisfiedLinkError: ...\skiko-windows-x64.dll: Can't find dependent libraries
      	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
      	at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
      	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
      	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
      	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2394)
      	at java.base/java.lang.Runtime.load0(Runtime.java:755)
      	at java.base/java.lang.System.load(System.java:1957)
      	at org.jetbrains.skiko.Library.loadLibraryOrCopy(Library.kt:17)
      	at org.jetbrains.skiko.Library.findAndLoad(Library.kt:111)
      	at org.jetbrains.skiko.Library.load(Library.kt:56)
      	at org.jetbrains.skia.impl.Library$Companion.staticLoad(Library.jvm.kt:12)
      	at org.jetbrains.skia.Surface.<clinit>(Surface.kt:539)
      	at androidx.compose.ui.test.SkikoComposeUiTest.<init>(ComposeUiTest.skikoMain.kt:172)
      	at androidx.compose.ui.test.SkikoComposeUiTest.<init>(ComposeUiTest.skikoMain.kt:118)
      	at androidx.compose.ui.test.SkikoComposeUiTest.<init>(ComposeUiTest.skikoMain.kt:139)
      	at androidx.compose.ui.test.SkikoComposeUiTest.<init>(ComposeUiTest.skikoMain.kt:134)
      	at androidx.compose.ui.test.junit4.DesktopComposeTestRule.<init>(DesktopComposeTestRule.desktop.kt:54)
      	at androidx.compose.ui.test.junit4.DesktopComposeTestRule_desktopKt.createComposeRule(DesktopComposeTestRule.desktop.kt:41)
      ```
      
      Reported in
      https://jetbrains.slack.com/archives/C5VQN94SH/p1712564847131459?thread_ts=1712091431.760099&cid=C5VQN94SH
      
      ## Proposed changes
      Load this library in runtime, and fallback to
      `CreateSwapChainForComposition`
      
      ## Testing
      1. Run Compose with transparent window:
      ```
      import androidx.compose.foundation.layout.fillMaxSize
      import androidx.compose.foundation.layout.padding
      import androidx.compose.foundation.shape.RoundedCornerShape
      import androidx.compose.material.Surface
      import androidx.compose.runtime.mutableStateOf
      import androidx.compose.runtime.remember
      import androidx.compose.ui.Modifier
      import androidx.compose.ui.draw.shadow
      import androidx.compose.ui.graphics.Color
      import androidx.compose.ui.unit.dp
      import androidx.compose.ui.window.Window
      import androidx.compose.ui.window.application
      import androidx.compose.material.Text
      import androidx.compose.runtime.*
      
      fun main() = application {
          var isOpen by remember { mutableStateOf(true) }
          if (isOpen) {
              Window(
                  onCloseRequest = { isOpen = false },
                  title = "Transparent Window Example",
                  transparent = true,
                  undecorated = true, //transparent window must be undecorated
              ) {
                  Surface(
                      modifier = Modifier.fillMaxSize().padding(5.dp).shadow(3.dp, RoundedCornerShape(20.dp)),
                      color = Color(55, 55, 55),
                      shape = RoundedCornerShape(20.dp) //window has round corners now
                  ) {
                      Text("Hello World!", color = Color.White)
                  }
              }
          }
      }
      ```
      Transparency should work, there shouldn't be errors in the log.
      
      2. change `transparent = false`
      
      Transparency shouldn't work, there shouldn't be errors in the log.
      
      This should be tested by QA.
      
      ---------
      Co-authored-by: 's avatarIvan Matkov <ivan.matkov@jetbrains.com>
      7a6f62bc
  4. 04 Apr, 2024 1 commit
    • Ivan Matkov's avatar
      Remove input handling (#893) · 16473284
      Ivan Matkov authored
      skiko is supposed to be a wrapper around skia, however it has unrelated
      features like input. This PR removes it from this library - it's
      supposed to be handled externally.
      
      - Removed `SkikoInput`, `SkikoKey`, `SkikoPlatform*Event`
      - Replaced `SkikoView` to `SkikoRenderDelegate` and related field in
      `SkiaLayer`
      - `SkiaLayer` on macOS native now receives `NSView` instead of creating
      it internally and attaching it to the `NSWindow`. In theory, it allows
      initializing non-full-window skia view there (not tested)
      - Updated samples and readme
      16473284
  5. 21 Mar, 2024 1 commit
  6. 15 Mar, 2024 1 commit
    • Igor Demin's avatar
      System property to extract binaries to a different folder (#891) · a7763616
      Igor Demin authored
      Skiko extracts binaries to `~/.skiko` by default, but it is not always
      possible. This PR adds a way to override the folder where to extract
      binaries:
      ```
      System.setProperty("skiko.data.path", File(System.getProperty("java.io.tmpdir")).resolve(".skiko").toString())
      ```
      
      Fixes https://github.com/JetBrains/skiko/issues/885
      
      The case seems rare - we only have a crash in tests reported. If we have
      reports from real users, we have to change the default `~/.skiko` to
      something else.
      
      ## Testing 1 (manual)
      1. Run
      ```
      import org.jetbrains.skia.Bitmap
      import java.io.File
      
      fun main() {
          val path = File(System.getProperty("java.io.tmpdir")).resolve(".skiko").toString()
          println(path)
          System.setProperty("skiko.data.path", path)
          Bitmap() // loads the library
      }
      ```
      2. See that `path` is created
      ## Testing 2 (manual)
      The default way works:
      ```
      import org.jetbrains.skia.Bitmap
      
      fun main() {
          Bitmap() // loads the library
      }
      ```
      a7763616
  7. 13 Mar, 2024 1 commit
  8. 11 Mar, 2024 2 commits
  9. 06 Mar, 2024 1 commit
  10. 04 Mar, 2024 1 commit
  11. 01 Mar, 2024 2 commits
  12. 26 Feb, 2024 2 commits
  13. 24 Feb, 2024 1 commit
  14. 22 Feb, 2024 1 commit
  15. 15 Feb, 2024 1 commit
    • Pavel's avatar
      Nan vals in textstyle (#870) · a82cbd79
      Pavel authored
      * Include <cstdint> is required because of uintptr_t
      
      * move `generateVersion` to common code
      
      * on Linux with Chinese language chosen in interface this test fails
      
      * this combination leads to NaN values when height is overridden
      
      * test that empty font still have a meaningful metrics, because FontStyle may rely on it
      
      * simplify test
      
      * check that we don't put NaN in skia
      
      this value might be used as part of key in paragraph cache, which may lead to UB atm
      a82cbd79
  16. 14 Feb, 2024 1 commit
  17. 10 Feb, 2024 1 commit
  18. 09 Feb, 2024 1 commit
  19. 07 Feb, 2024 3 commits
  20. 06 Feb, 2024 2 commits
  21. 29 Jan, 2024 1 commit
  22. 26 Jan, 2024 1 commit
  23. 18 Jan, 2024 1 commit
  24. 08 Jan, 2024 1 commit
  25. 20 Dec, 2023 2 commits
  26. 18 Dec, 2023 1 commit
  27. 15 Dec, 2023 2 commits
  28. 14 Dec, 2023 1 commit
  29. 12 Dec, 2023 1 commit
  30. 11 Dec, 2023 3 commits