Remove easily-removable uses of setTexture(), instead creating a GrSingleTextureEffect -
where feasible, through convenience function on GrDrawState.

http://codereview.appspot.com/6425055/



git-svn-id: http://skia.googlecode.com/svn/trunk@4694 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index a78bdf7..8c6db5d 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -368,8 +368,7 @@
                                                GrDrawTarget::kReset_ASRInit);
             GrDrawState* drawState = fGpu->drawState();
             drawState->setRenderTarget(texture->asRenderTarget());
-            drawState->sampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect,
-                                                             (clampEntry.texture())))->unref();
+            drawState->createTextureEffect(0, clampEntry.texture());
 
             GrSamplerState::Filter filter;
             // if filtering is not desired then we want to ensure all
@@ -1405,7 +1404,7 @@
         matrix.postIDiv(src->width(), src->height());
         drawState->sampler(0)->reset(matrix);
         drawState->sampler(0)->setRAndBSwap(swapRAndB);
-        drawState->sampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect, (src)))->unref();
+        drawState->createTextureEffect(0, src);
         GrRect rect;
         rect.setXYWH(0, 0, SK_Scalar1 * width, SK_Scalar1 * height);
         fGpu->drawSimpleRect(rect, NULL);
@@ -1445,7 +1444,7 @@
     GrMatrix sampleM;
     sampleM.setIDiv(src->width(), src->height());
     drawState->sampler(0)->reset(sampleM);
-    drawState->sampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect, (src)))->unref();
+    drawState->createTextureEffect(0, src);
     SkRect rect = SkRect::MakeXYWH(0, 0,
                                    SK_Scalar1 * src->width(),
                                    SK_Scalar1 * src->height());
@@ -1544,7 +1543,7 @@
     drawState->sampler(0)->reset(GrSamplerState::kClamp_WrapMode,
                                  GrSamplerState::kNearest_Filter,
                                  matrix);
-    drawState->sampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect, (texture)))->unref();
+    drawState->createTextureEffect(0, texture);
     drawState->sampler(0)->setRAndBSwap(swapRAndB);
 
     static const GrVertexLayout layout = 0;