Index: src/gpu/effects/GrOvalEffect.cpp |
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp |
index 1297331d78114616371e066ee2d321d77fb2fc50..f2ee27880f58411361b23f153bba515ae7daadc7 100644 |
--- a/src/gpu/effects/GrOvalEffect.cpp |
+++ b/src/gpu/effects/GrOvalEffect.cpp |
@@ -147,10 +147,10 @@ void GLCircleEffect::emitCode(GrGLShaderBuilder* builder, |
SkASSERT(kHairlineAA_GrEffectEdgeType != ce.getEdgeType()); |
if (GrEffectEdgeTypeIsInverseFill(ce.getEdgeType())) { |
- builder->fsCodeAppendf("\t\tfloat d = length(%s.xy - %s) - %s.z;\n", |
+ builder->fsCodeAppendf("\t\tfloat d = length(%s.xy - %s.xy) - %s.z;\n", |
circleName, fragmentPos, circleName); |
} else { |
- builder->fsCodeAppendf("\t\tfloat d = %s.z - length(%s - %s.xy);\n", |
+ builder->fsCodeAppendf("\t\tfloat d = %s.z - length(%s.xy - %s.xy);\n", |
circleName, fragmentPos, circleName); |
} |
if (GrEffectEdgeTypeIsAA(ce.getEdgeType())) { |
@@ -318,7 +318,7 @@ void GLEllipseEffect::emitCode(GrGLShaderBuilder* builder, |
const char* fragmentPos = builder->fragmentPosition(); |
// d is the offset to the ellipse center |
- builder->fsCodeAppendf("\t\tvec2 d = %s - %s.xy;\n", fragmentPos, ellipseName); |
+ builder->fsCodeAppendf("\t\tvec2 d = %s.xy - %s.xy;\n", fragmentPos, ellipseName); |
builder->fsCodeAppendf("\t\tvec2 Z = d * %s.zw;\n", ellipseName); |
// implicit is the evaluation of (x/rx)^2 + (y/ry)^2 - 1. |
builder->fsCodeAppend("\t\tfloat implicit = dot(Z, d) - 1.0;\n"); |