Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
440
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
34ef225b
Commit
34ef225b
authored
2 years ago
by
Prince Gupta
Committed by
Rémi Denis-Courmont
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
qt: reset old contents while loading new in roundimage
fixes
#26990
parent
a11e147d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1953
qt: reset old contents while loading new in roundimage
Pipeline
#225523
passed with stage
Stage:
in 14 minutes and 43 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gui/qt/widgets/native/roundimage.cpp
+29
-19
29 additions, 19 deletions
modules/gui/qt/widgets/native/roundimage.cpp
with
29 additions
and
19 deletions
modules/gui/qt/widgets/native/roundimage.cpp
+
29
−
19
View file @
34ef225b
...
...
@@ -131,6 +131,13 @@ QSGNode *RoundImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
{
auto
node
=
static_cast
<
QSGImageNode
*>
(
oldNode
);
if
(
m_roundImage
.
isNull
())
{
delete
oldNode
;
m_dirty
=
false
;
return
nullptr
;
}
if
(
!
node
)
{
assert
(
window
());
...
...
@@ -141,28 +148,25 @@ QSGNode *RoundImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
if
(
m_dirty
)
{
if
(
!
m_roundImage
.
isNull
())
{
assert
(
window
());
m_dirty
=
false
;
assert
(
window
());
QSGTexture
*
texture
=
window
()
->
createTextureFromImage
(
m_roundImage
,
static_cast
<
QQuickWindow
::
CreateTextureOptions
>
((
Q_LIKELY
(
m_roundImage
.
hasAlphaChannel
())
?
QQuickWindow
::
TextureHasAlphaChannel
:
0
)
|
QQuickWindow
::
TextureCanUseAtlas
));
QQuickWindow
::
CreateTextureOptions
flags
=
QQuickWindow
::
TextureCanUseAtlas
;
if
(
Q_LIKELY
(
m_roundImage
.
hasAlphaChannel
()))
flags
|=
QQuickWindow
::
TextureHasAlphaChannel
;
if
(
texture
)
{
// No need to delete the old texture manually as it is owned by the node.
node
->
setTexture
(
texture
);
node
->
markDirty
(
QSGNode
::
DirtyMaterial
);
}
else
{
qmlWarning
(
this
)
<<
"Could not generate texture from "
<<
m_roundImage
;
}
}
QSGTexture
*
texture
=
window
()
->
createTextureFromImage
(
m_roundImage
,
flags
);
m_dirty
=
false
;
if
(
texture
)
{
// No need to delete the old texture manually as it is owned by the node.
node
->
setTexture
(
texture
);
node
->
markDirty
(
QSGNode
::
DirtyMaterial
);
}
else
{
qmlWarning
(
this
)
<<
"Could not generate texture from "
<<
m_roundImage
;
}
}
node
->
setRect
(
boundingRect
());
...
...
@@ -230,6 +234,12 @@ void RoundImage::regenerateRoundImage()
if
(
!
isComponentComplete
()
||
m_enqueuedGeneration
)
return
;
// remove old contents
m_dirty
=
true
;
m_roundImage
=
{};
update
();
setFlag
(
ItemHasContents
,
false
);
// update() is still required
m_roundImageGenerator
.
reset
();
// use Qt::QueuedConnection to delay generation, so that dependent properties
...
...
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