Flip the switch to turn on GrCustomStage implementation of gradients;
remove old implementation, including enums & state on various structs.
http://codereview.appspot.com/6245078/
git-svn-id: http://skia.googlecode.com/svn/trunk@4129 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/effects/GrGradientEffects.cpp b/src/gpu/effects/GrGradientEffects.cpp
index b1bf82f..000e0e5 100644
--- a/src/gpu/effects/GrGradientEffects.cpp
+++ b/src/gpu/effects/GrGradientEffects.cpp
@@ -212,7 +212,7 @@
// If we aren't degenerate, emit some extra code, and accept a slightly
// more complex coord.
- if (fIsDegenerate) {
+ if (!fIsDegenerate) {
// ac4 = 4.0 * params[0] * c
code->appendf("\tfloat %s = %s * 4.0 * %s;\n",
diff --git a/src/gpu/effects/GrGradientEffects.h b/src/gpu/effects/GrGradientEffects.h
index 8d67c25..9bcf9dd 100644
--- a/src/gpu/effects/GrGradientEffects.h
+++ b/src/gpu/effects/GrGradientEffects.h
@@ -12,6 +12,29 @@
#include "GrTypes.h"
#include "GrScalar.h"
+/*
+ * The intepretation of the texture matrix depends on the sample mode. The
+ * texture matrix is applied both when the texture coordinates are explicit
+ * and when vertex positions are used as texture coordinates. In the latter
+ * case the texture matrix is applied to the pre-view-matrix position
+ * values.
+ *
+ * Normal SampleMode
+ * The post-matrix texture coordinates are in normalize space with (0,0) at
+ * the top-left and (1,1) at the bottom right.
+ * RadialGradient
+ * The matrix specifies the radial gradient parameters.
+ * (0,0) in the post-matrix space is center of the radial gradient.
+ * Radial2Gradient
+ * Matrix transforms to space where first circle is centered at the
+ * origin. The second circle will be centered (x, 0) where x may be
+ * 0 and is provided by setRadial2Params. The post-matrix space is
+ * normalized such that 1 is the second radius - first radius.
+ * SweepGradient
+ * The angle from the origin of texture coordinates in post-matrix space
+ * determines the gradient value.
+ */
+
class GrGLRadialGradient;
class GrRadialGradient : public GrCustomStage {