OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 PaintInvalidator_h | 5 #ifndef PaintInvalidator_h |
6 #define PaintInvalidator_h | 6 #define PaintInvalidator_h |
7 | 7 |
8 #include "platform/geometry/LayoutRect.h" | 8 #include "platform/geometry/LayoutRect.h" |
9 #include "platform/graphics/paint/GeometryMapper.h" | 9 #include "platform/graphics/paint/GeometryMapper.h" |
10 #include "wtf/Vector.h" | 10 #include "wtf/Vector.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 LayoutRect oldVisualRect; | 75 LayoutRect oldVisualRect; |
76 LayoutRect newVisualRect; | 76 LayoutRect newVisualRect; |
77 | 77 |
78 // Store the origin of the object's local coordinates in the paint | 78 // Store the origin of the object's local coordinates in the paint |
79 // invalidation backing's coordinates. They are used to detect layoutObject | 79 // invalidation backing's coordinates. They are used to detect layoutObject |
80 // shifts that force a full invalidation and invalidation check in subtree. | 80 // shifts that force a full invalidation and invalidation check in subtree. |
81 // The points do *not* account for composited scrolling. See | 81 // The points do *not* account for composited scrolling. See |
82 // LayoutObject::adjustVisualRectForCompositedScrolling(). | 82 // LayoutObject::adjustVisualRectForCompositedScrolling(). |
83 LayoutPoint oldLocation; | 83 LayoutPoint oldLocation; |
84 LayoutPoint newLocation; | 84 LayoutPoint newLocation; |
85 | |
86 // Stores the old and new offsets to paint this object, relative to the | |
87 // containing transform node. They are for SPv2 only. | |
88 LayoutPoint oldPaintOffset; | |
89 LayoutPoint newPaintOffset; | |
90 }; | 85 }; |
91 | 86 |
92 class PaintInvalidator { | 87 class PaintInvalidator { |
93 public: | 88 public: |
94 void invalidatePaintIfNeeded(FrameView&, PaintInvalidatorContext&); | 89 void invalidatePaintIfNeeded(FrameView&, PaintInvalidatorContext&); |
95 void invalidatePaintIfNeeded(const LayoutObject&, PaintInvalidatorContext&); | 90 void invalidatePaintIfNeeded(const LayoutObject&, |
| 91 const LayoutPoint& oldPaintOffset, |
| 92 PaintInvalidatorContext&); |
96 | 93 |
97 // Process objects needing paint invalidation on the next frame. | 94 // Process objects needing paint invalidation on the next frame. |
98 // See the definition of PaintInvalidationDelayedFull for more details. | 95 // See the definition of PaintInvalidationDelayedFull for more details. |
99 void processPendingDelayedPaintInvalidations(); | 96 void processPendingDelayedPaintInvalidations(); |
100 | 97 |
101 private: | 98 private: |
102 LayoutRect mapLocalRectToPaintInvalidationBacking( | 99 LayoutRect mapLocalRectToPaintInvalidationBacking( |
103 const LayoutObject&, | 100 const LayoutObject&, |
104 const FloatRect&, | 101 const FloatRect&, |
105 const PaintInvalidatorContext&); | 102 const PaintInvalidatorContext&); |
106 LayoutRect computeVisualRectInBacking(const LayoutObject&, | 103 LayoutRect computeVisualRectInBacking(const LayoutObject&, |
107 const PaintInvalidatorContext&); | 104 const PaintInvalidatorContext&); |
108 LayoutPoint computeLocationInBacking(const LayoutObject&, | 105 LayoutPoint computeLocationInBacking(const LayoutObject&, |
109 const PaintInvalidatorContext&); | 106 const PaintInvalidatorContext&); |
110 void updatePaintingLayer(const LayoutObject&, PaintInvalidatorContext&); | 107 void updatePaintingLayer(const LayoutObject&, PaintInvalidatorContext&); |
111 void updateContext(const LayoutObject&, PaintInvalidatorContext&); | 108 void updateContext(const LayoutObject&, PaintInvalidatorContext&); |
112 | 109 |
113 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; | 110 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; |
114 GeometryMapper m_geometryMapper; | 111 GeometryMapper m_geometryMapper; |
115 }; | 112 }; |
116 | 113 |
117 } // namespace blink | 114 } // namespace blink |
118 | 115 |
119 #endif // PaintInvalidator_h | 116 #endif // PaintInvalidator_h |
OLD | NEW |