More carefully disable stages in Ganesh to avoid textures or effects
leaking between draw calls.

http://codereview.appspot.com/6353083/



git-svn-id: http://skia.googlecode.com/svn/trunk@4510 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 9132770..c07001c 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -225,14 +225,19 @@
         }
         return true;
     }
+
+    void disableStage(int index) {
+        GrSafeSetNull(fTextures[index]);
+        fSamplerStates[index].setCustomStage(NULL);
+    }
+
     /**
      * Release all the textures and custom stages referred to by this
      * draw state.
      */
     void disableStages() {
         for (int i = 0; i < kNumStages; ++i) {
-            GrSafeSetNull(fTextures[i]);
-            fSamplerStates[i].setCustomStage(NULL);
+            this->disableStage(i);
         }
     }