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/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 606b90e..2db006a 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -88,7 +88,7 @@
     const SkClipStack::Iter::Clip* clip = NULL;
     for (clip = iter.skipToTopmost(SkRegion::kReplace_Op);
          NULL != clip;
-         clip = iter.next()) {
+         clip = iter.nextCombined()) {
 
         if (clip->fDoAA) {
             return true;
@@ -117,13 +117,7 @@
 
     for (clip = iter.skipToTopmost(SkRegion::kReplace_Op);
          NULL != clip;
-         clip = iter.next()) {
-
-        if (SkRegion::kReplace_Op == clip->fOp) {
-            // Everything before a replace op can be ignored so start
-            // afresh w.r.t. determining if any element uses the SW path
-            useSW = false;
-        }
+         clip = iter.nextCombined()) {
 
         // rects can always be drawn directly w/o using the software path
         // so only paths need to be checked
@@ -297,7 +291,7 @@
 
     for (clip = iter->skipToTopmost(SkRegion::kReplace_Op);
          NULL != clip && !done;
-         clip = iter->next()) {
+         clip = iter->nextCombined()) {
         switch (clip->fOp) {
             case SkRegion::kReplace_Op:
                 // replace ignores everything previous
@@ -644,7 +638,7 @@
     GrAutoScratchTexture temp;
     bool first = true;
     // walk through each clip element and perform its set op
-    for ( ; NULL != clip; clip = iter.next()) {
+    for ( ; NULL != clip; clip = iter.nextCombined()) {
 
         SkRegion::Op op = clip->fOp;
         if (first) {
@@ -785,7 +779,7 @@
 
         // walk through each clip element and perform its set op
         // with the existing clip.
-        for ( ; NULL != clip; clip = iter.next()) {
+        for ( ; NULL != clip; clip = iter.nextCombined()) {
             GrPathFill fill;
             bool fillInverted = false;
             // enabled at bottom of loop
@@ -1151,7 +1145,7 @@
     helper.clear(clearToInside ? 0xFF : 0x00);
 
     bool first = true;
-    for ( ; NULL != clip; clip = iter.next()) {
+    for ( ; NULL != clip; clip = iter.nextCombined()) {
 
         SkRegion::Op op = clip->fOp;
         if (first) {