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
diff --git a/include/core/SkClipStack.h b/include/core/SkClipStack.h
index 79fd2c9..443e6ad 100644
--- a/include/core/SkClipStack.h
+++ b/include/core/SkClipStack.h
@@ -103,7 +103,7 @@
 
     /**
      * 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 @@
         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 @@
         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().