aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-06-18 23:35:57 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-19 14:01:56 +0000
commit0bdaf05fc17ebe5d4ad01d70c80df2425e83c737 (patch)
treee52b6e3c92b94cc6b8ab33f7fe47906106a38c38 /include
parentce6b4b004b2842e61cd9f86ebb75d1872044b382 (diff)
remove unused mode parameter from SkMergeImageFilter
Bug: skia: Change-Id: Iaa46aaef130a337987c3528685f59c56387d4a7d Reviewed-on: https://skia-review.googlesource.com/20210 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/core/SkPicture.h3
-rw-r--r--include/effects/SkMergeImageFilter.h32
2 files changed, 18 insertions, 17 deletions
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index f90e17af3e..e1d8bbab2c 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -202,10 +202,11 @@ private:
// V52: Remove SkTextBlob::fRunCount
// V53: SaveLayerRec clip mask
// V54: ComposeShader can use a Mode or a Lerp
+ // V55: Drop blendmode[] from MergeImageFilter
// Only SKPs within the min/current picture version range (inclusive) can be read.
static const uint32_t MIN_PICTURE_VERSION = 51; // Produced by Chrome ~M56.
- static const uint32_t CURRENT_PICTURE_VERSION = 54;
+ static const uint32_t CURRENT_PICTURE_VERSION = 55;
static bool IsValidPictInfo(const SkPictInfo& info);
static sk_sp<SkPicture> Forwardport(const SkPictInfo&,
diff --git a/include/effects/SkMergeImageFilter.h b/include/effects/SkMergeImageFilter.h
index 03f0cea4e0..679336103f 100644
--- a/include/effects/SkMergeImageFilter.h
+++ b/include/effects/SkMergeImageFilter.h
@@ -8,17 +8,27 @@
#ifndef SkMergeImageFilter_DEFINED
#define SkMergeImageFilter_DEFINED
-#include "SkBlendMode.h"
#include "SkImageFilter.h"
class SK_API SkMergeImageFilter : public SkImageFilter {
public:
- ~SkMergeImageFilter() override;
+ static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter>* const filters, int count,
+ const CropRect* cropRect = nullptr);
static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter> first, sk_sp<SkImageFilter> second,
- SkBlendMode, const CropRect* cropRect = nullptr);
- static sk_sp<SkImageFilter> MakeN(sk_sp<SkImageFilter>[], int count, const SkBlendMode[],
- const CropRect* cropRect = nullptr);
+ const CropRect* cropRect = nullptr) {
+ sk_sp<SkImageFilter> array[] = {
+ std::move(first),
+ std::move(second),
+ };
+ return Make(array, 2, cropRect);
+ }
+
+ // Change caller in chrome to use Make(...) instead
+ static sk_sp<SkImageFilter> MakeN(sk_sp<SkImageFilter> array[], int count, std::nullptr_t,
+ const CropRect* cropRect = nullptr) {
+ return Make(array, count, cropRect);
+ }
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMergeImageFilter)
@@ -31,17 +41,7 @@ protected:
bool onCanHandleComplexCTM() const override { return true; }
private:
- SkMergeImageFilter(sk_sp<SkImageFilter> filters[], int count, const SkBlendMode modes[],
- const CropRect* cropRect);
-
- uint8_t* fModes; // SkBlendMode
-
- // private storage, to avoid dynamically allocating storage for our copy
- // of the modes (unless the count is so large we can't fit).
- intptr_t fStorage[16];
-
- void initAllocModes();
- void initModes(const SkBlendMode[]);
+ SkMergeImageFilter(sk_sp<SkImageFilter>* const filters, int count, const CropRect* cropRect);
typedef SkImageFilter INHERITED;
};