Chromium Code Reviews| Index: Source/core/layout/LayoutObject.h |
| diff --git a/Source/core/layout/LayoutObject.h b/Source/core/layout/LayoutObject.h |
| index 5be3d0db2781b113becb8e6ad2e003ad48b1ca3a..99821683fafa5747cba6e992ae9ed126da4d1a7d 100644 |
| --- a/Source/core/layout/LayoutObject.h |
| +++ b/Source/core/layout/LayoutObject.h |
| @@ -1138,6 +1138,17 @@ public: |
| m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvalidationBacking; |
| } |
| + const bool paintOffsetChanged(const LayoutPoint& newPaintOffset) const |
| + { |
| + ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled()); |
| + return /*m_previousPaintOffset != uninitializedPaintOffset() && */m_previousPaintOffset != newPaintOffset; |
|
pdr.
2015/09/23 19:55:47
Oops
Xianzhu
2015/09/23 21:39:44
Done.
|
| + } |
| + void setPreviousPaintOffset(const LayoutPoint& paintOffset) const |
| + { |
| + ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled()); |
| + m_previousPaintOffset = paintOffset; |
| + } |
| + |
| PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfields.fullPaintInvalidationReason(); } |
| bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone; } |
| void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalidationFull); |
| @@ -1396,6 +1407,8 @@ private: |
| const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRect&) const; |
| + static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUnit::max(), LayoutUnit::max()); } |
| + |
| RefPtr<ComputedStyle> m_style; |
| // Oilpan: raw pointer back to the owning Node is considered safe. |
| @@ -1638,10 +1651,15 @@ private: |
| // adjustInvalidationRectForCompositedScrolling(). |
| LayoutRect m_previousPaintInvalidationRect; |
| - // This stores the position in the paint invalidation backing's coordinate. |
| - // It is used to detect layoutObject shifts that forces a full invalidation. |
| - // This point does *not* account for composited scrolling. See adjustInvalidationRectForCompositedScrolling(). |
| - LayoutPoint m_previousPositionFromPaintInvalidationBacking; |
| + union { |
| + // This stores the position in the paint invalidation backing's coordinate. |
| + // It is used to detect layoutObject shifts that forces a full invalidation. |
| + // This point does *not* account for composited scrolling. See adjustInvalidationRectForCompositedScrolling(). |
| + // TODO(wangxianzhu): Remove this when we enable slimmingPaintOffsetCaching. |
| + LayoutPoint m_previousPositionFromPaintInvalidationBacking; |
| + // For slimmingPaintOffsetCaching. |
| + mutable LayoutPoint m_previousPaintOffset; |
| + }; |
| }; |
| // FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit. |