Drawstate on stack
BUG=skia:
Review URL: https://codereview.chromium.org/732693002
diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp
index 14a14a0..d70593e 100644
--- a/src/gpu/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/GrStencilAndCoverTextContext.cpp
@@ -333,10 +333,9 @@
&fGlyphCache->getDescriptor(), gpuStroke);
}
- fStateRestore.set(fDrawTarget->drawState());
+ fStateRestore.set(&fDrawState);
- fDrawTarget->drawState()->setFromPaint(fPaint, fContext->getMatrix(),
- fContext->getRenderTarget());
+ fDrawState.setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTarget());
GR_STATIC_CONST_SAME_STENCIL(kStencilPass,
kZero_StencilOp,
@@ -346,7 +345,7 @@
0x0000,
0xffff);
- *fDrawTarget->drawState()->stencil() = kStencilPass;
+ *fDrawState.stencil() = kStencilPass;
SkASSERT(0 == fPendingGlyphCount);
}
@@ -368,7 +367,7 @@
return;
}
- fDrawTarget->drawPaths(fGlyphs, fIndexBuffer, fPendingGlyphCount, fTransformBuffer,
+ fDrawTarget->drawPaths(&fDrawState, fGlyphs, fIndexBuffer, fPendingGlyphCount, fTransformBuffer,
GrPathRendering::kTranslate_PathTransformType,
GrPathRendering::kWinding_FillType);
@@ -384,7 +383,7 @@
SkGlyphCache::AttachCache(fGlyphCache);
fGlyphCache = NULL;
- fDrawTarget->drawState()->stencil()->setDisabled();
+ fDrawState.stencil()->setDisabled();
fStateRestore.set(NULL);
fContext->setMatrix(fContextInitialMatrix);
GrTextContext::finish();