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

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

Issue 2604163003: Implement PaintArtifactCompositor::mightOverlap. (Closed)
Patch Set: none Created 4 years 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 00b42f49923192a032fd0eac271336db5f9aa865..0ed85739180563bfd65c28b2008e2d726ca40336 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -1041,8 +1041,25 @@ bool PaintArtifactCompositor::mightOverlap(
const PaintChunk& paintChunk,
const PendingLayer& candidatePendingLayer,
GeometryMapper& geometryMapper) {
- // TODO(chrishtr): implement
- return true;
+ PropertyTreeState rootPropertyTreeState(
wkorman 2016/12/29 19:49:40 nit: could be worth adding a static instance for t
chrishtr 2016/12/29 19:52:29 Good idea. I have a cleanup CL for PaintArtifactCo
+ TransformPaintPropertyNode::root(), ClipPaintPropertyNode::root(),
+ EffectPaintPropertyNode::root(), ScrollPaintPropertyNode::root());
+
+ bool success = false;
+ FloatRect paintChunkScreenVisualRect =
+ geometryMapper.localToVisualRectInAncestorSpace(
+ paintChunk.bounds, paintChunk.properties.propertyTreeState,
+ rootPropertyTreeState, success);
+ DCHECK(success);
+
+ success = false;
+ FloatRect pendingLayerScreenVisualRect =
+ geometryMapper.localToVisualRectInAncestorSpace(
+ candidatePendingLayer.bounds, candidatePendingLayer.propertyTreeState,
+ rootPropertyTreeState, success);
+ DCHECK(success);
+
+ return paintChunkScreenVisualRect.intersects(pendingLayerScreenVisualRect);
}
PaintArtifactCompositor::PendingLayer::PendingLayer(

Powered by Google App Engine
This is Rietveld 408576698