diff options
Diffstat (limited to 'src/core/SkBitmapDevice.cpp')
-rw-r--r-- | src/core/SkBitmapDevice.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index d5dfcc1733..fc0e63e9ae 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(std::move(s)); // Call ourself, in case the subclass wanted to share this setup code // but handle the drawRect code themselves. |