diff options
author | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-01 20:42:15 +0000 |
---|---|---|
committer | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-01 20:42:15 +0000 |
commit | 898e7b568f535fc62a92acda3c22a68cb6e04dcc (patch) | |
tree | 4ca79b0ba7f0fb717d2079797bc9a5bc8f25e8f7 /src/gpu/effects | |
parent | 0bdbed380218af581595a81aca728841aef27c42 (diff) |
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
Diffstat (limited to 'src/gpu/effects')
-rw-r--r-- | src/gpu/effects/GrGradientEffects.cpp | 2 | ||||
-rw-r--r-- | src/gpu/effects/GrGradientEffects.h | 23 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/gpu/effects/GrGradientEffects.cpp b/src/gpu/effects/GrGradientEffects.cpp index b1bf82fb83..000e0e5c59 100644 --- a/src/gpu/effects/GrGradientEffects.cpp +++ b/src/gpu/effects/GrGradientEffects.cpp @@ -212,7 +212,7 @@ void GrGLRadial2Gradient::emitFS(GrGLShaderBuilder* state, // 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 8d67c25268..9bcf9dd772 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 { |