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

Unified Diff: src/effects/SkArithmeticMode_gpu.cpp

Issue 1666773002: Clean up GrGLSLFragmentProcessor-derived classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkBlurMaskFilter.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 29c6602146db3c1504418923e419f1d45aba9991..709f59d3d68b05255ed6870e077e348d68f186a1 100644
--- a/src/effects/SkArithmeticMode_gpu.cpp
+++ b/src/effects/SkArithmeticMode_gpu.cpp
@@ -55,12 +55,9 @@ static void add_arithmetic_code(GrGLSLFragmentBuilder* fragBuilder,
class GLArithmeticFP : public GrGLSLFragmentProcessor {
public:
- GLArithmeticFP(const GrArithmeticFP& arithmeticFP)
- : fEnforcePMColor(arithmeticFP.enforcePMColor()) {}
-
- ~GLArithmeticFP() override {}
-
void emitCode(EmitArgs& args) override {
+ const GrArithmeticFP& arith = args.fFp.cast<GrArithmeticFP>();
+
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
SkString dstColor("dstColor");
this->emitChild(0, nullptr, &dstColor, args);
@@ -75,7 +72,7 @@ public:
dstColor.c_str(),
args.fOutputColor,
kUni,
- fEnforcePMColor);
+ arith.enforcePMColor());
}
static void GenKey(const GrProcessor& proc, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) {
@@ -88,12 +85,10 @@ protected:
void onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor& proc) override {
const GrArithmeticFP& arith = proc.cast<GrArithmeticFP>();
pdman.set4f(fKUni, arith.k1(), arith.k2(), arith.k3(), arith.k4());
- fEnforcePMColor = arith.enforcePMColor();
}
private:
GrGLSLProgramDataManager::UniformHandle fKUni;
- bool fEnforcePMColor;
typedef GrGLSLFragmentProcessor INHERITED;
};
@@ -115,7 +110,7 @@ void GrArithmeticFP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKe
}
GrGLSLFragmentProcessor* GrArithmeticFP::onCreateGLSLInstance() const {
- return new GLArithmeticFP(*this);
+ return new GLArithmeticFP;
}
bool GrArithmeticFP::onIsEqual(const GrFragmentProcessor& fpBase) const {
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698