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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 | 46 |
47 bool canMapToContainer(const LayoutBoxModelObject* container) const | 47 bool canMapToContainer(const LayoutBoxModelObject* container) const |
48 { | 48 { |
49 return m_cachedOffsetsEnabled && container == &m_paintInvalidationContai ner; | 49 return m_cachedOffsetsEnabled && container == &m_paintInvalidationContai ner; |
50 } | 50 } |
51 | 51 |
52 // 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. |
53 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye dPaintInvalidations.append(&obj); } | 53 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye dPaintInvalidations.append(&obj); } |
54 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p endingDelayedPaintInvalidations; } | 54 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p endingDelayedPaintInvalidations; } |
55 | 55 |
56 // Disable view clipping and scroll offset adjustment for paint invalidation of FrameView scrollbars. | |
57 // TODO(wangxianzhu): Remove this for root-layer-scrolls. | |
chrishtr
2015/11/17 01:34:20
"Remove this when root-layer-scrolls launches"
Xianzhu
2015/11/17 18:31:37
Done.
| |
58 bool viewClippingAndScrollOffsetDisabled() const { return m_viewClippingAndS crollOffsetDisabled; } | |
59 void setViewClippingAndScrollOffsetDisabled(bool b) { m_viewClippingAndScrol lOffsetDisabled = b; } | |
60 | |
56 private: | 61 private: |
57 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState); | 62 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState); |
58 | 63 |
59 void applyClipIfNeeded(const LayoutObject&); | 64 void applyClipIfNeeded(const LayoutObject&); |
60 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize); | 65 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize); |
61 | 66 |
62 friend class ForceHorriblySlowRectMapping; | 67 friend class ForceHorriblySlowRectMapping; |
63 | 68 |
64 bool m_clipped; | 69 bool m_clipped; |
65 mutable bool m_cachedOffsetsEnabled; | 70 mutable bool m_cachedOffsetsEnabled; |
66 bool m_forcedSubtreeInvalidationWithinContainer; | 71 bool m_forcedSubtreeInvalidationWithinContainer; |
67 bool m_forcedSubtreeInvalidationRectUpdateWithinContainer; | 72 bool m_forcedSubtreeInvalidationRectUpdateWithinContainer; |
73 bool m_viewClippingAndScrollOffsetDisabled; | |
68 | 74 |
69 LayoutRect m_clipRect; | 75 LayoutRect m_clipRect; |
70 | 76 |
71 // x/y offset from paint invalidation container. Includes relative positioni ng and scroll offsets. | 77 // x/y offset from paint invalidation container. Includes relative positioni ng and scroll offsets. |
72 LayoutSize m_paintOffset; | 78 LayoutSize m_paintOffset; |
73 | 79 |
74 const LayoutBoxModelObject& m_paintInvalidationContainer; | 80 const LayoutBoxModelObject& m_paintInvalidationContainer; |
75 | 81 |
76 // Transform from the initial viewport coordinate system of an outermost | 82 // Transform from the initial viewport coordinate system of an outermost |
77 // SVG root to the userspace _before_ the relevant element. Combining this | 83 // SVG root to the userspace _before_ the relevant element. Combining this |
78 // with |m_paintOffset| yields the "final" offset. | 84 // with |m_paintOffset| yields the "final" offset. |
79 OwnPtr<AffineTransform> m_svgTransform; | 85 OwnPtr<AffineTransform> m_svgTransform; |
80 | 86 |
81 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations; | 87 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations; |
82 }; | 88 }; |
83 | 89 |
84 } // namespace blink | 90 } // namespace blink |
85 | 91 |
86 #endif // PaintInvalidationState_h | 92 #endif // PaintInvalidationState_h |
OLD | NEW |