Start removing calls to GrDrawState::setTexture() (and GrPaint::setTexture()?) when there's
a GrSingleTextureEffect involved holding the texture.

http://codereview.appspot.com/6353094/



git-svn-id: http://skia.googlecode.com/svn/trunk@4608 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 6443fa2..dfded26 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -562,7 +562,6 @@
         SkDebugf("Couldn't convert bitmap to texture.\n");
         return false;
     }
-    grPaint->setTexture(kShaderTextureIdx, texture);
 
     switch (bmptype) {
         case SkShader::kRadial_BitmapType:
@@ -595,6 +594,9 @@
             } else {
                 sampler->setFilter(GrSamplerState::kNearest_Filter);
             }
+            // TODO - once we have a trivial GrCustomStage for texture drawing,
+            // create that here & get rid of the paint's texture
+            grPaint->setTexture(kShaderTextureIdx, texture);
             break;
     }
     sampler->setWrapX(sk_tile_mode_to_grwrap(tileModes[0]));
@@ -1476,7 +1478,6 @@
     paint.textureSampler(0)->setFilter(GrSamplerState::kBilinear_Filter);
     paint.textureSampler(0)->reset(sampleM);
     paint.textureSampler(0)->setCustomStage(stage);
-    paint.setTexture(0, srcTexture);
     context->drawRect(paint, rect);
 }