Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
848a57cd
Unverified
Commit
848a57cd
authored
Oct 14, 2021
by
Roman Sedaikin
Committed by
GitHub
Oct 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for swing interop on macos. (#269)
parent
42076471
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
App.kt
samples/SkiaJvmSample/src/main/kotlin/SkiaJvmSample/App.kt
+2
-0
ContextHandler.kt
...Main/kotlin/org/jetbrains/skiko/context/ContextHandler.kt
+3
-2
No files found.
samples/SkiaJvmSample/src/main/kotlin/SkiaJvmSample/App.kt
View file @
848a57cd
...
...
@@ -118,6 +118,8 @@ fun createWindow(title: String, exitOnClose: Boolean) = SwingUtilities.invokeLat
window
.
background
=
java
.
awt
.
Color
(
0
,
0
,
0
,
0
)
}
window
.
layer
.
transparency
=
true
}
else
{
window
.
layer
.
background
=
java
.
awt
.
Color
.
WHITE
}
// MANDATORY: set window preferred size before calling pack()
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skiko/context/ContextHandler.kt
View file @
848a57cd
...
...
@@ -9,9 +9,10 @@ import org.jetbrains.skiko.GraphicsApi
import
org.jetbrains.skiko.SkiaLayer
import
org.jetbrains.skiko.hostArch
import
org.jetbrains.skiko.hostOs
import
org.jetbrains.skiko.OS
internal
abstract
class
ContextHandler
(
val
layer
:
SkiaLayer
)
{
open
val
clearColor
=
if
(
layer
.
transparency
)
0
else
-
1
open
val
clearColor
=
if
(
layer
.
transparency
||
hostOs
==
OS
.
MacOS
)
0
else
-
1
var
context
:
DirectContext
?
=
null
var
renderTarget
:
BackendRenderTarget
?
=
null
var
surface
:
Surface
?
=
null
...
...
@@ -21,7 +22,7 @@ internal abstract class ContextHandler(val layer: SkiaLayer) {
abstract
fun
initCanvas
()
fun
clearCanvas
()
{
val
color
=
if
(
layer
.
fullscreen
)
-
1
else
clearColor
val
color
=
if
(
layer
.
fullscreen
&&
hostOs
!=
OS
.
MacOS
)
-
1
else
clearColor
canvas
?.
clear
(
color
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment