Chromium Code Reviews| Index: src/core/SkBitmapDevice.cpp |
| diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp |
| index d5dfcc1733abbc9066441ead5dfd7f1602f255e6..739dc756ce8165bbce49b525b792ebf7aec2fc14 100644 |
| --- a/src/core/SkBitmapDevice.cpp |
| +++ b/src/core/SkBitmapDevice.cpp |
| @@ -314,17 +314,15 @@ void SkBitmapDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, |
| } |
| // construct a shader, so we can call drawRect with the dst |
| - SkShader* s = SkShader::CreateBitmapShader(*bitmapPtr, |
| - SkShader::kClamp_TileMode, |
| - SkShader::kClamp_TileMode, |
| - &matrix); |
| - if (nullptr == s) { |
| + auto s = SkShader::MakeBitmapShader(*bitmapPtr, SkShader::kClamp_TileMode, |
| + SkShader::kClamp_TileMode, &matrix); |
| + if (!s) { |
| return; |
| } |
| SkPaint paintWithShader(paint); |
| paintWithShader.setStyle(SkPaint::kFill_Style); |
| - paintWithShader.setShader(s)->unref(); |
| + paintWithShader.setShader(s); |
|
f(malita)
2016/03/08 15:50:35
setShader(std::move(s))
reed1
2016/03/08 20:17:15
Done.
|
| // Call ourself, in case the subclass wanted to share this setup code |
| // but handle the drawRect code themselves. |