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
9c46d5cc
Unverified
Commit
9c46d5cc
authored
Oct 13, 2025
by
Alexander Maryanovsky
Committed by
GitHub
Oct 13, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `SkiaLayer.awt.updateAndDrawImmediately` to `renderImmediately` (#1116)
parent
afcd9e54
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
11 deletions
+31
-11
SkiaLayer.awt.kt
...o/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt
+11
-7
SkiaLayerTest.kt
...o/src/awtTest/kotlin/org/jetbrains/skiko/SkiaLayerTest.kt
+2
-2
SkiaLayer.kt
skiko/src/commonMain/kotlin/org/jetbrains/skiko/SkiaLayer.kt
+2
-2
SkiaLayer.linux.kt
...c/linuxMain/kotlin/org/jetbrains/skiko/SkiaLayer.linux.kt
+4
-0
SkiaLayer.macos.kt
...c/macosMain/kotlin/org/jetbrains/skiko/SkiaLayer.macos.kt
+4
-0
SkiaLayer.uikit.kt
...c/uikitMain/kotlin/org/jetbrains/skiko/SkiaLayer.uikit.kt
+4
-0
SkiaLayer.js.kt
skiko/src/webMain/kotlin/org/jetbrains/skiko/SkiaLayer.js.kt
+4
-0
No files found.
skiko/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt
View file @
9c46d5cc
...
...
@@ -432,13 +432,6 @@ actual open class SkiaLayer internal constructor(
}
}
/**
* Updates the layer and redraws synchronously.
*/
fun
updateAndDrawImmediately
()
{
redrawer
?.
renderImmediately
()
}
// We need to delegate all event listeners to the Canvas (so and focus/input)
// Canvas is heavyweight AWT component, JPanel is lightweight Swing component
// Event handling doesn't properly work when we mix heavyweight and lightweight components.
...
...
@@ -557,8 +550,19 @@ actual open class SkiaLayer internal constructor(
redrawer
?.
needRender
(
throttledToVsync
)
}
@Deprecated
(
message
=
"Use needRender() instead"
,
replaceWith
=
ReplaceWith
(
"needRender()"
)
)
actual
fun
needRedraw
()
=
needRender
()
/**
* Updates the layer and redraws synchronously.
*/
fun
renderImmediately
()
{
redrawer
?.
renderImmediately
()
}
internal
fun
update
(
nanoTime
:
Long
)
{
check
(
isEventDispatchThread
())
{
"Method should be called from AWT event dispatch thread"
}
check
(!
isDisposed
)
{
"SkiaLayer is disposed"
}
...
...
skiko/src/awtTest/kotlin/org/jetbrains/skiko/SkiaLayerTest.kt
View file @
9c46d5cc
...
...
@@ -1285,7 +1285,7 @@ class SkiaLayerTest {
}
@Test
fun
`
updateAndDraw
Immediately
updates
and
draws
synchronously
`
()
=
uiTest
{
fun
`
render
Immediately
updates
and
draws
synchronously
`
()
=
uiTest
{
// Check that calling both needRender(true) and needRender(false) causes only one render and one draw call
var
renderCalls
=
0
val
renderChannel
=
Channel
<
Unit
>(
Channel
.
CONFLATED
)
...
...
@@ -1322,7 +1322,7 @@ class SkiaLayerTest {
val
initRenderCalls
=
renderCalls
val
initDrawCalls
=
drawCalls
window
.
layer
.
updateAndDraw
Immediately
()
window
.
layer
.
render
Immediately
()
// Can't check renderCalls == initRenderCalls+1 because if drawing fails, render will be called again with
// the fallback renderer.
assertTrue
(
renderCalls
>
initRenderCalls
)
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skiko/SkiaLayer.kt
View file @
9c46d5cc
...
...
@@ -64,8 +64,8 @@ expect open class SkiaLayer {
fun
needRender
(
throttledToVsync
:
Boolean
=
true
)
@Deprecated
(
"Use needRender(throttledToVsync
) instead"
,
replaceWith
=
ReplaceWith
(
"needRender(
throttledToVsync
)"
)
message
=
"Use needRender(
) instead"
,
replaceWith
=
ReplaceWith
(
"needRender()"
)
)
fun
needRedraw
()
// TODO: Remove this sometime after 2026-07
...
...
skiko/src/linuxMain/kotlin/org/jetbrains/skiko/SkiaLayer.linux.kt
View file @
9c46d5cc
...
...
@@ -20,6 +20,10 @@ actual open class SkiaLayer {
actual
fun
needRender
(
throttledToVsync
:
Boolean
)
{
TODO
(
"unimplemented"
)
}
@Deprecated
(
message
=
"Use needRender() instead"
,
replaceWith
=
ReplaceWith
(
"needRender()"
)
)
actual
fun
needRedraw
()
=
needRender
()
actual
fun
attachTo
(
container
:
Any
)
{
TODO
(
"unimplemented"
)
...
...
skiko/src/macosMain/kotlin/org/jetbrains/skiko/SkiaLayer.macos.kt
View file @
9c46d5cc
...
...
@@ -144,6 +144,10 @@ actual open class SkiaLayer {
redrawer
?.
needRender
(
throttledToVsync
)
}
@Deprecated
(
message
=
"Use needRender() instead"
,
replaceWith
=
ReplaceWith
(
"needRender()"
)
)
actual
fun
needRedraw
()
=
needRender
()
/**
...
...
skiko/src/uikitMain/kotlin/org/jetbrains/skiko/SkiaLayer.uikit.kt
View file @
9c46d5cc
...
...
@@ -27,6 +27,10 @@ actual open class SkiaLayer {
needRedrawCallback
.
invoke
()
}
@Deprecated
(
message
=
"Use needRender() instead"
,
replaceWith
=
ReplaceWith
(
"needRender()"
)
)
actual
fun
needRedraw
()
=
needRender
()
actual
val
component
:
Any
?
...
...
skiko/src/webMain/kotlin/org/jetbrains/skiko/SkiaLayer.js.kt
View file @
9c46d5cc
...
...
@@ -52,6 +52,10 @@ actual open class SkiaLayer {
state
?.
needRedraw
()
}
@Deprecated
(
message
=
"Use needRender() instead"
,
replaceWith
=
ReplaceWith
(
"needRender()"
)
)
actual
fun
needRedraw
()
=
needRender
()
/**
...
...
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