summaryrefslogtreecommitdiffstats
path: root/src/core/delegated_frame_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/delegated_frame_node.cpp')
-rw-r--r--src/core/delegated_frame_node.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index 73e0420af..7547e24f7 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -957,8 +957,10 @@ void DelegatedFrameNode::commit(ChromiumCompositorData *chromiumCompositorData,
scissorRect += rootRenderPass->output_rect.OffsetFromOrigin();
}
- if (scissorRect.IsEmpty())
+ if (scissorRect.IsEmpty()) {
+ holdResources(pass, resourceCandidates);
continue;
+ }
QSGNode *renderPassChain = nullptr;
if (buildNewTree)
@@ -981,8 +983,10 @@ void DelegatedFrameNode::commit(ChromiumCompositorData *chromiumCompositorData,
if (quadState->is_clipped)
targetRect.Intersect(quadState->clip_rect);
targetRect.Intersect(scissorRect);
- if (targetRect.IsEmpty())
+ if (targetRect.IsEmpty()) {
+ holdResources(quad, resourceCandidates);
continue;
+ }
if (quadState->sorting_context_id != currentSortingContextId) {
flushPolygons(&polygonQueue, renderPassChain,
@@ -1240,6 +1244,20 @@ ResourceHolder *DelegatedFrameNode::findAndHoldResource(unsigned resourceId, QHa
return resource.data();
}
+void DelegatedFrameNode::holdResources(const cc::DrawQuad *quad, QHash<unsigned, QSharedPointer<ResourceHolder> > &candidates)
+{
+ auto first = quad->resources.const_begin();
+ auto last = quad->resources.const_end();
+ for (auto it = first; it != last; ++it)
+ findAndHoldResource(*it, candidates);
+}
+
+void DelegatedFrameNode::holdResources(const cc::RenderPass *pass, QHash<unsigned, QSharedPointer<ResourceHolder> > &candidates)
+{
+ for (const auto &quad : pass->quad_list)
+ holdResources(quad, candidates);
+}
+
QSGTexture *DelegatedFrameNode::initAndHoldTexture(ResourceHolder *resource, bool quadIsAllOpaque, RenderWidgetHostViewQtDelegate *apiDelegate)
{
// QSGTextures must be destroyed in the scene graph thread as part of the QSGNode tree,