Remove unnecessary GrContext flushes

Review URL: http://codereview.appspot.com/6446150/



git-svn-id: http://skia.googlecode.com/svn/trunk@5150 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index c32b908..0687dcf 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -778,7 +778,9 @@
 
     void setPaint(const GrPaint& paint);
 
-    GrDrawTarget* prepareToDraw(const GrPaint&, BufferedDraw);
+    /// Sets the paint and returns the target to draw into. The paint can be NULL in which case the
+    /// draw state is left unmodified.
+    GrDrawTarget* prepareToDraw(const GrPaint*, BufferedDraw);
 
     void internalDrawPath(const GrPaint& paint, const SkPath& path,
                           GrPathFill fill, const GrPoint* translate);
@@ -884,15 +886,12 @@
     GrTexture* detach() {
         GrTexture* temp = fTexture;
 
-        GrAssert(1 == temp->getRefCnt());
-
         // freeEntry will remove the texture cache's ref
         temp->ref();
         fContext->freeEntry(fTexture);
         fTexture = NULL;
 
         temp->setFlag((GrTextureFlags) GrTexture::kReturnToCache_FlagBit);
-        GrAssert(1 == temp->getRefCnt());
         return temp;
     }