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

Unified Diff: src/effects/SkArithmeticMode.cpp

Issue 1674673002: Alter SkXfermode's asFragmentProcessor & asXPFactory contracts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix unit test bug Created 4 years, 10 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/core/SkXfermode_proccoeff.h ('k') | src/effects/SkAvoidXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkArithmeticMode.cpp
diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp
index ff062c39665440580436e1cb38ad3983d4fd4a91..3af550bac12c164016bdaad3b2e38b7cf3e5d402 100644
--- a/src/effects/SkArithmeticMode.cpp
+++ b/src/effects/SkArithmeticMode.cpp
@@ -39,10 +39,9 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkArithmeticMode_scalar)
#if SK_SUPPORT_GPU
- bool asFragmentProcessor(const GrFragmentProcessor**,
- const GrFragmentProcessor* dst) const override;
-
- bool asXPFactory(GrXPFactory**) const override;
+ const GrFragmentProcessor* getFragmentProcessorForImageFilter(
+ const GrFragmentProcessor* dst) const override;
+ GrXPFactory* asXPFactory() const override;
#endif
private:
@@ -244,28 +243,22 @@ SkXfermode* SkArithmeticMode::Create(SkScalar k1, SkScalar k2,
//////////////////////////////////////////////////////////////////////////////
#if SK_SUPPORT_GPU
-bool SkArithmeticMode_scalar::asFragmentProcessor(const GrFragmentProcessor** fp,
- const GrFragmentProcessor* dst) const {
- if (fp) {
- *fp = GrArithmeticFP::Create(SkScalarToFloat(fK[0]),
- SkScalarToFloat(fK[1]),
- SkScalarToFloat(fK[2]),
- SkScalarToFloat(fK[3]),
- fEnforcePMColor,
- dst);
- }
- return true;
+const GrFragmentProcessor* SkArithmeticMode_scalar::getFragmentProcessorForImageFilter(
+ const GrFragmentProcessor* dst) const {
+ return GrArithmeticFP::Create(SkScalarToFloat(fK[0]),
+ SkScalarToFloat(fK[1]),
+ SkScalarToFloat(fK[2]),
+ SkScalarToFloat(fK[3]),
+ fEnforcePMColor,
+ dst);
}
-bool SkArithmeticMode_scalar::asXPFactory(GrXPFactory** xpf) const {
- if (xpf) {
- *xpf = GrArithmeticXPFactory::Create(SkScalarToFloat(fK[0]),
- SkScalarToFloat(fK[1]),
- SkScalarToFloat(fK[2]),
- SkScalarToFloat(fK[3]),
- fEnforcePMColor);
- }
- return true;
+GrXPFactory* SkArithmeticMode_scalar::asXPFactory() const {
+ return GrArithmeticXPFactory::Create(SkScalarToFloat(fK[0]),
+ SkScalarToFloat(fK[1]),
+ SkScalarToFloat(fK[2]),
+ SkScalarToFloat(fK[3]),
+ fEnforcePMColor);
}
#endif
« no previous file with comments | « src/core/SkXfermode_proccoeff.h ('k') | src/effects/SkAvoidXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698