Make GrDrawState::AutoRestoreViewMatrix handle sampler matrices.
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6618065
git-svn-id: http://skia.googlecode.com/svn/trunk@5853 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp
index 5a6b9db..a3f57cd 100644
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -66,7 +66,6 @@
GrAssert(drawState->getStencil().isDisabled());
SkAutoTUnref<GrPath> p(fGpu->createPath(path));
- GrDrawState::AutoViewMatrixRestore avmr;
GrPathFill nonInvertedFill = GrNonInvertedFill(fill);
target->stencilPath(p, nonInvertedFill);
@@ -77,6 +76,8 @@
// fill the path, zero out the stencil
GrRect bounds = p->getBounds();
GrScalar bloat = drawState->getViewMatrix().getMaxStretch() * GR_ScalarHalf;
+ GrDrawState::AutoDeviceCoordDraw adcd;
+
if (nonInvertedFill == fill) {
GR_STATIC_CONST_SAME_STENCIL(kStencilPass,
kZero_StencilOp,
@@ -107,12 +108,7 @@
// theoretically could set bloat = 0, instead leave it because of matrix inversion
// precision.
} else {
- avmr.set(drawState);
- if (!drawState->preConcatSamplerMatricesWithInverse(drawState->getViewMatrix())) {
- GrPrintf("Could not invert matrix.\n");
- return false;
- }
- drawState->viewMatrix()->reset();
+ adcd.set(drawState);
bloat = 0;
}
*drawState->stencil() = kInvertedStencilPass;