| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PaintInvalidationState_h | 5 #ifndef PaintInvalidationState_h |
| 6 #define PaintInvalidationState_h | 6 #define PaintInvalidationState_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" |
| 8 #include "platform/geometry/LayoutRect.h" | 9 #include "platform/geometry/LayoutRect.h" |
| 9 #include "platform/transforms/AffineTransform.h" | 10 #include "platform/transforms/AffineTransform.h" |
| 10 #include "wtf/Allocator.h" | 11 #include "wtf/Allocator.h" |
| 11 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 | 15 |
| 15 class LayoutBoxModelObject; | 16 class LayoutBoxModelObject; |
| 16 class LayoutObject; | 17 class LayoutObject; |
| 17 class LayoutSVGModelObject; | 18 class LayoutSVGModelObject; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 28 // | 29 // |
| 29 // This class is extremely close to LayoutState so see the documentation | 30 // This class is extremely close to LayoutState so see the documentation |
| 30 // of LayoutState for the class existence and performance benefits. | 31 // of LayoutState for the class existence and performance benefits. |
| 31 // | 32 // |
| 32 // The main difference with LayoutState is that it was customized for the | 33 // The main difference with LayoutState is that it was customized for the |
| 33 // needs of the paint invalidation systems (keeping visual rectangles | 34 // needs of the paint invalidation systems (keeping visual rectangles |
| 34 // instead of layout specific information). | 35 // instead of layout specific information). |
| 35 // | 36 // |
| 36 // See Source/core/paint/README.md ### PaintInvalidationState for more details. | 37 // See Source/core/paint/README.md ### PaintInvalidationState for more details. |
| 37 | 38 |
| 38 class PaintInvalidationState { | 39 class CORE_EXPORT PaintInvalidationState { |
| 39 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 40 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 40 WTF_MAKE_NONCOPYABLE(PaintInvalidationState); | 41 WTF_MAKE_NONCOPYABLE(PaintInvalidationState); |
| 41 public: | 42 public: |
| 42 PaintInvalidationState(const PaintInvalidationState& parentState, const Layo
utObject&); | 43 PaintInvalidationState(const PaintInvalidationState& parentState, const Layo
utObject&); |
| 43 | 44 |
| 44 // For root LayoutView, or when sub-frame LayoutView's invalidateTreeIfNeede
d() is called directly from | 45 // For root LayoutView, or when sub-frame LayoutView's invalidateTreeIfNeede
d() is called directly from |
| 45 // FrameView::invalidateTreeIfNeededRecursive() instead of the owner LayoutP
art. | 46 // FrameView::invalidateTreeIfNeededRecursive() instead of the owner LayoutP
art. |
| 46 // TODO(wangxianzhu): Eliminate the latter case. | 47 // TODO(wangxianzhu): Eliminate the latter case. |
| 47 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela
yedPaintInvalidations); | 48 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela
yedPaintInvalidations); |
| 48 | 49 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 74 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) const { m_pending
DelayedPaintInvalidations.append(&obj); } | 75 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) const { m_pending
DelayedPaintInvalidations.append(&obj); } |
| 75 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() const { retu
rn m_pendingDelayedPaintInvalidations; } | 76 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() const { retu
rn m_pendingDelayedPaintInvalidations; } |
| 76 | 77 |
| 77 PaintLayer& enclosingSelfPaintingLayer(const LayoutObject&) const; | 78 PaintLayer& enclosingSelfPaintingLayer(const LayoutObject&) const; |
| 78 | 79 |
| 79 #if ENABLE(ASSERT) | 80 #if ENABLE(ASSERT) |
| 80 const LayoutObject& currentObject() const { return m_currentObject; } | 81 const LayoutObject& currentObject() const { return m_currentObject; } |
| 81 #endif | 82 #endif |
| 82 | 83 |
| 83 private: | 84 private: |
| 85 friend class VisualRectMappingTest; |
| 86 |
| 84 void updateForNormalChildren(); | 87 void updateForNormalChildren(); |
| 85 | 88 |
| 86 LayoutRect computePaintInvalidationRectInBackingForSVG() const; | 89 LayoutRect computePaintInvalidationRectInBackingForSVG() const; |
| 87 | 90 |
| 88 void addClipRectRelativeToPaintOffset(const LayoutRect& localClipRect); | 91 void addClipRectRelativeToPaintOffset(const LayoutRect& localClipRect); |
| 89 | 92 |
| 90 friend class ForceHorriblySlowRectMapping; | |
| 91 | |
| 92 const LayoutObject& m_currentObject; | 93 const LayoutObject& m_currentObject; |
| 93 | 94 |
| 94 bool m_forcedSubtreeInvalidationWithinContainer; | 95 bool m_forcedSubtreeInvalidationWithinContainer; |
| 95 bool m_forcedSubtreeInvalidationRectUpdateWithinContainer; | 96 bool m_forcedSubtreeInvalidationRectUpdateWithinContainer; |
| 96 | 97 |
| 97 bool m_clipped; | 98 bool m_clipped; |
| 98 bool m_clippedForAbsolutePosition; | 99 bool m_clippedForAbsolutePosition; |
| 99 | 100 |
| 100 // Clip rect from paintInvalidationContainer if m_cachedOffsetsEnabled is tr
ue. | 101 // Clip rect from paintInvalidationContainer if m_cachedOffsetsEnabled is tr
ue. |
| 101 LayoutRect m_clipRect; | 102 LayoutRect m_clipRect; |
| 102 LayoutRect m_clipRectForAbsolutePosition; | 103 LayoutRect m_clipRectForAbsolutePosition; |
| 103 | 104 |
| 104 // x/y offset from the paintInvalidationContainer if m_cachedOffsetsEnabled
is true. | 105 // x/y offset from the paintInvalidationContainer if m_cachedOffsetsEnabled
is true. |
| 105 // It includes relative positioning and scroll offsets. | 106 // It includes relative positioning and scroll offsets. |
| 106 LayoutSize m_paintOffset; | 107 LayoutSize m_paintOffset; |
| 107 LayoutSize m_paintOffsetForAbsolutePosition; | 108 LayoutSize m_paintOffsetForAbsolutePosition; |
| 108 | 109 |
| 109 // Whether m_paintOffset[XXX] and m_clipRect[XXX] are valid and can be used | 110 // Whether m_paintOffset[XXX] and m_clipRect[XXX] are valid and can be used |
| 110 // to map a rect from space of the current object to space of paintInvalidat
ionContainer. | 111 // to map a rect from space of the current object to space of paintInvalidat
ionContainer. |
| 111 mutable bool m_cachedOffsetsEnabled; | 112 bool m_cachedOffsetsEnabled; |
| 112 bool m_cachedOffsetsForAbsolutePositionEnabled; | 113 bool m_cachedOffsetsForAbsolutePositionEnabled; |
| 113 | 114 |
| 114 // The following two fields are never null. Declare them as pointers because
we need some | 115 // The following two fields are never null. Declare them as pointers because
we need some |
| 115 // logic to initialize them in the body of the constructor. | 116 // logic to initialize them in the body of the constructor. |
| 116 | 117 |
| 117 // The current paint invalidation container for normal flow objects. | 118 // The current paint invalidation container for normal flow objects. |
| 118 // It is the enclosing composited object. | 119 // It is the enclosing composited object. |
| 119 const LayoutBoxModelObject* m_paintInvalidationContainer; | 120 const LayoutBoxModelObject* m_paintInvalidationContainer; |
| 120 | 121 |
| 121 // The current paint invalidation container for stacked contents (stacking c
ontexts or positioned objects). | 122 // The current paint invalidation container for stacked contents (stacking c
ontexts or positioned objects). |
| (...skipping 14 matching lines...) Expand all Loading... |
| 136 PaintLayer& m_enclosingSelfPaintingLayer; | 137 PaintLayer& m_enclosingSelfPaintingLayer; |
| 137 | 138 |
| 138 #if ENABLE(ASSERT) | 139 #if ENABLE(ASSERT) |
| 139 bool m_didUpdateForChildren; | 140 bool m_didUpdateForChildren; |
| 140 #endif | 141 #endif |
| 141 }; | 142 }; |
| 142 | 143 |
| 143 } // namespace blink | 144 } // namespace blink |
| 144 | 145 |
| 145 #endif // PaintInvalidationState_h | 146 #endif // PaintInvalidationState_h |
| OLD | NEW |