Move ViewMatrix off of drawstate

BUG=skia:

Review URL: https://codereview.chromium.org/815553003
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h
index fb2300e..d88f3e6 100644
--- a/src/gpu/GrGeometryProcessor.h
+++ b/src/gpu/GrGeometryProcessor.h
@@ -92,6 +92,7 @@
 public:
     // TODO let the PrimProc itself set this in its setData call, this should really live on the
     // bundle of primitive data
+    const SkMatrix& viewMatrix() const { return fViewMatrix; }
     const SkMatrix& localMatrix() const { return fLocalMatrix; }
 
     /*
@@ -135,7 +136,9 @@
     virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const = 0;
 
 protected:
-    GrPrimitiveProcessor(const SkMatrix& localMatrix) : fLocalMatrix(localMatrix) {}
+    GrPrimitiveProcessor(const SkMatrix& viewMatrix, const SkMatrix& localMatrix)
+        : fViewMatrix(viewMatrix)
+        , fLocalMatrix(localMatrix) {}
 
     /*
      * CanCombineOutput will return true if two draws are 'batchable' from a color perspective.
@@ -168,6 +171,7 @@
     }
 
 private:
+    SkMatrix fViewMatrix;
     SkMatrix fLocalMatrix;
 
     typedef GrProcessor INHERITED;
@@ -185,9 +189,10 @@
     // TODO the Hint can be handled in a much more clean way when we have deferred geometry or
     // atleast bundles
     GrGeometryProcessor(GrColor color,
-                        bool opaqueVertexColors = false,
-                        const SkMatrix& localMatrix = SkMatrix::I())
-        : INHERITED(localMatrix)
+                        const SkMatrix& viewMatrix = SkMatrix::I(),
+                        const SkMatrix& localMatrix = SkMatrix::I(),
+                        bool opaqueVertexColors = false)
+        : INHERITED(viewMatrix, localMatrix)
         , fVertexStride(0)
         , fColor(color)
         , fOpaqueVertexColors(opaqueVertexColors)
@@ -237,6 +242,11 @@
             return false;
         }
 
+        // TODO let the GPs decide this
+        if (!this->viewMatrix().cheapEqualTo(that.viewMatrix())) {
+            return false;
+        }
+
         // TODO remove the hint
         const GrGeometryProcessor& other = that.cast<GrGeometryProcessor>();
         if (fHasVertexColor && fOpaqueVertexColors != other.fOpaqueVertexColors) {
@@ -342,8 +352,10 @@
  */
 class GrPathProcessor : public GrPrimitiveProcessor {
 public:
-    static GrPathProcessor* Create(GrColor color, const SkMatrix& localMatrix = SkMatrix::I()) {
-        return SkNEW_ARGS(GrPathProcessor, (color, localMatrix));
+    static GrPathProcessor* Create(GrColor color,
+                                   const SkMatrix& viewMatrix = SkMatrix::I(),
+                                   const SkMatrix& localMatrix = SkMatrix::I()) {
+        return SkNEW_ARGS(GrPathProcessor, (color, viewMatrix, localMatrix));
     }
     
     void initBatchTracker(GrBatchTracker*, const InitBT&) const SK_OVERRIDE;
@@ -366,7 +378,7 @@
     virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_OVERRIDE;
 
 private:
-    GrPathProcessor(GrColor color, const SkMatrix& localMatrix);
+    GrPathProcessor(GrColor color, const SkMatrix& viewMatrix, const SkMatrix& localMatrix);
     GrColor fColor;
 
     typedef GrPrimitiveProcessor INHERITED;