Index: third_party/WebKit/Source/core/paint/PaintInvalidator.h |
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.h b/third_party/WebKit/Source/core/paint/PaintInvalidator.h |
index fb56f491e1a2b84a417098116659c1284f8b722f..0dd18bb24285c977d0f3c2b3e053c5521d94f07d 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintInvalidator.h |
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.h |
@@ -5,24 +5,20 @@ |
#ifndef PaintInvalidator_h |
#define PaintInvalidator_h |
+#include "core/layout/LayoutObject.h" |
+#include "core/paint/PaintPropertyTreeBuilder.h" |
#include "platform/geometry/LayoutRect.h" |
#include "wtf/Vector.h" |
namespace blink { |
-class FrameView; |
-class LayoutBoxModelObject; |
-class LayoutObject; |
-class PaintLayer; |
-struct PaintPropertyTreeBuilderContext; |
- |
struct PaintInvalidatorContext { |
PaintInvalidatorContext( |
- const PaintPropertyTreeBuilderContext& treeBuilderContext) |
+ const PaintPropertyTreeBuilderContext* treeBuilderContext) |
: parentContext(nullptr), m_treeBuilderContext(treeBuilderContext) {} |
PaintInvalidatorContext( |
- const PaintPropertyTreeBuilderContext& treeBuilderContext, |
+ const PaintPropertyTreeBuilderContext* treeBuilderContext, |
const PaintInvalidatorContext& parentContext) |
: parentContext(&parentContext), |
forcedSubtreeInvalidationFlags( |
@@ -38,14 +34,27 @@ struct PaintInvalidatorContext { |
virtual void mapLocalRectToVisualRectInBacking(const LayoutObject&, |
LayoutRect&) const; |
+ bool needsVisualRectUpdate(const LayoutObject& object) const { |
+ if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
+ return true; |
+#if DCHECK_IS_ON() |
+ if (m_forceVisualRectUpdateForChecking) |
+ return true; |
+#endif |
+ return object.needsPaintOffsetAndVisualRectUpdate() || |
+ (forcedSubtreeInvalidationFlags & |
+ PaintInvalidatorContext::ForcedSubtreeVisualRectUpdate); |
+ } |
+ |
const PaintInvalidatorContext* parentContext; |
enum ForcedSubtreeInvalidationFlag { |
ForcedSubtreeInvalidationChecking = 1 << 0, |
- ForcedSubtreeInvalidationRectUpdate = 1 << 1, |
+ ForcedSubtreeVisualRectUpdate = 1 << 1, |
ForcedSubtreeFullInvalidation = 1 << 2, |
ForcedSubtreeFullInvalidationForStackedContents = 1 << 3, |
ForcedSubtreeSVGResourceChange = 1 << 4, |
+ |
// TODO(crbug.com/637313): This is temporary before we support filters in |
// paint property tree. |
ForcedSubtreeSlowPathRect = 1 << 5, |
@@ -96,7 +105,12 @@ struct PaintInvalidatorContext { |
private: |
friend class PaintInvalidator; |
- const PaintPropertyTreeBuilderContext& m_treeBuilderContext; |
+ const PaintPropertyTreeBuilderContext* m_treeBuilderContext; |
+ |
+#if DCHECK_IS_ON() |
+ friend class FindVisualRectNeedingUpdateScopeBase; |
+ mutable bool m_forceVisualRectUpdateForChecking = false; |
+#endif |
}; |
class PaintInvalidator { |
@@ -125,6 +139,8 @@ class PaintInvalidator { |
PaintInvalidatorContext&); |
ALWAYS_INLINE void updatePaintInvalidationContainer(const LayoutObject&, |
PaintInvalidatorContext&); |
+ ALWAYS_INLINE void updateVisualRectIfNeeded(const LayoutObject&, |
+ PaintInvalidatorContext&); |
ALWAYS_INLINE void updateVisualRect(const LayoutObject&, |
PaintInvalidatorContext&); |