Move GrGLPrimitive/GeometryProc to GLSL

BUG=skia:

Review URL: https://codereview.chromium.org/1441683008
diff --git a/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp b/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp
new file mode 100644
index 0000000..abb3abc
--- /dev/null
+++ b/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrGLSLPrimitiveProcessor.h"
+
+#include "glsl/GrGLSLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+
+SkMatrix GrGLSLPrimitiveProcessor::GetTransformMatrix(const SkMatrix& localMatrix,
+                                                      const GrCoordTransform& coordTransform) {
+    SkMatrix combined;
+    // We only apply the localmatrix to localcoords
+    if (kLocal_GrCoordSet == coordTransform.sourceCoords()) {
+        combined.setConcat(coordTransform.getMatrix(), localMatrix);
+    } else {
+        combined = coordTransform.getMatrix();
+    }
+    if (coordTransform.reverseY()) {
+        // combined.postScale(1,-1);
+        // combined.postTranslate(0,1);
+        combined.set(SkMatrix::kMSkewY,
+            combined[SkMatrix::kMPersp0] - combined[SkMatrix::kMSkewY]);
+        combined.set(SkMatrix::kMScaleY,
+            combined[SkMatrix::kMPersp1] - combined[SkMatrix::kMScaleY]);
+        combined.set(SkMatrix::kMTransY,
+            combined[SkMatrix::kMPersp2] - combined[SkMatrix::kMTransY]);
+    }
+    return combined;
+}
+
+void GrGLSLPrimitiveProcessor::setupUniformColor(GrGLSLGPBuilder* pb,
+                                                 const char* outputName,
+                                                 UniformHandle* colorUniform) {
+    GrGLSLFragmentBuilder* fs = pb->getFragmentShaderBuilder();
+    SkASSERT(colorUniform);
+    const char* stagedLocalVarName;
+    *colorUniform = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+                                   kVec4f_GrSLType,
+                                   kDefault_GrSLPrecision,
+                                   "Color",
+                                   &stagedLocalVarName);
+    fs->codeAppendf("%s = %s;", outputName, stagedLocalVarName);
+}