Remove stage masks

Review URL: http://codereview.appspot.com/6422047/



git-svn-id: http://skia.googlecode.com/svn/trunk@4688 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index c8e3440..1ef52fb 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -927,12 +927,8 @@
     context->setRenderTarget(oldRenderTarget);
     context->setClip(oldClip);
 
-    if (grp->hasTextureOrMask()) {
-        GrMatrix inverse;
-        if (!matrix.invert(&inverse)) {
-            return false;
-        }
-        grp->preConcatActiveSamplerMatrices(inverse);
+    if (!grp->preConcatSamplerMatricesWithInverse(matrix)) {
+        return false;
     }
 
     static const int MASK_IDX = GrPaint::kMaxMasks - 1;
@@ -978,11 +974,12 @@
     // we now have a device-aligned 8bit mask in dstM, ready to be drawn using
     // the current clip (and identity matrix) and grpaint settings
 
-    // used to compute inverse view, if necessary
-    GrMatrix ivm = matrix;
-
     GrContext::AutoMatrix avm(context, GrMatrix::I());
 
+    if (!grp->preConcatSamplerMatricesWithInverse(matrix)) {
+        return false;
+    }
+
     GrTextureDesc desc;
     desc.fWidth = dstM.fBounds.width();
     desc.fHeight = dstM.fBounds.height();
@@ -997,10 +994,6 @@
     texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
                                dstM.fImage, dstM.fRowBytes);
 
-    if (grp->hasTextureOrMask() && ivm.invert(&ivm)) {
-        grp->preConcatActiveSamplerMatrices(ivm);
-    }
-
     static const int MASK_IDX = GrPaint::kMaxMasks - 1;
     // we assume the last mask index is available for use
     GrAssert(!grp->isMaskStageEnabled(MASK_IDX));