aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-04-28 11:12:19 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-28 15:36:14 +0000
commit0acd7954a9e654d7e9c11a532eeeeb2f18a76152 (patch)
treef3f7265224b2b0d6e8e057e367851d86234bd5e7 /samplecode
parentb6069dfba7b7ab563a3fccb2f38307e47035300c (diff)
add helper makeShader for the common Clamp case
Bug: skia: Change-Id: I22cac56f35fed16daede0cf1b3e34dfa6f5ae3ea Reviewed-on: https://skia-review.googlesource.com/14625 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleFilterQuality.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/samplecode/SampleFilterQuality.cpp b/samplecode/SampleFilterQuality.cpp
index 2c3eb4c11e..78aa20e1bc 100644
--- a/samplecode/SampleFilterQuality.cpp
+++ b/samplecode/SampleFilterQuality.cpp
@@ -29,10 +29,7 @@ static sk_sp<SkSurface> make_surface(SkCanvas* canvas, const SkImageInfo& info)
static sk_sp<SkShader> make_shader(const SkRect& bounds) {
sk_sp<SkImage> image(GetResourceAsImage("mandrill_128.png"));
- if (!image) {
- return nullptr;
- }
- return image->makeShader(SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
+ return image ? image->makeShader() : nullptr;
}
#define N 128