diff options
author | 2012-11-07 21:19:10 +0000 | |
---|---|---|
committer | 2012-11-07 21:19:10 +0000 | |
commit | e8ca6c6e3a55634ac76efe5aceafaf8d669f43ba (patch) | |
tree | 5117b031a0d5bb1fc1cd6eb1b6c4de401abca782 /include/core | |
parent | 4f6fba366387c9a19fb982479cdf6ac9e0355118 (diff) |
Combine multiple intersecting rects in SkClipStack::Iter.
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6816104
git-svn-id: http://skia.googlecode.com/svn/trunk@6339 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkClipStack.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/core/SkClipStack.h b/include/core/SkClipStack.h index 79fd2c9dd4..443e6ad7d9 100644 --- a/include/core/SkClipStack.h +++ b/include/core/SkClipStack.h @@ -103,7 +103,7 @@ public: /** * The generation ID has three reserved values to indicate special - * (potentially ignoreable) cases + * (potentially ignorable) cases */ static const int32_t kInvalidGenID = 0; static const int32_t kEmptyGenID = 1; // no pixels writeable @@ -159,6 +159,14 @@ public: const Clip* prev(); /** + * This is a variant of next() that greedily attempts to combine elements when possible. + * Currently it attempts to combine intersecting rectangles, though it may do more in the + * future. The returned Clip may not refer to a single element in the stack, so its + * generation ID may be invalid. + */ + const Clip* nextCombined(); + + /** * 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. @@ -174,7 +182,7 @@ public: const SkClipStack* fStack; Clip fClip; SkDeque::Iter fIter; - + SkRect fCombinedRect; // used for nextCombined() /** * updateClip updates fClip to the current state of fIter. It unifies * functionality needed by both next() and prev(). |