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 "platform/geometry/LayoutRect.h" | 8 #include "platform/geometry/LayoutRect.h" |
9 #include "platform/transforms/AffineTransform.h" | 9 #include "platform/transforms/AffineTransform.h" |
10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 const LayoutRect& clipRect() const { return m_clipRect; } | 32 const LayoutRect& clipRect() const { return m_clipRect; } |
33 const LayoutSize& paintOffset() const { return m_paintOffset; } | 33 const LayoutSize& paintOffset() const { return m_paintOffset; } |
34 const AffineTransform& svgTransform() const { ASSERT(m_svgTransform); return
*m_svgTransform; } | 34 const AffineTransform& svgTransform() const { ASSERT(m_svgTransform); return
*m_svgTransform; } |
35 | 35 |
36 bool cachedOffsetsEnabled() const { return m_cachedOffsetsEnabled; } | 36 bool cachedOffsetsEnabled() const { return m_cachedOffsetsEnabled; } |
37 bool isClipped() const { return m_clipped; } | 37 bool isClipped() const { return m_clipped; } |
38 | 38 |
39 bool forcedSubtreeInvalidationWithinContainer() const { return m_forcedSubtr
eeInvalidationWithinContainer; } | 39 bool forcedSubtreeInvalidationWithinContainer() const { return m_forcedSubtr
eeInvalidationWithinContainer; } |
40 void setForceSubtreeInvalidationWithinContainer() { m_forcedSubtreeInvalidat
ionWithinContainer = true; } | 40 void setForceSubtreeInvalidationWithinContainer() { m_forcedSubtreeInvalidat
ionWithinContainer = true; } |
41 | 41 |
| 42 bool forcedSubtreeInvalidationRectUpdateWithinContainer() const { return m_f
orcedSubtreeInvalidationRectUpdateWithinContainer; } |
| 43 void setForceSubtreeInvalidationRectUpdateWithinContainer() { m_forcedSubtre
eInvalidationRectUpdateWithinContainer = true; } |
| 44 |
42 const LayoutBoxModelObject& paintInvalidationContainer() const { return m_pa
intInvalidationContainer; } | 45 const LayoutBoxModelObject& paintInvalidationContainer() const { return m_pa
intInvalidationContainer; } |
43 | 46 |
44 bool canMapToContainer(const LayoutBoxModelObject* container) const | 47 bool canMapToContainer(const LayoutBoxModelObject* container) const |
45 { | 48 { |
46 return m_cachedOffsetsEnabled && container == &m_paintInvalidationContai
ner; | 49 return m_cachedOffsetsEnabled && container == &m_paintInvalidationContai
ner; |
47 } | 50 } |
48 | 51 |
49 // Records |obj| as needing paint invalidation on the next frame. See the de
finition of PaintInvalidationDelayedFull for more details. | 52 // Records |obj| as needing paint invalidation on the next frame. See the de
finition of PaintInvalidationDelayedFull for more details. |
50 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye
dPaintInvalidations.append(&obj); } | 53 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye
dPaintInvalidations.append(&obj); } |
51 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p
endingDelayedPaintInvalidations; } | 54 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p
endingDelayedPaintInvalidations; } |
52 | 55 |
53 private: | 56 private: |
54 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela
yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState); | 57 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela
yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState); |
55 | 58 |
56 void applyClipIfNeeded(const LayoutObject&); | 59 void applyClipIfNeeded(const LayoutObject&); |
57 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize); | 60 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize); |
58 | 61 |
59 friend class ForceHorriblySlowRectMapping; | 62 friend class ForceHorriblySlowRectMapping; |
60 | 63 |
61 bool m_clipped; | 64 bool m_clipped; |
62 mutable bool m_cachedOffsetsEnabled; | 65 mutable bool m_cachedOffsetsEnabled; |
63 bool m_forcedSubtreeInvalidationWithinContainer; | 66 bool m_forcedSubtreeInvalidationWithinContainer; |
| 67 bool m_forcedSubtreeInvalidationRectUpdateWithinContainer; |
64 | 68 |
65 LayoutRect m_clipRect; | 69 LayoutRect m_clipRect; |
66 | 70 |
67 // x/y offset from paint invalidation container. Includes relative positioni
ng and scroll offsets. | 71 // x/y offset from paint invalidation container. Includes relative positioni
ng and scroll offsets. |
68 LayoutSize m_paintOffset; | 72 LayoutSize m_paintOffset; |
69 | 73 |
70 const LayoutBoxModelObject& m_paintInvalidationContainer; | 74 const LayoutBoxModelObject& m_paintInvalidationContainer; |
71 | 75 |
72 // Transform from the initial viewport coordinate system of an outermost | 76 // Transform from the initial viewport coordinate system of an outermost |
73 // SVG root to the userspace _before_ the relevant element. Combining this | 77 // SVG root to the userspace _before_ the relevant element. Combining this |
74 // with |m_paintOffset| yields the "final" offset. | 78 // with |m_paintOffset| yields the "final" offset. |
75 OwnPtr<AffineTransform> m_svgTransform; | 79 OwnPtr<AffineTransform> m_svgTransform; |
76 | 80 |
77 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations; | 81 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations; |
78 }; | 82 }; |
79 | 83 |
80 } // namespace blink | 84 } // namespace blink |
81 | 85 |
82 #endif // PaintInvalidationState_h | 86 #endif // PaintInvalidationState_h |
OLD | NEW |