Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: Source/core/paint/DeprecatedPaintLayerStackingNodeIterator.h

Issue 1188363002: Compute the normal flow list on the fly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reviewnated patch! Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 25 matching lines...) Expand all
36 namespace blink { 36 namespace blink {
37 37
38 enum ChildrenIteration { 38 enum ChildrenIteration {
39 NegativeZOrderChildren = 1, 39 NegativeZOrderChildren = 1,
40 NormalFlowChildren = 1 << 1, 40 NormalFlowChildren = 1 << 1,
41 PositiveZOrderChildren = 1 << 2, 41 PositiveZOrderChildren = 1 << 2,
42 AllChildren = NegativeZOrderChildren | NormalFlowChildren | PositiveZOrderCh ildren 42 AllChildren = NegativeZOrderChildren | NormalFlowChildren | PositiveZOrderCh ildren
43 }; 43 };
44 44
45 class DeprecatedPaintLayerStackingNode; 45 class DeprecatedPaintLayerStackingNode;
46 class DeprecatedPaintLayer;
46 47
47 // This iterator walks the DeprecatedPaintLayerStackingNode lists in the followi ng order: 48 // This iterator walks the DeprecatedPaintLayerStackingNode lists in the followi ng order:
48 // NegativeZOrderChildren -> NormalFlowChildren -> PositiveZOrderChildren. 49 // NegativeZOrderChildren -> NormalFlowChildren -> PositiveZOrderChildren.
49 class DeprecatedPaintLayerStackingNodeIterator { 50 class DeprecatedPaintLayerStackingNodeIterator {
50 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNodeIterator); 51 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNodeIterator);
51 public: 52 public:
52 DeprecatedPaintLayerStackingNodeIterator(const DeprecatedPaintLayerStackingN ode& root, unsigned whichChildren) 53 DeprecatedPaintLayerStackingNodeIterator(const DeprecatedPaintLayerStackingN ode& root, unsigned whichChildren);
53 : m_root(root)
54 , m_remainingChildren(whichChildren)
55 , m_index(0)
56 {
57 }
58 54
59 DeprecatedPaintLayerStackingNode* next(); 55 DeprecatedPaintLayerStackingNode* next();
60 56
61 private: 57 private:
62 const DeprecatedPaintLayerStackingNode& m_root; 58 const DeprecatedPaintLayerStackingNode& m_root;
63 unsigned m_remainingChildren; 59 unsigned m_remainingChildren;
64 unsigned m_index; 60 unsigned m_index;
61 DeprecatedPaintLayer* m_currentNormalFlowChild;
65 }; 62 };
66 63
67 // This iterator is similar to DeprecatedPaintLayerStackingNodeIterator but it w alks the lists in reverse order 64 // This iterator is similar to DeprecatedPaintLayerStackingNodeIterator but it w alks the lists in reverse order
68 // (from the last item to the first one). 65 // (from the last item to the first one).
69 class DeprecatedPaintLayerStackingNodeReverseIterator { 66 class DeprecatedPaintLayerStackingNodeReverseIterator {
70 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNodeReverseIterator); 67 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerStackingNodeReverseIterator);
71 public: 68 public:
72 DeprecatedPaintLayerStackingNodeReverseIterator(const DeprecatedPaintLayerSt ackingNode& root, unsigned whichChildren) 69 DeprecatedPaintLayerStackingNodeReverseIterator(const DeprecatedPaintLayerSt ackingNode& root, unsigned whichChildren)
73 : m_root(root) 70 : m_root(root)
74 , m_remainingChildren(whichChildren) 71 , m_remainingChildren(whichChildren)
75 { 72 {
76 setIndexToLastItem(); 73 setIndexToLastItem();
77 } 74 }
78 75
79 DeprecatedPaintLayerStackingNode* next(); 76 DeprecatedPaintLayerStackingNode* next();
80 77
81 private: 78 private:
82 void setIndexToLastItem(); 79 void setIndexToLastItem();
83 80
84 const DeprecatedPaintLayerStackingNode& m_root; 81 const DeprecatedPaintLayerStackingNode& m_root;
85 unsigned m_remainingChildren; 82 unsigned m_remainingChildren;
86 int m_index; 83 int m_index;
84 DeprecatedPaintLayer* m_currentNormalFlowChild;
87 }; 85 };
88 86
89 } // namespace blink 87 } // namespace blink
90 88
91 #endif // DeprecatedPaintLayerStackingNodeIterator_h 89 #endif // DeprecatedPaintLayerStackingNodeIterator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698