Move image sampling options into their own header
Experimenting with a single struct for everything, to simplify the
number of API changes/additions needed.
e.g. makeShader(...)
Idea is to use SkSampleOptions to augment drawBitmap calls, so we can
remove SkFilterQuality enum from SkPaint.
Change-Id: I9045ff483f58af29148d7dc21d30b294c4a718a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332739
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/samplecode/SampleXfer.cpp b/samplecode/SampleXfer.cpp
index c005bd7..8a2c66b 100644
--- a/samplecode/SampleXfer.cpp
+++ b/samplecode/SampleXfer.cpp
@@ -206,7 +206,7 @@
sk_sp<SkImage> fImage;
SkRect fBounds;
- void draw(SkCanvas* canvas, SkImage::CubicResampler cubic) const {
+ void draw(SkCanvas* canvas, SkCubicResampler cubic) const {
SkRect r = fBounds;
SkPaint paint;
@@ -219,7 +219,8 @@
lm.postTranslate(r.width() + 10, 0);
paint.setShader(fImage->makeShader(SkTileMode::kClamp, SkTileMode::kClamp,
- {SkSamplingMode::kLinear, SkMipmapMode::kNone},
+ SkFilterOptions{ SkSamplingMode::kLinear,
+ SkMipmapMode::kNone },
&lm));
canvas->drawRect(r, paint);