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

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

Issue 264183002: RAL: Eliminate n^2 walk to find repaint containers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: With less asserts :( 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
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 3ed3012dcfc4866d4fb637a06319027fe8aa1f74..49354af26358f94614f5941cbe1e8edd729ca304 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -1108,6 +1108,11 @@ const RenderLayer* RenderLayer::compositingContainer() const
return 0;
}
+bool RenderLayer::isRepaintContainer() const
+{
+ return compositingState() == PaintsIntoOwnBacking || compositingState() == PaintsIntoGroupedBacking;
+}
+
// FIXME: having two different functions named enclosingCompositingLayer and enclosingCompositingLayerForRepaint
// is error-prone and misleading for reading code that uses these functions - especially compounded with
// the includeSelf option. It is very likely that we don't even want either of these functions; A layer
@@ -1132,11 +1137,11 @@ RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(IncludeSelfOrNot i
{
ASSERT(isAllowedToQueryCompositingState());
- if ((includeSelf == IncludeSelf) && (compositingState() == PaintsIntoOwnBacking || compositingState() == PaintsIntoGroupedBacking))
+ if ((includeSelf == IncludeSelf) && isRepaintContainer())
return const_cast<RenderLayer*>(this);
for (const RenderLayer* curr = compositingContainer(); curr; curr = curr->compositingContainer()) {
- if (curr->compositingState() == PaintsIntoOwnBacking || curr->compositingState() == PaintsIntoGroupedBacking)
+ if (curr->isRepaintContainer())
return const_cast<RenderLayer*>(curr);
}

Powered by Google App Engine
This is Rietveld 408576698