Fixed two bugs in SW-only clip mask generation

http://codereview.appspot.com/6306086/



git-svn-id: http://skia.googlecode.com/svn/trunk@4290 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index c16b410..53221a3 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -427,21 +427,6 @@
     drawState->setTexture(0, NULL);
 }
 
-namespace {
-
-void clear(GrGpu* gpu,
-           GrTexture* target,
-           GrColor color) {
-    GrDrawState* drawState = gpu->drawState();
-    GrAssert(NULL != drawState);
-
-    // zap entire target to specified color
-    drawState->setRenderTarget(target->asRenderTarget());
-    gpu->clear(NULL, color);
-}
-
-}
-
 // get a texture to act as a temporary buffer for AA clip boolean operations
 // TODO: given the expense of createTexture we may want to just cache this too
 void GrClipMaskManager::getTemp(const GrIRect& bounds, 
@@ -577,7 +562,9 @@
                                               &clearToInside,
                                               &startOp);
 
-    clear(fGpu, accum, clearToInside ? 0xffffffff : 0x00000000);
+    fGpu->clear(NULL, 
+                clearToInside ? 0xffffffff : 0x00000000, 
+                accum->asRenderTarget());
 
     GrAutoScratchTexture temp;
 
@@ -592,7 +579,7 @@
             // replace ops and alter GrClip to allow them through
 
             // clear the accumulator and draw the new object directly into it
-            clear(fGpu, accum, 0x00000000);
+            fGpu->clear(NULL, 0x00000000, accum->asRenderTarget());
 
             setup_boolean_blendcoeffs(drawState, op);
             this->drawClipShape(accum, clipIn, c);
@@ -613,7 +600,7 @@
             }
 
             // clear the temp target & draw into it
-            clear(fGpu, temp.texture(), 0x00000000);
+            fGpu->clear(NULL, 0x00000000, temp.texture()->asRenderTarget());
 
             setup_boolean_blendcoeffs(drawState, SkRegion::kReplace_Op);
             this->drawClipShape(temp.texture(), clipIn, c);
@@ -1146,11 +1133,11 @@
     GrDrawState* drawState = fGpu->drawState();
     GrAssert(NULL != drawState);
     GrRenderTarget* temp = drawState->getRenderTarget();
-    clear(fGpu, accum, 0x00000000);
+    fGpu->clear(NULL, 0x00000000, accum->asRenderTarget());
     // can't leave the accum bound as a rendertarget
     drawState->setRenderTarget(temp);
 
-    helper.toTexture(accum);
+    helper.toTexture(accum, clearToInside);
 
     *result = accum;