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 18 matching lines...) Expand all Loading... | |
29 PaintInvalidationState(const LayoutView& layoutView, PaintInvalidationState& ownerPaintInvalidationState) | 29 PaintInvalidationState(const LayoutView& layoutView, PaintInvalidationState& ownerPaintInvalidationState) |
30 : PaintInvalidationState(layoutView, ownerPaintInvalidationState.m_pendi ngDelayedPaintInvalidations, &ownerPaintInvalidationState) { } | 30 : PaintInvalidationState(layoutView, ownerPaintInvalidationState.m_pendi ngDelayedPaintInvalidations, &ownerPaintInvalidationState) { } |
31 | 31 |
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 ancestorHadPaintInvalidationForLocationChange() const { return m_ancest orHadPaintInvalidationForLocationChange; } | 39 bool forcedPaintInvalidation() const { return m_forcedPaintInvalidation; } |
pdr.
2015/09/15 02:33:39
Bikeshed: wdyt about changing this to reflect that
fs
2015/09/15 08:44:35
Renamed to the latter.
| |
40 void setAncestorHadPaintInvalidationForLocationChange() { m_ancestorHadPaint InvalidationForLocationChange = true; } | 40 void setForcePaintInvalidation() { m_forcedPaintInvalidation = true; } |
41 | 41 |
42 const LayoutBoxModelObject& paintInvalidationContainer() const { return m_pa intInvalidationContainer; } | 42 const LayoutBoxModelObject& paintInvalidationContainer() const { return m_pa intInvalidationContainer; } |
43 | 43 |
44 bool canMapToContainer(const LayoutBoxModelObject* container) const | 44 bool canMapToContainer(const LayoutBoxModelObject* container) const |
45 { | 45 { |
46 return m_cachedOffsetsEnabled && container == &m_paintInvalidationContai ner; | 46 return m_cachedOffsetsEnabled && container == &m_paintInvalidationContai ner; |
47 } | 47 } |
48 | 48 |
49 // Records |obj| as needing paint invalidation on the next frame. See the de finition of PaintInvalidationDelayedFull for more details. | 49 // 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); } | 50 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye dPaintInvalidations.append(&obj); } |
51 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p endingDelayedPaintInvalidations; } | 51 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p endingDelayedPaintInvalidations; } |
52 | 52 |
53 private: | 53 private: |
54 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState); | 54 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState); |
55 | 55 |
56 void applyClipIfNeeded(const LayoutObject&); | 56 void applyClipIfNeeded(const LayoutObject&); |
57 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize); | 57 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize); |
58 | 58 |
59 friend class ForceHorriblySlowRectMapping; | 59 friend class ForceHorriblySlowRectMapping; |
60 | 60 |
61 bool m_clipped; | 61 bool m_clipped; |
62 mutable bool m_cachedOffsetsEnabled; | 62 mutable bool m_cachedOffsetsEnabled; |
63 bool m_ancestorHadPaintInvalidationForLocationChange; | 63 bool m_forcedPaintInvalidation; |
64 | 64 |
65 LayoutRect m_clipRect; | 65 LayoutRect m_clipRect; |
66 | 66 |
67 // x/y offset from paint invalidation container. Includes relative positioni ng and scroll offsets. | 67 // x/y offset from paint invalidation container. Includes relative positioni ng and scroll offsets. |
68 LayoutSize m_paintOffset; | 68 LayoutSize m_paintOffset; |
69 | 69 |
70 const LayoutBoxModelObject& m_paintInvalidationContainer; | 70 const LayoutBoxModelObject& m_paintInvalidationContainer; |
71 | 71 |
72 // Transform from the initial viewport coordinate system of an outermost | 72 // Transform from the initial viewport coordinate system of an outermost |
73 // SVG root to the userspace _before_ the relevant element. Combining this | 73 // SVG root to the userspace _before_ the relevant element. Combining this |
74 // with |m_paintOffset| yields the "final" offset. | 74 // with |m_paintOffset| yields the "final" offset. |
75 OwnPtr<AffineTransform> m_svgTransform; | 75 OwnPtr<AffineTransform> m_svgTransform; |
76 | 76 |
77 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations; | 77 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations; |
78 }; | 78 }; |
79 | 79 |
80 } // namespace blink | 80 } // namespace blink |
81 | 81 |
82 #endif // PaintInvalidationState_h | 82 #endif // PaintInvalidationState_h |
OLD | NEW |