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

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

Issue 1968123002: Revert of Improve handling of PaintInvalidationLayer (renamed to PaintInvalidationSubtree) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@LocationChange
Patch Set: Created 4 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: 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 890eee0f79f907b67e2ce33ab9b3aa75f8d91783..1b53e44ec460467725b8986801a9cf0ea4d389cf 100644
--- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
+++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
@@ -29,7 +29,8 @@
PaintInvalidationState::PaintInvalidationState(const LayoutView& layoutView, Vector<LayoutObject*>& pendingDelayedPaintInvalidations)
: m_currentObject(layoutView)
- , m_forcedSubtreeInvalidationFlags(0)
+ , m_forcedSubtreeInvalidationWithinContainer(false)
+ , m_forcedSubtreeInvalidationRectUpdateWithinContainer(false)
, m_clipped(false)
, m_clippedForAbsolutePosition(false)
, m_cachedOffsetsEnabled(true)
@@ -58,7 +59,8 @@
PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& parentState, const LayoutObject& currentObject)
: m_currentObject(currentObject)
- , m_forcedSubtreeInvalidationFlags(parentState.m_forcedSubtreeInvalidationFlags)
+ , m_forcedSubtreeInvalidationWithinContainer(parentState.m_forcedSubtreeInvalidationWithinContainer)
+ , m_forcedSubtreeInvalidationRectUpdateWithinContainer(parentState.m_forcedSubtreeInvalidationRectUpdateWithinContainer)
, m_clipped(parentState.m_clipped)
, m_clippedForAbsolutePosition(parentState.m_clippedForAbsolutePosition)
, m_clipRect(parentState.m_clipRect)
@@ -117,8 +119,6 @@
// descendants if possible; or
// - Track offset between the two paintInvalidationContainers.
m_cachedOffsetsEnabled = false;
- if (m_forcedSubtreeInvalidationFlags & FullInvalidationForStackedContents)
- m_forcedSubtreeInvalidationFlags |= FullInvalidation;
}
if (!currentObject.isBoxModelObject() && !currentObject.isSVG())
@@ -144,25 +144,21 @@
// continue forcing a check for paint invalidation, since we're
// descending into a different invalidation container. (For instance if
// our parents were moved, the entire container will just move.)
- if (currentObject != m_paintInvalidationContainerForStackedContents) {
- // However, we need to keep the FullInvalidationForStackedContents flag
- // if the current object isn't the paint invalidation container of
- // stacked contents.
- m_forcedSubtreeInvalidationFlags &= FullInvalidationForStackedContents;
- } else {
- m_forcedSubtreeInvalidationFlags = 0;
- if (currentObject != m_containerForAbsolutePosition
- && m_cachedOffsetsForAbsolutePositionEnabled
- && m_cachedOffsetsEnabled) {
- // The current object is the new paintInvalidationContainer for absolute-position descendants but is not their container.
- // Call updateForCurrentObject() before resetting m_paintOffset to get paint offset of the current object
- // from the original paintInvalidationContainerForStackingContents, then use this paint offset to adjust
- // m_paintOffsetForAbsolutePosition.
- updateForCurrentObject(parentState);
- m_paintOffsetForAbsolutePosition -= m_paintOffset;
- if (m_clippedForAbsolutePosition)
- m_clipRectForAbsolutePosition.move(-m_paintOffset);
- }
+ m_forcedSubtreeInvalidationWithinContainer = false;
+ m_forcedSubtreeInvalidationRectUpdateWithinContainer = false;
+
+ if (currentObject == m_paintInvalidationContainerForStackedContents
+ && currentObject != m_containerForAbsolutePosition
+ && m_cachedOffsetsForAbsolutePositionEnabled
+ && m_cachedOffsetsEnabled) {
+ // The current object is the new paintInvalidationContainer for absolute-position descendants but is not their container.
+ // Call updateForCurrentObject() before resetting m_paintOffset to get paint offset of the current object
+ // from the original paintInvalidationContainerForStackingContents, then use this paint offset to adjust
+ // m_paintOffsetForAbsolutePosition.
+ updateForCurrentObject(parentState);
+ m_paintOffsetForAbsolutePosition -= m_paintOffset;
+ if (m_clippedForAbsolutePosition)
+ m_clipRectForAbsolutePosition.move(-m_paintOffset);
}
m_clipped = false; // Will be updated in updateForChildren().
@@ -235,26 +231,12 @@
m_paintOffset += toLayoutBoxModelObject(m_currentObject).layer()->offsetForInFlowPosition();
}
-void PaintInvalidationState::updateForChildren(PaintInvalidationReason reason)
+void PaintInvalidationState::updateForChildren()
{
#if ENABLE(ASSERT)
ASSERT(!m_didUpdateForChildren);
m_didUpdateForChildren = true;
#endif
-
- switch (reason) {
- case PaintInvalidationDelayedFull:
- pushDelayedPaintInvalidationTarget(const_cast<LayoutObject&>(m_currentObject));
- break;
- case PaintInvalidationSubtree:
- m_forcedSubtreeInvalidationFlags |= (FullInvalidation | FullInvalidationForStackedContents);
- break;
- case PaintInvalidationSVGResourceChange:
- setForceSubtreeInvalidationCheckingWithinContainer();
- break;
- default:
- break;
- }
updateForNormalChildren();

Powered by Google App Engine
This is Rietveld 408576698