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
025b1093
Unverified
Commit
025b1093
authored
Sep 12, 2025
by
Alexander Maryanovsky
Committed by
GitHub
Sep 12, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix possibly calling DeviceAnalytis.(before/after)FirstFrameRender more than once (#1101)
parent
ab846bc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
AWTRedrawer.kt
...wtMain/kotlin/org/jetbrains/skiko/redrawer/AWTRedrawer.kt
+4
-3
SwingRedrawerBase.kt
...ain/kotlin/org/jetbrains/skiko/swing/SwingRedrawerBase.kt
+5
-6
No files found.
skiko/src/awtMain/kotlin/org/jetbrains/skiko/redrawer/AWTRedrawer.kt
View file @
025b1093
...
...
@@ -57,16 +57,17 @@ internal abstract class AWTRedrawer(
protected
inline
fun
inDrawScope
(
body
:
()
->
Unit
)
{
requireNotNull
(
deviceAnalytics
)
{
"deviceAnalytics is not null. Call onDeviceChosen after choosing the drawing device"
}
if
(!
isDisposed
)
{
if
(!
isFirstFrameRendered
)
{
val
isFirstFrame
=
!
isFirstFrameRendered
isFirstFrameRendered
=
true
if
(
isFirstFrame
)
{
deviceAnalytics
?.
beforeFirstFrameRender
()
}
deviceAnalytics
?.
beforeFrameRender
()
layer
.
inDrawScope
(
body
)
if
(
!
isFirstFrameRendered
&&
!
isDisposed
)
{
if
(
isFirstFrame
&&
!
isDisposed
)
{
deviceAnalytics
?.
afterFirstFrameRender
()
}
deviceAnalytics
?.
afterFrameRender
()
isFirstFrameRendered
=
true
}
}
...
...
skiko/src/awtMain/kotlin/org/jetbrains/skiko/swing/SwingRedrawerBase.kt
View file @
025b1093
...
...
@@ -81,18 +81,17 @@ internal abstract class SwingRedrawerBase(
check
(
SwingUtilities
.
isEventDispatchThread
())
{
"Method should be called from AWT event dispatch thread"
}
requireNotNull
(
deviceAnalytics
)
{
"deviceAnalytics is not null. Call onDeviceChosen after choosing the drawing device"
}
if
(!
isDisposed
)
{
if
(!
isFirstFrameRendered
)
{
val
isFirstFrame
=
!
isFirstFrameRendered
isFirstFrameRendered
=
true
if
(
isFirstFrame
)
{
deviceAnalytics
?.
beforeFirstFrameRender
()
}
try
{
body
()
}
catch
(
e
:
CancellationException
)
{
// ignore
}
if
(!
isFirstFrameRendered
&&
!
isDisposed
)
{
}
catch
(
_
:
CancellationException
)
{
}
if
(
isFirstFrame
&&
!
isDisposed
)
{
deviceAnalytics
?.
afterFirstFrameRender
()
}
isFirstFrameRendered
=
true
}
}
}
\ No newline at end of file
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