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

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

Issue 1457543003: Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrCustomXfermode.cpp
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 1bfc0b77159e3ebcf35b436397998e190e178a3d..6b3a20ec2d6e1d108989a9c0d566da00fc01c1c1 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -146,26 +146,29 @@ private:
const CustomXP& xp = args.fXP.cast<CustomXP>();
SkASSERT(xp.hasHWBlendEquation());
- GrGLSLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
- fsBuilder->enableAdvancedBlendEquationIfNeeded(xp.hwBlendEquation());
+ GrGLSLXPFragmentBuilder* fragBuilder = args.fXPFragBuilder;
+ fragBuilder->enableAdvancedBlendEquationIfNeeded(xp.hwBlendEquation());
// Apply coverage by multiplying it into the src color before blending. Mixed samples will
// "just work" automatically. (See onGetOptimizations())
if (xp.readsCoverage()) {
- fsBuilder->codeAppendf("%s = %s * %s;",
- args.fOutputPrimary, args.fInputCoverage, args.fInputColor);
+ fragBuilder->codeAppendf("%s = %s * %s;",
+ args.fOutputPrimary, args.fInputCoverage, args.fInputColor);
} else {
- fsBuilder->codeAppendf("%s = %s;", args.fOutputPrimary, args.fInputColor);
+ fragBuilder->codeAppendf("%s = %s;", args.fOutputPrimary, args.fInputColor);
}
}
- void emitBlendCodeForDstRead(GrGLSLXPBuilder* pb, const char* srcColor, const char* dstColor,
- const char* outColor, const GrXferProcessor& proc) override {
+ void emitBlendCodeForDstRead(GrGLSLXPBuilder* pb,
+ GrGLSLXPFragmentBuilder* fragBuilder,
+ const char* srcColor,
+ const char* dstColor,
+ const char* outColor,
+ const GrXferProcessor& proc) override {
const CustomXP& xp = proc.cast<CustomXP>();
SkASSERT(!xp.hasHWBlendEquation());
- GrGLSLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
- GrGLSLBlend::AppendMode(fsBuilder, srcColor, dstColor, outColor, xp.mode());
+ GrGLSLBlend::AppendMode(fragBuilder, srcColor, dstColor, outColor, xp.mode());
}
void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) override {}
« no previous file with comments | « src/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698