From 0530c88067211818f7ce7bbfc0e92f3bdebc1f2b Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Mon, 26 Sep 2016 15:33:00 -0400 Subject: replace Arithmetic xfermode with imagefilter chrome pre-cl: https://codereview.chromium.org/2369023002/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2595 Change-Id: Ia3f3b721854c516f3b7f8c44f71f40a8a2eeb9b4 Reviewed-on: https://skia-review.googlesource.com/2595 Commit-Queue: Mike Reed Reviewed-by: Florin Malita Reviewed-by: Robert Phillips --- include/effects/SkArithmeticMode.h | 4 ++++ include/effects/SkXfermodeImageFilter.h | 12 ++++++++++++ 2 files changed, 16 insertions(+) (limited to 'include') diff --git a/include/effects/SkArithmeticMode.h b/include/effects/SkArithmeticMode.h index b160dc7e9b..81b9f85394 100644 --- a/include/effects/SkArithmeticMode.h +++ b/include/effects/SkArithmeticMode.h @@ -12,6 +12,8 @@ #include "SkScalar.h" #include "SkXfermode.h" +#ifdef SK_SUPPORT_LEGACY_ARITHMETICMODE + class SK_API SkArithmeticMode { public: /** @@ -38,3 +40,5 @@ private: }; #endif + +#endif diff --git a/include/effects/SkXfermodeImageFilter.h b/include/effects/SkXfermodeImageFilter.h index e39157550c..6066b8d2e0 100644 --- a/include/effects/SkXfermodeImageFilter.h +++ b/include/effects/SkXfermodeImageFilter.h @@ -26,6 +26,18 @@ public: return Make(std::move(mode), std::move(background), nullptr, nullptr); } + static sk_sp MakeArithmetic(float k1, float k2, float k3, float k4, + bool enforcePMColor, + sk_sp background, + sk_sp foreground, + const SkImageFilter::CropRect* cropRect); + static sk_sp MakeArithmetic(float k1, float k2, float k3, float k4, + bool enforcePMColor, + sk_sp background) { + return MakeArithmetic(k1, k2, k3, k4, enforcePMColor, std::move(background), + nullptr, nullptr); + } + #ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR static SkImageFilter* Create(SkXfermode* mode, SkImageFilter* background, SkImageFilter* foreground = NULL, -- cgit v1.2.3