Make GrDrawState a real class with getters and setters
Review URL: http://codereview.appspot.com/5448119/



git-svn-id: http://skia.googlecode.com/svn/trunk@2830 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index 4b78d4a..ef98487 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -25,6 +25,7 @@
 void GrTextContext::flushGlyphs() {
     if (fCurrVertex > 0) {
         GrDrawTarget::AutoStateRestore asr(fDrawTarget);
+        GrDrawState* drawState = fDrawTarget->drawState();
 
         // setup our sampler state for our text texture/atlas
         GrSamplerState::Filter filter;
@@ -41,6 +42,7 @@
         int nIndices = fCurrVertex + (fCurrVertex >> 1);
         GrAssert(fCurrTexture);
         fDrawTarget->setTexture(kGlyphMaskStage, fCurrTexture);
+        drawState->setTexture(kGlyphMaskStage, fCurrTexture);
 
         if (!GrPixelConfigIsAlphaOnly(fCurrTexture->config())) {
             if (kOne_BlendCoeff != fPaint.fSrcBlendCoeff ||
@@ -49,15 +51,15 @@
                 GrPrintf("LCD Text will not draw correctly.\n");
             }
             // setup blend so that we get mask * paintColor + (1-mask)*dstColor
-            fDrawTarget->setBlendConstant(fPaint.fColor);
-            fDrawTarget->setBlendFunc(kConstC_BlendCoeff, kISC_BlendCoeff);
+            drawState->setBlendConstant(fPaint.fColor);
+            drawState->setBlendFunc(kConstC_BlendCoeff, kISC_BlendCoeff);
             // don't modulate by the paint's color in the frag since we're
             // already doing it via the blend const.
-            fDrawTarget->setColor(0xffffffff);
+            drawState->setColor(0xffffffff);
         } else {
             // set back to normal in case we took LCD path previously.
-            fDrawTarget->setBlendFunc(fPaint.fSrcBlendCoeff, fPaint.fDstBlendCoeff);
-            fDrawTarget->setColor(fPaint.fColor);
+            drawState->setBlendFunc(fPaint.fSrcBlendCoeff, fPaint.fDstBlendCoeff);
+            drawState->setColor(fPaint.fColor);
         }
 
         fDrawTarget->setIndexSourceToBuffer(fContext->getQuadIndexBuffer());