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

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

Issue 2208463003: First step of PaintInvalidator implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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 38b038675cbb64788c7cefe6ccfa91911c56cc40..04b7164865fc72da904eeb527218892f4025010c 100644
--- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
+++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
@@ -12,7 +12,9 @@
#include "core/layout/LayoutView.h"
#include "core/layout/svg/LayoutSVGRoot.h"
#include "core/layout/svg/SVGLayoutSupport.h"
+#include "core/paint/PaintInvalidator.h"
#include "core/paint/PaintLayer.h"
+#include "core/paint/PaintPropertyTreeBuilder.h"
namespace blink {
@@ -117,8 +119,8 @@ PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& par
// descendants if possible; or
// - Track offset between the two paintInvalidationContainers.
m_cachedOffsetsEnabled = false;
- if (m_forcedSubtreeInvalidationFlags & FullInvalidationForStackedContents)
- m_forcedSubtreeInvalidationFlags |= FullInvalidation;
+ if (m_forcedSubtreeInvalidationFlags & PaintInvalidatorContext::ForcedSubtreeFullInvalidationForStackedContents)
+ m_forcedSubtreeInvalidationFlags |= PaintInvalidatorContext::ForcedSubtreeFullInvalidation;
}
if (!currentObject.isBoxModelObject() && !currentObject.isSVG())
@@ -148,7 +150,7 @@ PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& par
// However, we need to keep the FullInvalidationForStackedContents flag
// if the current object isn't the paint invalidation container of
// stacked contents.
- m_forcedSubtreeInvalidationFlags &= FullInvalidationForStackedContents;
+ m_forcedSubtreeInvalidationFlags &= PaintInvalidatorContext::ForcedSubtreeFullInvalidationForStackedContents;
} else {
m_forcedSubtreeInvalidationFlags = 0;
if (currentObject != m_containerForAbsolutePosition
@@ -252,7 +254,7 @@ void PaintInvalidationState::updateForChildren(PaintInvalidationReason reason)
m_pendingDelayedPaintInvalidations.append(&m_currentObject);
break;
case PaintInvalidationSubtree:
- m_forcedSubtreeInvalidationFlags |= (FullInvalidation | FullInvalidationForStackedContents);
+ m_forcedSubtreeInvalidationFlags |= (PaintInvalidatorContext::ForcedSubtreeFullInvalidation | PaintInvalidatorContext::ForcedSubtreeFullInvalidationForStackedContents);
break;
case PaintInvalidationSVGResourceChange:
setForceSubtreeInvalidationCheckingWithinContainer();
@@ -512,4 +514,26 @@ void PaintInvalidationState::assertFastPathAndSlowPathRectsEqual(const LayoutRec
#endif // CHECK_FAST_PATH_SLOW_PATH_EQUALITY
+static const PaintPropertyTreeBuilderContext& dummyTreeBuilderContext()
+{
+ DEFINE_STATIC_LOCAL(PaintPropertyTreeBuilderContext, dummyContext, ());
+ return dummyContext;
+}
+
+PaintInvalidatorContextAdapter::PaintInvalidatorContextAdapter(const PaintInvalidationState& paintInvalidationState)
+ : PaintInvalidatorContext(dummyTreeBuilderContext())
+ , m_paintInvalidationState(paintInvalidationState)
+{
+ forcedSubtreeInvalidationFlags = paintInvalidationState.m_forcedSubtreeInvalidationFlags;
+ paintInvalidationContainer = &paintInvalidationState.paintInvalidationContainer();
+ paintingLayer = &paintInvalidationState.paintingLayer();
+}
+
+
+void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking(const LayoutObject& object, LayoutRect& rect) const
+{
+ DCHECK(&object == &m_paintInvalidationState.currentObject());
+ m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698