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

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

Issue 2859673004: Implement rational overflow clipping in SPv2 (Closed)
Patch Set: Created 3 years, 8 months 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/PropertyTreeManager.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
index ab4e692dba4db42f630a0660bfc8f025455fb260..4c84c96ecc5dae17915213405b215bdca7a848e4 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
@@ -383,6 +383,23 @@ int PropertyTreeManager::SwitchToEffectNode(
return GetCurrentCompositorEffectNodeIndex();
}
+void PropertyTreeManager::BuildRoundedClipEffectNodesBetween(
+ const ClipPaintPropertyNode* descendant_clip,
+ const ClipPaintPropertyNode* ancestor_clip) {
+ if (!descendant_clip || descendant_clip == ancestor_clip)
+ return;
+ BuildRoundedClipEffectNodesBetween(descendant_clip->Parent(), ancestor_clip);
+ if (!descendant_clip->ClipRect().IsRounded())
+ return;
+ BuildRoundedClipEffect(descendant_clip);
+}
+
+void PropertyTreeManager::BuildRoundedClipEffect(
+ const ClipPaintPropertyNode* clip) {
+ // todo.
+ // BuildEffectNode(...);
+}
+
void PropertyTreeManager::BuildEffectNodesRecursively(
const EffectPaintPropertyNode* next_effect) {
if (next_effect == CurrentEffectNode())
@@ -392,6 +409,9 @@ void PropertyTreeManager::BuildEffectNodesRecursively(
BuildEffectNodesRecursively(next_effect->Parent());
DCHECK_EQ(next_effect->Parent(), CurrentEffectNode());
+ BuildRoundedClipEffectNodesBetween(next_effect->OutputClip(),
+ next_effect->Parent()->OutputClip());
+
#if DCHECK_IS_ON()
DCHECK(!effect_nodes_converted_.Contains(next_effect))
<< "Malformed paint artifact. Paint chunks under the same effect should "
@@ -399,6 +419,11 @@ void PropertyTreeManager::BuildEffectNodesRecursively(
effect_nodes_converted_.insert(next_effect);
#endif
+ BuildEffectNode(next_effect);
+}
+
+void PropertyTreeManager::BuildEffectNode(
+ const EffectPaintPropertyNode* next_effect) {
// An effect node can't omit render surface if it has child with exotic
// blending mode. See comments below for more detail.
// TODO(crbug.com/504464): Remove premature optimization here.

Powered by Google App Engine
This is Rietveld 408576698