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
fd05df7c
Unverified
Commit
fd05df7c
authored
Sep 12, 2025
by
Alexander Maryanovsky
Committed by
GitHub
Sep 12, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert attempt to draw the first frame before the skia layer is visible, from reshape (#1100)
parent
025b1093
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
SkiaLayer.awt.kt
...o/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt
+20
-16
No files found.
skiko/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt
View file @
fd05df7c
...
@@ -103,6 +103,19 @@ actual open class SkiaLayer internal constructor(
...
@@ -103,6 +103,19 @@ actual open class SkiaLayer internal constructor(
isOpaque
=
false
isOpaque
=
false
layout
=
null
layout
=
null
backedLayer
=
object
:
HardwareLayer
(
externalAccessibleFactory
)
{
backedLayer
=
object
:
HardwareLayer
(
externalAccessibleFactory
)
{
override
fun
paint
(
g
:
Graphics
)
{
Logger
.
debug
{
"Paint called on HardwareLayer $this"
}
checkContentScale
()
// 1. JPanel.paint is not always called (in rare cases).
// For example if we call 'jframe.isResizable = false` on Ubuntu
//
// 2. HardwareLayer.paint is also not always called.
// For example, on macOs when we resize window or change DPI
//
// 3. to avoid double paint in one single frame, use needRedraw instead of redrawImmediately
redrawer
?.
needRedraw
(
throttledToVsync
=
false
)
}
@Suppress
(
"OVERRIDE_DEPRECATION"
)
@Suppress
(
"OVERRIDE_DEPRECATION"
)
override
fun
reshape
(
x
:
Int
,
y
:
Int
,
width
:
Int
,
height
:
Int
)
{
override
fun
reshape
(
x
:
Int
,
y
:
Int
,
width
:
Int
,
height
:
Int
)
{
...
@@ -111,22 +124,7 @@ actual open class SkiaLayer internal constructor(
...
@@ -111,22 +124,7 @@ actual open class SkiaLayer internal constructor(
super
.
reshape
(
x
,
y
,
width
,
height
)
super
.
reshape
(
x
,
y
,
width
,
height
)
redrawer
?.
syncBounds
()
redrawer
?.
syncBounds
()
// There's no reason for the render delegate to directly cause resizing SkiaLayer, but protect
redrawer
?.
needRedraw
(
throttledToVsync
=
false
)
// against it anyway.
if
(!
isRendering
)
{
// When the layer isn't yet showing, paint will not be called,
// but in order to avoid the background flashing when the layer
// does show, we already draw to the native surface.
redrawer
?.
redrawImmediately
(
updateNeeded
=
true
)
}
else
{
redrawer
?.
needRedraw
(
throttledToVsync
=
false
)
}
}
override
fun
paint
(
g
:
Graphics
)
{
Logger
.
debug
{
"paint called on $this"
}
val
updateNeeded
=
checkContentScale
()
redrawer
?.
redrawImmediately
(
updateNeeded
=
updateNeeded
)
}
}
override
fun
getInputMethodRequests
():
InputMethodRequests
?
{
override
fun
getInputMethodRequests
():
InputMethodRequests
?
{
...
@@ -416,6 +414,12 @@ actual open class SkiaLayer internal constructor(
...
@@ -416,6 +414,12 @@ actual open class SkiaLayer internal constructor(
backedLayer
.
validate
()
backedLayer
.
validate
()
}
}
override
fun
paint
(
g
:
Graphics
)
{
Logger
.
debug
{
"paint called on SkiaLayer $this"
}
val
updateNeeded
=
checkContentScale
()
redrawer
?.
redrawImmediately
(
updateNeeded
=
updateNeeded
)
}
// Workaround for JBR-5274 and JBR-5305
// Workaround for JBR-5274 and JBR-5305
fun
checkContentScale
():
Boolean
{
fun
checkContentScale
():
Boolean
{
val
currentGraphicsContextScaleTransform
=
graphicsConfiguration
.
defaultTransform
val
currentGraphicsContextScaleTransform
=
graphicsConfiguration
.
defaultTransform
...
...
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