Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evan Edmond
fslpy
Commits
2795af8c
Commit
2795af8c
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Fixed overlay flickering issue on movie mode (and on any other image
texture changes).
parent
aeeaac98
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/fsleyes/gl/lightboxcanvas.py
+11
-2
11 additions, 2 deletions
fsl/fsleyes/gl/lightboxcanvas.py
fsl/fsleyes/gl/slicecanvas.py
+20
-13
20 additions, 13 deletions
fsl/fsleyes/gl/slicecanvas.py
with
31 additions
and
15 deletions
fsl/fsleyes/gl/lightboxcanvas.py
+
11
−
2
View file @
2795af8c
...
...
@@ -741,6 +741,15 @@ class LightBoxCanvas(slicecanvas.SliceCanvas):
if
not
self
.
_setGLContext
():
return
overlays
=
self
.
displayCtx
.
getOrderedOverlays
()
globjs
=
[
self
.
_glObjects
.
get
(
o
,
None
)
for
o
in
overlays
]
globjs
=
[
g
for
g
in
globjs
if
g
is
not
None
]
# Skip the render if any GLObjects are not
# ready - see comments in SliceCanvas._draw.
if
any
([
not
g
.
ready
()
for
g
in
globjs
]):
return
if
self
.
renderMode
==
'
offscreen
'
:
log
.
debug
(
'
Rendering to off-screen texture
'
)
...
...
@@ -770,12 +779,12 @@ class LightBoxCanvas(slicecanvas.SliceCanvas):
endSlice
=
self
.
_nslices
# Draw all the slices for all the overlays.
for
overlay
in
self
.
displayCtx
.
getOrderedOverlays
(
):
for
overlay
,
globj
in
zip
(
overlays
,
globjs
):
display
=
self
.
displayCtx
.
getDisplay
(
overlay
)
globj
=
self
.
_glObjects
.
get
(
overlay
,
None
)
if
(
globj
is
None
)
or
(
not
globj
.
ready
())
or
(
not
display
.
enabled
)
:
if
not
display
.
enabled
:
continue
log
.
debug
(
'
Drawing {} slices ({} - {}) for
'
...
...
This diff is collapsed.
Click to expand it.
fsl/fsleyes/gl/slicecanvas.py
+
20
−
13
View file @
2795af8c
...
...
@@ -1202,31 +1202,38 @@ class SliceCanvas(props.HasProperties):
if
not
self
.
_setGLContext
():
return
overlays
=
self
.
displayCtx
.
getOrderedOverlays
()
globjs
=
[
self
.
_glObjects
.
get
(
o
,
None
)
for
o
in
overlays
]
# If an overlay does not yet have a corresponding
# GLObject, we presume that it hasn't been created
# yet (and that the __genGLObject method is on the
# case).
globjs
=
[
g
for
g
in
globjs
if
g
is
not
None
]
# Do not draw anything if some globjects
# are not ready. This is because, if a
# GLObject was drawn, but is now temporarily
# not ready (e.g. it has an image texture
# that is being asynchronously refreshed),
# drawing the scene now would cause
# flickering of that GLObject.
if
any
([
not
g
.
ready
()
for
g
in
globjs
]):
return
# Set the viewport to match the current
# display bounds and canvas size
if
self
.
renderMode
is
not
'
offscreen
'
:
self
.
_setViewport
()
glroutines
.
clear
(
self
.
bgColour
)
for
overlay
in
self
.
displayCtx
.
getOrderedOverlays
(
):
for
overlay
,
globj
in
zip
(
overlays
,
globjs
):
display
=
self
.
displayCtx
.
getDisplay
(
overlay
)
opts
=
display
.
getDisplayOpts
()
globj
=
self
.
_glObjects
.
get
(
overlay
,
None
)
if
not
display
.
enabled
:
continue
if
globj
is
None
:
# The GLObject has not been created
# yet - we assume here that the
# __genGLObject method is on the case
continue
# The GLObject is not ready
# to be drawn yet.
if
not
globj
.
ready
():
continue
# On-screen rendering - the globject is
# rendered directly to the screen canvas
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment