Fix to prevent infinite recursion during AA clip mask generation

http://codereview.appspot.com/6183044/



git-svn-id: http://skia.googlecode.com/svn/trunk@3831 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index a434237..58f8440 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1464,7 +1464,17 @@
 
 void GrContext::flushDrawBuffer() {
     if (fDrawBuffer) {
-        fDrawBuffer->flushTo(fGpu);
+        // With addition of the AA clip path, flushing the draw buffer can
+        // result in the generation of an AA clip mask. During this
+        // process the SW path renderer may be invoked which recusively
+        // calls this method (via internalWriteTexturePixels) creating
+        // infinite recursion
+        GrInOrderDrawBuffer* temp = fDrawBuffer;
+        fDrawBuffer = NULL;
+
+        temp->flushTo(fGpu);
+
+        fDrawBuffer = temp;
     }
 }