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

Unified Diff: src/effects/SkArithmeticMode_gpu.cpp

Issue 1170553002: Apply coverage in XP base class when using dst reads (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_reenablebea
Patch Set: names Created 5 years, 6 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/GrXferProcessor.h ('k') | src/gpu/GrXferProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkArithmeticMode_gpu.cpp
diff --git a/src/effects/SkArithmeticMode_gpu.cpp b/src/effects/SkArithmeticMode_gpu.cpp
index d0dd98b3657e01c20919e573765a19c6e314c4e3..0d81c7966ce91fd3b3cf8953b90576271573f5d5 100644
--- a/src/effects/SkArithmeticMode_gpu.cpp
+++ b/src/effects/SkArithmeticMode_gpu.cpp
@@ -172,8 +172,6 @@ public:
GrGLXferProcessor* createGLInstance() const override;
- bool hasSecondaryOutput() const override { return false; }
-
float k1() const { return fK1; }
float k2() const { return fK2; }
float k3() const { return fK3; }
@@ -228,22 +226,16 @@ public:
}
private:
- void onEmitCode(const EmitArgs& args) override {
- GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
-
- const char* dstColor = fsBuilder->dstColor();
-
- fKUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kVec4f_GrSLType, kDefault_GrSLPrecision,
- "k");
- const char* kUni = args.fPB->getUniformCStr(fKUni);
+ void emitBlendCodeForDstRead(GrGLXPBuilder* pb, const char* srcColor, const char* dstColor,
+ const char* outColor, const GrXferProcessor& proc) override {
+ GrGLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
- add_arithmetic_code(fsBuilder, args.fInputColor, dstColor, args.fOutputPrimary, kUni,
- fEnforcePMColor);
+ fKUni = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ kVec4f_GrSLType, kDefault_GrSLPrecision,
+ "k");
+ const char* kUni = pb->getUniformCStr(fKUni);
- fsBuilder->codeAppendf("%s = %s * %s + (vec4(1.0) - %s) * %s;",
- args.fOutputPrimary, args.fOutputPrimary, args.fInputCoverage,
- args.fInputCoverage, dstColor);
+ add_arithmetic_code(fsBuilder, srcColor, dstColor, outColor, kUni, fEnforcePMColor);
}
void onSetData(const GrGLProgramDataManager& pdman,
« no previous file with comments | « include/gpu/GrXferProcessor.h ('k') | src/gpu/GrXferProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698