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

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

Issue 1341853002: Test that GrFragmentProcessors work without input colors. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update more FPs Created 5 years, 3 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 | « include/gpu/GrProcessorUnitTest.h ('k') | src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConstColorProcessor.cpp
diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/GrConstColorProcessor.cpp
index 95a4081d4f7df2421435f51cf9d362f7e15c07ee..627139fa413d2f717c7e77cb2149f5060b3b0583 100644
--- a/src/gpu/effects/GrConstColorProcessor.cpp
+++ b/src/gpu/effects/GrConstColorProcessor.cpp
@@ -19,7 +19,11 @@ public:
fColorUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kMedium_GrSLPrecision, "constantColor",
&colorUni);
- switch (args.fFp.cast<GrConstColorProcessor>().inputMode()) {
+ GrConstColorProcessor::InputMode mode = args.fFp.cast<GrConstColorProcessor>().inputMode();
+ if (!args.fInputColor) {
+ mode = GrConstColorProcessor::kIgnore_InputMode;
+ }
+ switch (mode) {
case GrConstColorProcessor::kIgnore_InputMode:
fsBuilder->codeAppendf("%s = %s;", args.fOutputColor, colorUni);
break;
« no previous file with comments | « include/gpu/GrProcessorUnitTest.h ('k') | src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698