diff options
| author | reed <reed@google.com> | 2016-03-08 18:50:00 -0800 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2016-03-08 18:50:00 -0800 |
| commit | 8a21c9fe7f5fef9e87115defef27bd7218419f28 (patch) | |
| tree | 1dd8b9eda9eae99b33bc88b97bd5f0a7a0769dc3 /samplecode/SampleTinyBitmap.cpp | |
| parent | 042f859c19f71ca9feacddd1cb058ff59eed8963 (diff) | |
use Make instead of Create to return a shared shader
Partially updated call sites. Undefine the flag in SkSHader.h to convert the remaining sites.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1772463002
Review URL: https://codereview.chromium.org/1772463002
Diffstat (limited to 'samplecode/SampleTinyBitmap.cpp')
| -rw-r--r-- | samplecode/SampleTinyBitmap.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/samplecode/SampleTinyBitmap.cpp b/samplecode/SampleTinyBitmap.cpp index 8b1bdf0d18..4fb508b898 100644 --- a/samplecode/SampleTinyBitmap.cpp +++ b/samplecode/SampleTinyBitmap.cpp @@ -1,10 +1,10 @@ - /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ + #include "SampleCode.h" #include "SkColorPriv.h" #include "SkShader.h" @@ -47,8 +47,7 @@ public: } protected: - // overrides from SkEventSink - virtual bool onQuery(SkEvent* evt) { + bool onQuery(SkEvent* evt) override { if (SampleCode::TitleQ(*evt)) { SampleCode::TitleR(evt, "TinyBitmap"); return true; @@ -61,11 +60,10 @@ protected: bm->setAlphaType(isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType); } - virtual void onDrawContent(SkCanvas* canvas) { - SkShader* s = SkShader::CreateBitmapShader(fBM, SkShader::kRepeat_TileMode, - SkShader::kMirror_TileMode); + void onDrawContent(SkCanvas* canvas) override { SkPaint paint; - paint.setShader(s)->unref(); + paint.setShader(SkShader::MakeBitmapShader(fBM, SkShader::kRepeat_TileMode, + SkShader::kMirror_TileMode)); canvas->drawPaint(paint); } |
