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

Unified Diff: Source/core/rendering/RenderObject.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/RenderObject.h ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 5c5b178fc3fc813735e0bdd8586dd01e4a20f601..03babadc8f561601da4373b226042ac4646c4cb6 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1252,7 +1252,8 @@ void RenderObject::paintOutline(PaintInfo& paintInfo, const LayoutRect& paintRec
// FIXME: In repaint-after-layout, we should be able to change the logic to remove the need for this function. See crbug.com/368416.
LayoutPoint RenderObject::positionFromRepaintContainer(const RenderLayerModelObject* repaintContainer) const
{
- ASSERT(containerForRepaint() == repaintContainer);
+ // FIXME: This assert should be re-enabled when we move repaint to after compositing update. crbug.com/360286
+ // ASSERT(containerForRepaint() == repaintContainer);
LayoutPoint offset = isBox() ? toRenderBox(this)->location() : LayoutPoint();
if (repaintContainer == this)
@@ -1352,16 +1353,24 @@ const RenderLayerModelObject* RenderObject::containerForRepaint() const
if (!isRooted())
return 0;
- const RenderLayerModelObject* repaintContainer = 0;
+ return adjustCompositedContainerForSpecialAncestors(enclosingCompositedContainer());
+}
- RenderView* renderView = view();
- if (renderView->usesCompositing()) {
+const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const
+{
+ RenderLayerModelObject* container = 0;
+ if (view()->usesCompositing()) {
// FIXME: CompositingState is not necessarily up to date for many callers of this function.
DisableCompositingQueryAsserts disabler;
if (RenderLayer* compositingLayer = enclosingLayer()->enclosingCompositingLayerForRepaint())
- repaintContainer = compositingLayer->renderer();
+ container = compositingLayer->renderer();
}
+ return container;
+}
+
+const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialAncestors(const RenderLayerModelObject* repaintContainer) const
+{
if (document().view()->hasSoftwareFilters()) {
if (RenderLayer* enclosingFilterLayer = enclosingLayer()->enclosingFilterLayer())
@@ -1377,7 +1386,12 @@ const RenderLayerModelObject* RenderObject::containerForRepaint() const
if (!repaintContainer || repaintContainer->flowThreadContainingBlock() != parentRenderFlowThread)
repaintContainer = parentRenderFlowThread;
}
- return repaintContainer ? repaintContainer : renderView;
+ return repaintContainer ? repaintContainer : view();
+}
+
+bool RenderObject::isRepaintContainer() const
+{
+ return hasLayer() && toRenderLayerModelObject(this)->layer()->isRepaintContainer();
}
template<typename T> PassRefPtr<JSONValue> jsonObjectForRect(const T& rect)
@@ -1523,7 +1537,7 @@ const char* RenderObject::invalidationReasonToString(InvalidationReason reason)
return "";
}
-void RenderObject::repaintTreeAfterLayout()
+void RenderObject::repaintTreeAfterLayout(const RenderLayerModelObject& repaintContainer)
{
// If we didn't need invalidation then our children don't need as well.
// Skip walking down the tree as everything should be fine below us.
@@ -1534,7 +1548,7 @@ void RenderObject::repaintTreeAfterLayout()
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (!child->isOutOfFlowPositioned())
- child->repaintTreeAfterLayout();
+ child->repaintTreeAfterLayout(repaintContainer);
}
}
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698