OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef DeprecatedPaintLayerStackingNodeIterator_h | 31 #ifndef DeprecatedPaintLayerStackingNodeIterator_h |
32 #define DeprecatedPaintLayerStackingNodeIterator_h | 32 #define DeprecatedPaintLayerStackingNodeIterator_h |
33 | 33 |
| 34 #include "wtf/Allocator.h" |
34 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
35 | 36 |
36 namespace blink { | 37 namespace blink { |
37 | 38 |
38 enum ChildrenIteration { | 39 enum ChildrenIteration { |
39 NegativeZOrderChildren = 1, | 40 NegativeZOrderChildren = 1, |
40 NormalFlowChildren = 1 << 1, | 41 NormalFlowChildren = 1 << 1, |
41 PositiveZOrderChildren = 1 << 2, | 42 PositiveZOrderChildren = 1 << 2, |
42 AllChildren = NegativeZOrderChildren | NormalFlowChildren | PositiveZOrderCh
ildren | 43 AllChildren = NegativeZOrderChildren | NormalFlowChildren | PositiveZOrderCh
ildren |
43 }; | 44 }; |
44 | 45 |
45 class DeprecatedPaintLayerStackingNode; | 46 class DeprecatedPaintLayerStackingNode; |
46 class DeprecatedPaintLayer; | 47 class DeprecatedPaintLayer; |
47 | 48 |
48 // This iterator walks the DeprecatedPaintLayerStackingNode lists in the followi
ng order: | 49 // This iterator walks the DeprecatedPaintLayerStackingNode lists in the followi
ng order: |
49 // NegativeZOrderChildren -> NormalFlowChildren -> PositiveZOrderChildren. | 50 // NegativeZOrderChildren -> NormalFlowChildren -> PositiveZOrderChildren. |
50 class DeprecatedPaintLayerStackingNodeIterator { | 51 class DeprecatedPaintLayerStackingNodeIterator { |
| 52 STACK_ALLOCATED(); |
51 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNodeIterator); | 53 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNodeIterator); |
52 public: | 54 public: |
53 DeprecatedPaintLayerStackingNodeIterator(const DeprecatedPaintLayerStackingN
ode& root, unsigned whichChildren); | 55 DeprecatedPaintLayerStackingNodeIterator(const DeprecatedPaintLayerStackingN
ode& root, unsigned whichChildren); |
54 | 56 |
55 DeprecatedPaintLayerStackingNode* next(); | 57 DeprecatedPaintLayerStackingNode* next(); |
56 | 58 |
57 private: | 59 private: |
58 const DeprecatedPaintLayerStackingNode& m_root; | 60 const DeprecatedPaintLayerStackingNode& m_root; |
59 unsigned m_remainingChildren; | 61 unsigned m_remainingChildren; |
60 unsigned m_index; | 62 unsigned m_index; |
61 DeprecatedPaintLayer* m_currentNormalFlowChild; | 63 DeprecatedPaintLayer* m_currentNormalFlowChild; |
62 }; | 64 }; |
63 | 65 |
64 // This iterator is similar to DeprecatedPaintLayerStackingNodeIterator but it w
alks the lists in reverse order | 66 // This iterator is similar to DeprecatedPaintLayerStackingNodeIterator but it w
alks the lists in reverse order |
65 // (from the last item to the first one). | 67 // (from the last item to the first one). |
66 class DeprecatedPaintLayerStackingNodeReverseIterator { | 68 class DeprecatedPaintLayerStackingNodeReverseIterator { |
| 69 STACK_ALLOCATED(); |
67 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNodeReverseIterator); | 70 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNodeReverseIterator); |
68 public: | 71 public: |
69 DeprecatedPaintLayerStackingNodeReverseIterator(const DeprecatedPaintLayerSt
ackingNode& root, unsigned whichChildren) | 72 DeprecatedPaintLayerStackingNodeReverseIterator(const DeprecatedPaintLayerSt
ackingNode& root, unsigned whichChildren) |
70 : m_root(root) | 73 : m_root(root) |
71 , m_remainingChildren(whichChildren) | 74 , m_remainingChildren(whichChildren) |
72 { | 75 { |
73 setIndexToLastItem(); | 76 setIndexToLastItem(); |
74 } | 77 } |
75 | 78 |
76 DeprecatedPaintLayerStackingNode* next(); | 79 DeprecatedPaintLayerStackingNode* next(); |
77 | 80 |
78 private: | 81 private: |
79 void setIndexToLastItem(); | 82 void setIndexToLastItem(); |
80 | 83 |
81 const DeprecatedPaintLayerStackingNode& m_root; | 84 const DeprecatedPaintLayerStackingNode& m_root; |
82 unsigned m_remainingChildren; | 85 unsigned m_remainingChildren; |
83 int m_index; | 86 int m_index; |
84 DeprecatedPaintLayer* m_currentNormalFlowChild; | 87 DeprecatedPaintLayer* m_currentNormalFlowChild; |
85 }; | 88 }; |
86 | 89 |
87 } // namespace blink | 90 } // namespace blink |
88 | 91 |
89 #endif // DeprecatedPaintLayerStackingNodeIterator_h | 92 #endif // DeprecatedPaintLayerStackingNodeIterator_h |
OLD | NEW |