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

Unified Diff: src/effects/gradients/SkSweepGradient.cpp

Issue 1416423003: Make GrGLSLProgramBuilder base class for ProgramBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 5 years, 1 month 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/effects/gradients/SkGradientShaderPriv.h ('k') | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkSweepGradient.cpp
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 35d2f746201f2c1e0ba95b394b3e79b3db8c5950..172c7d152ab1bf3b6600a94ae35647ecd7198157 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -250,16 +250,15 @@ void GrGLSweepGradient::emitCode(EmitArgs& args) {
this->emitUniforms(args.fBuilder, ge);
SkString coords2D = args.fBuilder->getFragmentShaderBuilder()
->ensureFSCoords2D(args.fCoords, 0);
- const GrGLContextInfo& ctxInfo = args.fBuilder->ctxInfo();
SkString t;
// 0.1591549430918 is 1/(2*pi), used since atan returns values [-pi, pi]
// On Intel GPU there is an issue where it reads the second arguement to atan "- %s.x" as an int
// thus must us -1.0 * %s.x to work correctly
- if (kIntel_GrGLVendor != ctxInfo.vendor()){
- t.printf("atan(- %s.y, - %s.x) * 0.1591549430918 + 0.5",
+ if (args.fBuilder->glslCaps()->mustForceNegatedAtanParamToFloat()){
+ t.printf("atan(- %s.y, -1.0 * %s.x) * 0.1591549430918 + 0.5",
coords2D.c_str(), coords2D.c_str());
} else {
- t.printf("atan(- %s.y, -1.0 * %s.x) * 0.1591549430918 + 0.5",
+ t.printf("atan(- %s.y, - %s.x) * 0.1591549430918 + 0.5",
coords2D.c_str(), coords2D.c_str());
}
this->emitColor(args.fBuilder, ge, t.c_str(), args.fOutputColor, args.fInputColor,
« no previous file with comments | « src/effects/gradients/SkGradientShaderPriv.h ('k') | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698