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

Unified Diff: src/effects/SkColorFilters.cpp

Issue 1251173002: Added GrGLFragmentProcessor::EmitArgs struct for use with emitCode() (Closed) Base URL: https://skia.googlesource.com/skia@composeshader_gpu
Patch Set: Created 5 years, 5 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/effects/SkColorCubeFilter.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorFilters.cpp
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 92fe4d708ec9a98ce28a6fa9710f5925bc087216..13ef7c6dfd9e5c5a79e179c85afe4e1250ea659a 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -166,18 +166,14 @@ public:
GLProcessor(const GrProcessor&) {
}
- virtual void emitCode(GrGLFPBuilder* builder,
- const GrFragmentProcessor& fp,
- const char* outputColor,
- const char* inputColor,
- const TransformedCoordsArray&,
- const TextureSamplerArray&) override {
- SkXfermode::Mode mode = fp.cast<ModeColorFilterEffect>().mode();
+ virtual void emitCode(EmitArgs& args) override {
+ SkXfermode::Mode mode = args.fFp.cast<ModeColorFilterEffect>().mode();
SkASSERT(SkXfermode::kDst_Mode != mode);
const char* colorFilterColorUniName = NULL;
- if (fp.cast<ModeColorFilterEffect>().willUseFilterColor()) {
- fFilterColorUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ if (args.fFp.cast<ModeColorFilterEffect>().willUseFilterColor()) {
+ fFilterColorUni = args.fBuilder->addUniform(
+ GrGLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"FilterColor",
&colorFilterColorUniName);
@@ -185,10 +181,10 @@ public:
GrGLSLExpr4 filter =
color_filter_expression(mode, GrGLSLExpr4(colorFilterColorUniName),
- GrGLSLExpr4(inputColor));
+ GrGLSLExpr4(args.fInputColor));
- builder->getFragmentShaderBuilder()->
- codeAppendf("\t%s = %s;\n", outputColor, filter.c_str());
+ args.fBuilder->getFragmentShaderBuilder()->
+ codeAppendf("\t%s = %s;\n", args.fOutputColor, filter.c_str());
}
static void GenKey(const GrProcessor& fp, const GrGLSLCaps&,
« no previous file with comments | « src/effects/SkColorCubeFilter.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698