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

Unified Diff: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp

Issue 2883263003: Map visual rects of descendants under LayoutSVGHiddenContainer to the temporary root (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInvalidationTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
index f37495ddf1aeb21d40622aff79435c18e642f371..2df94aa5b7c92eb5b78e4bbebb9ee6dfac5b0fd7 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
@@ -92,12 +92,21 @@ LayoutRect PaintInvalidator::MapLocalRectToVisualRectInBacking(
return LayoutRect(EnclosingIntRect(rect));
}
+ // If kForcedSubtreeNoRasterInvalidation is set, we map the rect to the
+ // temporary root paint property state instead of the paint invalidation
+ // backing.
+ bool map_to_backing =
chrishtr 2017/05/17 00:42:41 Is this mapping necessary for testing, or for repa
Xianzhu 2017/05/17 00:49:45 It's for repaint-after-layout checks to invalidate
+ !(context.forced_subtree_invalidation_flags &
+ PaintInvalidatorContext::kForcedSubtreeNoRasterInvalidation);
+
LayoutRect result;
if (context.forced_subtree_invalidation_flags &
PaintInvalidatorContext::kForcedSubtreeSlowPathRect) {
+ DCHECK(map_to_backing);
result = SlowMapToVisualRectInAncestorSpace(
object, *context.paint_invalidation_container, rect);
} else if (object == context.paint_invalidation_container) {
+ DCHECK(map_to_backing);
result = LayoutRect(rect);
} else {
// For non-root SVG, the input rect is in local SVG coordinates in which
@@ -106,7 +115,9 @@ LayoutRect PaintInvalidator::MapLocalRectToVisualRectInBacking(
rect.MoveBy(Point(object.PaintOffset()));
auto container_contents_properties =
- context.paint_invalidation_container->ContentsProperties();
+ map_to_backing
+ ? context.paint_invalidation_container->ContentsProperties()
+ : PropertyTreeState::Root();
if (context.tree_builder_context_->current.transform ==
container_contents_properties.Transform() &&
context.tree_builder_context_->current.clip ==
@@ -133,10 +144,13 @@ LayoutRect PaintInvalidator::MapLocalRectToVisualRectInBacking(
}
// Convert the result to the container's contents space.
- result.MoveBy(-context.paint_invalidation_container->PaintOffset());
+ if (map_to_backing)
+ result.MoveBy(-context.paint_invalidation_container->PaintOffset());
}
object.AdjustVisualRectForRasterEffects(result);
+ if (!map_to_backing)
+ return result;
PaintLayer::MapRectInPaintInvalidationContainerToBacking(
*context.paint_invalidation_container, result);
@@ -341,8 +355,8 @@ void PaintInvalidator::UpdatePaintInvalidationContainer(
// descending into a different invalidation container. (For instance if
// our parents were moved, the entire container will just move.)
if (object != context.paint_invalidation_container_for_stacked_contents) {
- // However, we need to keep ForcedSubtreeVisualRectUpdate and
- // ForcedSubtreeFullInvalidationForStackedContents flags if the current
+ // However, we need to keep kForcedSubtreeVisualRectUpdate and
+ // kForcedSubtreeFullInvalidationForStackedContents flags if the current
// object isn't the paint invalidation container of stacked contents.
context.forced_subtree_invalidation_flags &=
(PaintInvalidatorContext::kForcedSubtreeVisualRectUpdate |
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInvalidationTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698