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

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 264183002: RAL: Eliminate n^2 walk to find repaint containers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: One more simple rebaseline... Created 6 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 | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index b1c53809393cecb69b6f49c9c4515e7e8851e008..2e451c543c83df43738c0207d08f829fe8f6b6ec 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -1546,7 +1546,7 @@ bool RenderBox::repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer
return false;
}
-void RenderBox::repaintTreeAfterLayout()
+void RenderBox::repaintTreeAfterLayout(const RenderLayerModelObject& repaintContainer)
{
// FIXME: Currently only using this logic for RenderBox and its ilk. Ideally, RenderBlockFlows with
// inline children should track a dirty rect in local coordinates for dirty lines instead of repainting
@@ -1561,18 +1561,22 @@ void RenderBox::repaintTreeAfterLayout()
if (!shouldCheckForInvalidationAfterLayout())
return;
+ bool establishesNewRepaintContainer = isRepaintContainer();
+ const RenderLayerModelObject& newRepaintContainer = *adjustCompositedContainerForSpecialAncestors(establishesNewRepaintContainer ? this : &repaintContainer);
+ // FIXME: This assert should be re-enabled when we move repaint to after compositing update. crbug.com/360286
+ // ASSERT(&newRepaintContainer == containerForRepaint());
+
const LayoutRect oldRepaintRect = previousRepaintRect();
const LayoutPoint oldPositionFromRepaintContainer = previousPositionFromRepaintContainer();
- const RenderLayerModelObject* repaintContainer = containerForRepaint();
- setPreviousRepaintRect(clippedOverflowRectForRepaint(repaintContainer));
- setPreviousPositionFromRepaintContainer(positionFromRepaintContainer(repaintContainer));
+ setPreviousRepaintRect(clippedOverflowRectForRepaint(&newRepaintContainer));
+ setPreviousPositionFromRepaintContainer(positionFromRepaintContainer(&newRepaintContainer));
// If we are set to do a full repaint that means the RenderView will be
// invalidated. We can then skip issuing of invalidations for the child
// renderers as they'll be covered by the RenderView.
if (view()->doingFullRepaint() && this != view()) {
LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : locationOffset());
- RenderObject::repaintTreeAfterLayout();
+ RenderObject::repaintTreeAfterLayout(newRepaintContainer);
return;
}
@@ -1585,7 +1589,7 @@ void RenderBox::repaintTreeAfterLayout()
const LayoutRect& newRepaintRect = previousRepaintRect();
const LayoutPoint& newPositionFromRepaintContainer = previousPositionFromRepaintContainer();
- bool didFullRepaint = repaintAfterLayoutIfNeeded(containerForRepaint(),
+ bool didFullRepaint = repaintAfterLayoutIfNeeded(&newRepaintContainer,
shouldDoFullRepaintAfterLayout(), oldRepaintRect, oldPositionFromRepaintContainer, &newRepaintRect, &newPositionFromRepaintContainer);
if (!didFullRepaint)
@@ -1602,11 +1606,17 @@ void RenderBox::repaintTreeAfterLayout()
}
}
- // FIXME: This concept of a tree walking state for fast lookups should be generalized away from
- // just layout.
- // FIXME: Table rows shouldn't be special-cased.
- LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : locationOffset());
- RenderObject::repaintTreeAfterLayout();
+ // FIXME: LayoutState should be enabled for other repaint containers than the RenderView. crbug.com/363834
+ if (establishesNewRepaintContainer) {
+ LayoutStateDisabler disabler(*this);
+ RenderObject::repaintTreeAfterLayout(newRepaintContainer);
+ } else {
+ // FIXME: This concept of a tree walking state for fast lookups should be generalized away from
+ // just layout.
+ // FIXME: Table rows shouldn't be special-cased.
+ LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : locationOffset());
+ RenderObject::repaintTreeAfterLayout(newRepaintContainer);
+ }
}
bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumulatedOffset, ContentsClipBehavior contentsClipBehavior)
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698