Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: src/gpu/effects/GrOvalEffect.cpp

Issue 354663002: Make GrGLShaderBuilder::fragmentPosition() return a vec4, with 1.0 as the zw components when in the… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: line wraps Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/effects/GrDitherEffect.cpp ('k') | src/gpu/effects/GrRRectEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « src/gpu/effects/GrDitherEffect.cpp ('k') | src/gpu/effects/GrRRectEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698