Two and three color GPU gradients without textures.

R=bsalomon@google.com

Review URL: https://codereview.chromium.org/22854005

git-svn-id: http://skia.googlecode.com/svn/trunk@11158 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index cf9cb98..9a23071 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -1,4 +1,3 @@
-
 /*
  * Copyright 2012 Google Inc.
  *
@@ -495,7 +494,7 @@
     GrSLType coordsVaryingType;
     this->setupMatrix(builder, key, &fsCoords, &vsCoordsVarying, &coordsVaryingType);
 
-    this->emitYCoordUniform(builder);
+    this->emitUniforms(builder, key);
     // 2 copies of uniform array, 1 for each of vertex & fragment shader,
     // to work around Xoom bug. Doesn't seem to cause performance decrease
     // in test apps, but need to keep an eye on it.
@@ -617,7 +616,7 @@
                                    p5.c_str(), p3.c_str());
 
             builder->fsCodeAppend("\t\t");
-            this->emitColorLookup(builder, tName.c_str(), outputColor, inputColor, samplers[0]);
+            this->emitColor(builder, tName.c_str(), key, outputColor, inputColor, samplers);
 
             // otherwise, if r(t) for the larger root was <= 0, try the other root
             builder->fsCodeAppend("\t\t} else {\n");
@@ -629,7 +628,7 @@
                                    tName.c_str(), p5.c_str(), p3.c_str());
 
             builder->fsCodeAppend("\t\t\t");
-            this->emitColorLookup(builder, tName.c_str(), outputColor, inputColor, samplers[0]);
+            this->emitColor(builder, tName.c_str(), key, outputColor, inputColor, samplers);
 
             // end if (r(t) > 0) for smaller root
             builder->fsCodeAppend("\t\t\t}\n");
@@ -647,7 +646,7 @@
             builder->fsCodeAppendf("\tif (%s * %s + %s > 0.0) {\n", tName.c_str(),
                                    p5.c_str(), p3.c_str());
             builder->fsCodeAppend("\t");
-            this->emitColorLookup(builder, tName.c_str(), outputColor, inputColor, samplers[0]);
+            this->emitColor(builder, tName.c_str(), key, outputColor, inputColor, samplers);
             builder->fsCodeAppend("\t}\n");
         }
     }
@@ -693,10 +692,10 @@
 GrGLEffect::EffectKey GrGLConical2Gradient::GenKey(const GrDrawEffect& drawEffect,
                                                    const GrGLCaps&) {
     enum {
-        kIsDegenerate = 1 << kMatrixKeyBitCnt,
+        kIsDegenerate = 1 << kBaseKeyBitCnt,
     };
 
-    EffectKey key = GenMatrixKey(drawEffect);
+    EffectKey key = GenBaseGradientKey(drawEffect);
     if (drawEffect.castEffect<GrConical2Gradient>().isDegenerate()) {
         key |= kIsDegenerate;
     }