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

Unified Diff: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp

Issue 1585823002: Improve performance when calling PaintLayer::setNeedsRepaint() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@RemoveVisualRect
Patch Set: Created 4 years, 11 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/layout/PaintInvalidationState.h ('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/layout/PaintInvalidationState.cpp
diff --git a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
index 86d5be22199f4895838dfab82c3ffd4eef60d642..23d8fa55e08bfee7b607b5a15f7ec5d227b004bb 100644
--- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
+++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
@@ -20,6 +20,7 @@ PaintInvalidationState::PaintInvalidationState(const LayoutView& layoutView, Vec
, m_viewClippingAndScrollOffsetDisabled(false)
, m_paintInvalidationContainer(layoutView.containerForPaintInvalidation())
, m_pendingDelayedPaintInvalidations(pendingDelayedPaintInvalidations)
+ , m_enclosingLayer(*layoutView.layer())
{
bool establishesPaintInvalidationContainer = layoutView == m_paintInvalidationContainer;
if (!establishesPaintInvalidationContainer) {
@@ -46,6 +47,7 @@ PaintInvalidationState::PaintInvalidationState(PaintInvalidationState& next, Lay
, m_viewClippingAndScrollOffsetDisabled(false)
, m_paintInvalidationContainer(paintInvalidationContainer)
, m_pendingDelayedPaintInvalidations(next.pendingDelayedPaintInvalidationTargets())
+ , m_enclosingLayer(next.enclosingLayer(layoutObject))
{
// FIXME: SVG could probably benefit from a stack-based optimization like html does. crbug.com/391054
bool establishesPaintInvalidationContainer = layoutObject == m_paintInvalidationContainer;
@@ -107,6 +109,7 @@ PaintInvalidationState::PaintInvalidationState(PaintInvalidationState& next, con
, m_paintOffset(next.m_paintOffset)
, m_paintInvalidationContainer(next.m_paintInvalidationContainer)
, m_pendingDelayedPaintInvalidations(next.pendingDelayedPaintInvalidationTargets())
+ , m_enclosingLayer(next.enclosingLayer(layoutObject))
{
ASSERT(layoutObject != m_paintInvalidationContainer);
@@ -142,4 +145,19 @@ void PaintInvalidationState::applyClipIfNeeded(const LayoutObject& layoutObject)
m_paintOffset -= box.scrolledContentOffset();
}
+PaintLayer& PaintInvalidationState::enclosingLayer(const LayoutObject& layoutObject) const
+{
+ if (layoutObject.hasLayer())
+ return *toLayoutBoxModelObject(layoutObject).layer();
+
+ // During paint invalidation, a multi-column spanner place holder invokes paint invalidation of
+ // its layoutObjectInFlowThread (which has a non-null spannerPlaceHolder) directly, skipping the
+ // parent of its layoutObjectInFlowThread which has a PaintLayer.
+ if (layoutObject.spannerPlaceholder())
+ return *layoutObject.enclosingLayer();
+
+ ASSERT(layoutObject.enclosingLayer() == &m_enclosingLayer);
+ return m_enclosingLayer;
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/PaintInvalidationState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698