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
2faf120c
Commit
2faf120c
authored
Sep 29, 2020
by
Roman Sedaikin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed flickering on Mac OS when using Canvas.saveLayer().
parent
0cf199f8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
App.kt
...kijaInjectSample/src/main/kotlin/SkijaInjectSample/App.kt
+8
-6
SkiaWindow.kt
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/SkiaWindow.kt
+1
-2
No files found.
samples/SkijaInjectSample/src/main/kotlin/SkijaInjectSample/App.kt
View file @
2faf120c
...
...
@@ -39,10 +39,16 @@ fun createWindow(title: String) {
// Create menu.
val
menuBar
=
JMenuBar
()
try
{
System
.
setProperty
(
"apple.laf.useScreenMenuBar"
,
"true"
)
java
.
awt
.
Desktop
.
getDesktop
().
setDefaultMenuBar
(
menuBar
)
}
catch
(
e
:
UnsupportedOperationException
)
{
// Not all platforms allow this.
}
val
menu
=
JMenu
(
"File"
)
menuBar
.
add
(
menu
)
val
menuItem
=
JMenuItem
(
"Say Hello"
)
val
ctrlJ
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_J
,
Toolkit
.
getDefaultToolkit
().
getMenuShortcutKeyMask
())
val
ctrlJ
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_J
,
Toolkit
.
getDefaultToolkit
().
getMenuShortcutKeyMask
Ex
())
menuItem
.
setAccelerator
(
ctrlJ
)
menuItem
.
addActionListener
(
object
:
ActionListener
{
override
fun
actionPerformed
(
actionEvent
:
ActionEvent
?)
{
...
...
@@ -52,11 +58,7 @@ fun createWindow(title: String) {
menu
.
add
(
menuItem
)
window
.
setJMenuBar
(
menuBar
)
try
{
java
.
awt
.
Desktop
.
getDesktop
().
setDefaultMenuBar
(
menuBar
)
}
catch
(
e
:
UnsupportedOperationException
)
{
// Not all platforms allow this.
}
val
state
=
State
()
state
.
text
=
title
...
...
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/SkiaWindow.kt
View file @
2faf120c
...
...
@@ -51,12 +51,11 @@ open class SkiaLayer : HardwareLayer() {
if
(
skijaState
.
context
==
null
)
{
skijaState
.
context
=
Context
.
makeGL
()
}
initSkija
()
renderer
?.
onInit
()
inited
=
true
renderer
?.
onReshape
(
width
,
height
)
}
initSkija
()
skijaState
.
apply
{
canvas
!!
.
clear
(-
1
)
renderer
?.
onRender
(
canvas
!!
,
width
,
height
)
...
...
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