Make the text context not have to save / restore GrDrawState at each draw.

Reivew URL: http://codereview.appspot.com/5844049/



git-svn-id: http://skia.googlecode.com/svn/trunk@3422 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index cafa77b..ed5b1a3 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1916,6 +1916,11 @@
             *drawState->sampler(s) = paint.getMaskSampler(i);
         }
     }
+    
+    // disable all stages not accessible via the paint
+    for (int s = GrPaint::kTotalStages; s < GrDrawState::kNumStages; ++s) {
+        drawState->setTexture(s, NULL);
+    }
 
     drawState->setColor(paint.fColor);
 
diff --git a/src/gpu/GrDefaultTextContext.cpp b/src/gpu/GrDefaultTextContext.cpp
index 93b7e2c..a0747b7 100644
--- a/src/gpu/GrDefaultTextContext.cpp
+++ b/src/gpu/GrDefaultTextContext.cpp
@@ -21,7 +21,6 @@
 void GrDefaultTextContext::flushGlyphs() {
     GrAssert(this->isValid());
     if (fCurrVertex > 0) {
-        GrDrawTarget::AutoStateRestore asr(fDrawTarget);
         GrDrawState* drawState = fDrawTarget->drawState();
         // setup our sampler state for our text texture/atlas
         GrSamplerState::Filter filter;
diff --git a/src/gpu/GrDefaultTextContext.h b/src/gpu/GrDefaultTextContext.h
index 71a7f51..4a935dc 100644
--- a/src/gpu/GrDefaultTextContext.h
+++ b/src/gpu/GrDefaultTextContext.h
@@ -35,7 +35,6 @@
     GrGpuTextVertex* fVertices;
     GrIRect          fClipRect;
 
-    GrFontScaler*   fScaler;
     GrTextStrike*   fStrike;
 
     GrMatrix    fExtMatrix;