aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-20 15:33:18 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-20 15:33:18 +0000
commit80214e26c57c5fea954006400852e8999e201923 (patch)
tree59e23fdd0310caa1438c979ffb91a5cb8aab2de6 /include
parentcbd0ad90307c2d9d1fce0239476fb03dec8eca9b (diff)
Made clarifying renamings to SkClipStack's iterators (and added to unit test)
Diffstat (limited to 'include')
-rw-r--r--include/core/SkClipStack.h27
-rw-r--r--include/gpu/SkGr.h4
2 files changed, 17 insertions, 14 deletions
diff --git a/include/core/SkClipStack.h b/include/core/SkClipStack.h
index 60c4421103..daeb82629a 100644
--- a/include/core/SkClipStack.h
+++ b/include/core/SkClipStack.h
@@ -45,8 +45,8 @@ public:
class Iter {
public:
enum IterStart {
- kFront_IterStart = SkDeque::Iter::kFront_IterStart,
- kBack_IterStart = SkDeque::Iter::kBack_IterStart
+ kBottom_IterStart = SkDeque::Iter::kFront_IterStart,
+ kTop_IterStart = SkDeque::Iter::kBack_IterStart
};
/**
@@ -80,11 +80,11 @@ public:
const Clip* prev();
/**
- * Moves the iterator to the last clip with the specified RegionOp
+ * Moves the iterator to the topmost clip with the specified RegionOp
* and returns that clip. If no clip with that op is found,
* returns NULL.
*/
- const Clip* skipToLast(SkRegion::Op op);
+ const Clip* skipToTopmost(SkRegion::Op op);
/**
* Restarts the iterator on a clip stack.
@@ -103,17 +103,20 @@ public:
const Clip* updateClip(const SkClipStack::Rec* rec);
};
- // Inherit privately from Iter to prevent access to reverse iteration
- class B2FIter : private Iter {
+ /**
+ * The B2TIter iterates from the bottom of the stack to the top.
+ * It inherits privately from Iter to prevent access to reverse iteration.
+ */
+ class B2TIter : private Iter {
public:
- B2FIter() {}
+ B2TIter() {}
/**
* Wrap Iter's 2 parameter ctor to force initialization to the
- * beginning of the deque
+ * beginning of the deque/bottom of the stack
*/
- B2FIter(const SkClipStack& stack)
- : INHERITED(stack, kFront_IterStart) {
+ B2TIter(const SkClipStack& stack)
+ : INHERITED(stack, kBottom_IterStart) {
}
using Iter::Clip;
@@ -121,10 +124,10 @@ public:
/**
* Wrap Iter::reset to force initialization to the
- * beginning of the deque
+ * beginning of the deque/bottom of the stack
*/
void reset(const SkClipStack& stack) {
- this->INHERITED::reset(stack, kFront_IterStart);
+ this->INHERITED::reset(stack, kBottom_IterStart);
}
private:
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 975a1bad44..ea79c63342 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -127,10 +127,10 @@ public:
private:
const SkClipStack* fClipStack;
- SkClipStack::B2FIter fIter;
+ SkClipStack::B2TIter fIter;
// SkClipStack's auto advances on each get
// so we store the current pos here.
- const SkClipStack::B2FIter::Clip* fCurr;
+ const SkClipStack::B2TIter::Clip* fCurr;
};
class SkGlyphCache;