| Index: third_party/WebKit/Source/core/layout/PaintInvalidationState.h
|
| diff --git a/third_party/WebKit/Source/core/layout/PaintInvalidationState.h b/third_party/WebKit/Source/core/layout/PaintInvalidationState.h
|
| index 11f0a306aedea2ec64ddff721b32b704971d9eb6..bed8d5c222f08745ba07c59c91a699b5bd43a937 100644
|
| --- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.h
|
| +++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.h
|
| @@ -5,6 +5,8 @@
|
| #ifndef PaintInvalidationState_h
|
| #define PaintInvalidationState_h
|
|
|
| +#include "core/CoreExport.h"
|
| +#include "platform/RuntimeEnabledFeatures.h"
|
| #include "platform/geometry/LayoutRect.h"
|
| #include "platform/transforms/AffineTransform.h"
|
| #include "wtf/Allocator.h"
|
| @@ -27,17 +29,38 @@ class PaintLayer;
|
| // The main difference with LayoutState is that it was customized for the
|
| // needs of the paint invalidation systems (keeping visual rectangles
|
| // instead of layout specific information).
|
| -class PaintInvalidationState {
|
| - DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
|
| +class CORE_EXPORT PaintInvalidationState {
|
| + ALLOW_ONLY_INLINE_ALLOCATION();
|
| WTF_MAKE_NONCOPYABLE(PaintInvalidationState);
|
| public:
|
| - PaintInvalidationState(PaintInvalidationState& next, LayoutBoxModelObject& layoutObject, const LayoutBoxModelObject& paintInvalidationContainer);
|
| + PaintInvalidationState(PaintInvalidationState& next, const LayoutBoxModelObject& layoutObject, const LayoutBoxModelObject& paintInvalidationContainer);
|
| PaintInvalidationState(PaintInvalidationState& next, const LayoutSVGModelObject& layoutObject);
|
|
|
| PaintInvalidationState(const LayoutView& layoutView, Vector<LayoutObject*>& pendingDelayedPaintInvalidations)
|
| : PaintInvalidationState(layoutView, pendingDelayedPaintInvalidations, nullptr) { }
|
| PaintInvalidationState(const LayoutView& layoutView, PaintInvalidationState& ownerPaintInvalidationState)
|
| - : PaintInvalidationState(layoutView, ownerPaintInvalidationState.m_pendingDelayedPaintInvalidations, &ownerPaintInvalidationState) { }
|
| + : PaintInvalidationState(layoutView, *ownerPaintInvalidationState.m_pendingDelayedPaintInvalidations, &ownerPaintInvalidationState) { }
|
| +
|
| + // For slimming paint v2.
|
| + enum PaintInvalidationStateFlags {
|
| + HasClip = 1 << 0,
|
| + HasNonIdentityAndNonTranslateTransform = 1 << 1,
|
| + };
|
| + PaintInvalidationState(const LayoutBoxModelObject& paintingContainer, const LayoutRect& clipRect, unsigned /* PaintInvalidationStateFlags */);
|
| +
|
| + // When PaintInvalidationState is created, m_paintOffset stores the offset of the paintingContainer in
|
| + // its paintInvalidationContainer. LayoutObject::invalidatePaintIfNeededForSynchronizedPainting() will
|
| + // set paint offset to the LayoutObject's paint offset in paintInvalidationContainer temporarily.
|
| + void setPaintOffset(const LayoutSize& paintOffset)
|
| + {
|
| + ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
|
| + m_paintOffset = paintOffset;
|
| + }
|
| + void setCachedOffsetsEnabled(bool b)
|
| + {
|
| + ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
|
| + m_cachedOffsetsEnabled = b;
|
| + }
|
|
|
| const LayoutRect& clipRect() const { return m_clipRect; }
|
| const LayoutSize& paintOffset() const { return m_paintOffset; }
|
| @@ -60,8 +83,16 @@ public:
|
| }
|
|
|
| // Records |obj| as needing paint invalidation on the next frame. See the definition of PaintInvalidationDelayedFull for more details.
|
| - void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelayedPaintInvalidations.append(&obj); }
|
| - Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_pendingDelayedPaintInvalidations; }
|
| + void pushDelayedPaintInvalidationTarget(LayoutObject& obj)
|
| + {
|
| + ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_pendingDelayedPaintInvalidations);
|
| + m_pendingDelayedPaintInvalidations->append(&obj);
|
| + }
|
| + Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets()
|
| + {
|
| + ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_pendingDelayedPaintInvalidations);
|
| + return *m_pendingDelayedPaintInvalidations;
|
| + }
|
|
|
| // Disable view clipping and scroll offset adjustment for paint invalidation of FrameView scrollbars.
|
| // TODO(wangxianzhu): Remove this when root-layer-scrolls launches.
|
| @@ -99,7 +130,7 @@ private:
|
| // with |m_paintOffset| yields the "final" offset.
|
| AffineTransform m_svgTransform;
|
|
|
| - Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations;
|
| + Vector<LayoutObject*>* m_pendingDelayedPaintInvalidations;
|
|
|
| PaintLayer& m_enclosingSelfPaintingLayer;
|
| };
|
|
|