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" |
11 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class LayoutBoxModelObject; | 15 class LayoutBoxModelObject; |
16 class LayoutObject; | 16 class LayoutObject; |
17 class LayoutSVGModelObject; | 17 class LayoutSVGModelObject; |
18 class LayoutView; | 18 class LayoutView; |
| 19 class PaintLayer; |
19 | 20 |
20 class PaintInvalidationState { | 21 class PaintInvalidationState { |
21 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 22 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
22 WTF_MAKE_NONCOPYABLE(PaintInvalidationState); | 23 WTF_MAKE_NONCOPYABLE(PaintInvalidationState); |
23 public: | 24 public: |
24 PaintInvalidationState(PaintInvalidationState& next, LayoutBoxModelObject& l
ayoutObject, const LayoutBoxModelObject& paintInvalidationContainer); | 25 PaintInvalidationState(PaintInvalidationState& next, LayoutBoxModelObject& l
ayoutObject, const LayoutBoxModelObject& paintInvalidationContainer); |
25 PaintInvalidationState(PaintInvalidationState& next, const LayoutSVGModelObj
ect& layoutObject); | 26 PaintInvalidationState(PaintInvalidationState& next, const LayoutSVGModelObj
ect& layoutObject); |
26 | 27 |
27 PaintInvalidationState(const LayoutView& layoutView, Vector<LayoutObject*>&
pendingDelayedPaintInvalidations) | 28 PaintInvalidationState(const LayoutView& layoutView, Vector<LayoutObject*>&
pendingDelayedPaintInvalidations) |
28 : PaintInvalidationState(layoutView, pendingDelayedPaintInvalidations, n
ullptr) { } | 29 : PaintInvalidationState(layoutView, pendingDelayedPaintInvalidations, n
ullptr) { } |
(...skipping 22 matching lines...) Expand all Loading... |
51 | 52 |
52 // Records |obj| as needing paint invalidation on the next frame. See the de
finition of PaintInvalidationDelayedFull for more details. | 53 // Records |obj| as needing paint invalidation on the next frame. See the de
finition of PaintInvalidationDelayedFull for more details. |
53 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye
dPaintInvalidations.append(&obj); } | 54 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye
dPaintInvalidations.append(&obj); } |
54 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p
endingDelayedPaintInvalidations; } | 55 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p
endingDelayedPaintInvalidations; } |
55 | 56 |
56 // Disable view clipping and scroll offset adjustment for paint invalidation
of FrameView scrollbars. | 57 // Disable view clipping and scroll offset adjustment for paint invalidation
of FrameView scrollbars. |
57 // TODO(wangxianzhu): Remove this when root-layer-scrolls launches. | 58 // TODO(wangxianzhu): Remove this when root-layer-scrolls launches. |
58 bool viewClippingAndScrollOffsetDisabled() const { return m_viewClippingAndS
crollOffsetDisabled; } | 59 bool viewClippingAndScrollOffsetDisabled() const { return m_viewClippingAndS
crollOffsetDisabled; } |
59 void setViewClippingAndScrollOffsetDisabled(bool b) { m_viewClippingAndScrol
lOffsetDisabled = b; } | 60 void setViewClippingAndScrollOffsetDisabled(bool b) { m_viewClippingAndScrol
lOffsetDisabled = b; } |
60 | 61 |
| 62 PaintLayer& enclosingLayer() const { return m_enclosingLayer; } |
| 63 |
61 private: | 64 private: |
62 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela
yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState); | 65 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela
yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState); |
63 | 66 |
64 void applyClipIfNeeded(const LayoutObject&); | 67 void applyClipIfNeeded(const LayoutObject&); |
65 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize); | 68 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize); |
66 | 69 |
67 friend class ForceHorriblySlowRectMapping; | 70 friend class ForceHorriblySlowRectMapping; |
68 | 71 |
69 bool m_clipped; | 72 bool m_clipped; |
70 mutable bool m_cachedOffsetsEnabled; | 73 mutable bool m_cachedOffsetsEnabled; |
71 bool m_forcedSubtreeInvalidationWithinContainer; | 74 bool m_forcedSubtreeInvalidationWithinContainer; |
72 bool m_forcedSubtreeInvalidationRectUpdateWithinContainer; | 75 bool m_forcedSubtreeInvalidationRectUpdateWithinContainer; |
73 bool m_viewClippingAndScrollOffsetDisabled; | 76 bool m_viewClippingAndScrollOffsetDisabled; |
74 | 77 |
75 LayoutRect m_clipRect; | 78 LayoutRect m_clipRect; |
76 | 79 |
77 // x/y offset from paint invalidation container. Includes relative positioni
ng and scroll offsets. | 80 // x/y offset from paint invalidation container. Includes relative positioni
ng and scroll offsets. |
78 LayoutSize m_paintOffset; | 81 LayoutSize m_paintOffset; |
79 | 82 |
80 const LayoutBoxModelObject& m_paintInvalidationContainer; | 83 const LayoutBoxModelObject& m_paintInvalidationContainer; |
81 | 84 |
82 // Transform from the initial viewport coordinate system of an outermost | 85 // Transform from the initial viewport coordinate system of an outermost |
83 // SVG root to the userspace _before_ the relevant element. Combining this | 86 // SVG root to the userspace _before_ the relevant element. Combining this |
84 // with |m_paintOffset| yields the "final" offset. | 87 // with |m_paintOffset| yields the "final" offset. |
85 AffineTransform m_svgTransform; | 88 AffineTransform m_svgTransform; |
86 | 89 |
87 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations; | 90 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations; |
| 91 |
| 92 PaintLayer& m_enclosingLayer; |
88 }; | 93 }; |
89 | 94 |
90 } // namespace blink | 95 } // namespace blink |
91 | 96 |
92 #endif // PaintInvalidationState_h | 97 #endif // PaintInvalidationState_h |
OLD | NEW |