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

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

Issue 1453623003: Move glsl onto EmitArgs struct for emitCode (Closed) Base URL: https://skia.googlesource.com/skia.git@moveShaders
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/SkRadialGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient_gpu.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 f2f14c4b58d58e2d6ce134dd9d99fdafd3ede9e2..3df7144337502914329ff805b0428ac23cb8f63a 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -253,7 +253,7 @@ void GrGLSweepGradient::emitCode(EmitArgs& args) {
// 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 (args.fBuilder->glslCaps()->mustForceNegatedAtanParamToFloat()){
+ if (args.fGLSLCaps->mustForceNegatedAtanParamToFloat()){
t.printf("atan(- %s.y, -1.0 * %s.x) * 0.1591549430918 + 0.5",
coords2D.c_str(), coords2D.c_str());
} else {
@@ -262,6 +262,7 @@ void GrGLSweepGradient::emitCode(EmitArgs& args) {
}
this->emitColor(args.fBuilder,
args.fFragBuilder,
+ args.fGLSLCaps,
ge, t.c_str(),
args.fOutputColor,
args.fInputColor,
« no previous file with comments | « src/effects/gradients/SkRadialGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698