Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp

Issue 2495973002: [SPv2] Add filter support in PaintArtifactCompositor (Closed)
Patch Set: rebase & add expectation & add comment Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
index 3661cdbab587baee013f0a6ca78b7cab5c659a02..c9cc02d0448ddd913938cf0b66ebc2392576d265 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -715,19 +715,12 @@ void PropertyTreeManager::buildEffectNodesRecursively(
scoped_refptr<cc::Layer> dummyLayer = nextEffect->ensureDummyLayer();
m_rootLayer->AddChild(dummyLayer);
- // Also cc assumes a clip node is always created by a layer that creates
- // render surface.
- cc::ClipNode& dummyClip =
- *clipTree().Node(clipTree().Insert(cc::ClipNode(), kSecondaryRootNodeId));
- dummyClip.owner_id = dummyLayer->id();
- dummyClip.transform_id = kRealRootNodeId;
- dummyClip.target_transform_id = kRealRootNodeId;
- dummyClip.target_effect_id = kSecondaryRootNodeId;
+ int outputClipId = compositorIdForClipNode(nextEffect->outputClip());
cc::EffectNode& effectNode = *effectTree().Node(effectTree().Insert(
cc::EffectNode(), compositorIdForCurrentEffectNode()));
effectNode.owner_id = dummyLayer->id();
- effectNode.clip_id = dummyClip.id;
+ effectNode.clip_id = outputClipId;
// Every effect is supposed to have render surface enabled for grouping,
// but we can get away without one if the effect is opacity-only and has only
// one compositing child. This is both for optimization and not introducing
@@ -737,12 +730,15 @@ void PropertyTreeManager::buildEffectNodesRecursively(
// TODO(crbug.com/504464): There is ongoing work in cc to delay render surface
// decision until later phase of the pipeline. Remove premature optimization
// here once the work is ready.
+ if (!nextEffect->filter().isEmpty())
+ effectNode.has_render_surface = true;
effectNode.opacity = nextEffect->opacity();
+ effectNode.filters = nextEffect->filter().asCcFilterOperations();
m_effectStack.append(BlinkEffectAndCcIdPair{nextEffect, effectNode.id});
dummyLayer->set_property_tree_sequence_number(kPropertyTreeSequenceNumber);
dummyLayer->SetTransformTreeIndex(kSecondaryRootNodeId);
- dummyLayer->SetClipTreeIndex(dummyClip.id);
+ dummyLayer->SetClipTreeIndex(outputClipId);
dummyLayer->SetEffectTreeIndex(effectNode.id);
dummyLayer->SetScrollTreeIndex(kRealRootNodeId);
}

Powered by Google App Engine
This is Rietveld 408576698