Introduce new factory for SkColorFilters
Idea: transition callers to this, so we can later typedef SkColorFilter
and SkShader to the same thing.
Bug: skia:8937
Change-Id: I000c882e11622091aa44c141aa6ddd1216414f46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206685
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/gm/colorfilterimagefilter.cpp b/gm/colorfilterimagefilter.cpp
index 0559715..17be1b4 100644
--- a/gm/colorfilterimagefilter.cpp
+++ b/gm/colorfilterimagefilter.cpp
@@ -27,7 +27,7 @@
0, 1, 0, 0, amount255,
0, 0, 1, 0, amount255,
0, 0, 0, 1, 0 };
- return SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
+ return SkColorFilters::MatrixRowMajor255(matrix);
}
static sk_sp<SkColorFilter> cf_make_grayscale() {
@@ -37,11 +37,11 @@
matrix[1] = matrix[6] = matrix[11] = 0.7152f;
matrix[2] = matrix[7] = matrix[12] = 0.0722f;
matrix[18] = 1.0f;
- return SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
+ return SkColorFilters::MatrixRowMajor255(matrix);
}
static sk_sp<SkColorFilter> cf_make_colorize(SkColor color) {
- return SkColorFilter::MakeModeFilter(color, SkBlendMode::kSrc);
+ return SkColorFilters::Blend(color, SkBlendMode::kSrc);
}
static void sk_gm_get_colorfilters(SkTArray<sk_sp<SkColorFilter>>* array) {
@@ -179,7 +179,7 @@
SkAutoCanvasRestore autoCanvasRestore(canvas, false);
SkColorMatrix cm;
cm.setSaturation(0.0f);
- sk_sp<SkColorFilter> cf(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat));
+ sk_sp<SkColorFilter> cf(SkColorFilters::MatrixRowMajor255(cm.fMat));
SkPaint p;
p.setImageFilter(SkColorFilterImageFilter::Make(std::move(cf), nullptr));
canvas->saveLayer(nullptr, &p);