AutoScratchTexture can now release its texture and it will return to the texture cache when freed

http://codereview.appspot.com/6262043/



git-svn-id: http://skia.googlecode.com/svn/trunk@4301 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 72ad543..bfad6df 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -336,7 +336,11 @@
     if (sw_draw_path_to_mask_texture(path, pathBounds,
                                      fill, fContext,
                                      translate, &ast, antiAlias)) {
+#if 1
         GrTexture* texture = ast.texture();
+#else
+        SkAutoTUnref<GrTexture> texture(ast.detach());
+#endif
         GrAssert(NULL != texture);
         GrDrawTarget::AutoDeviceCoordDraw adcd(target, stageMask);
         enum {
@@ -351,6 +355,7 @@
         GrScalar h = GrIntToScalar(pathBounds.height());
         GrRect maskRect = GrRect::MakeWH(w / texture->width(),
                                          h / texture->height());
+
         const GrRect* srcRects[GrDrawState::kNumStages] = {NULL};
         srcRects[kPathMaskStage] = &maskRect;
         stageMask |= 1 << kPathMaskStage;