Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: src/core/SkBitmapDevice.cpp

Issue 1772463002: use Make instead of Create to return a shared shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/c/sk_surface.cpp ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapDevice.cpp
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index d5dfcc1733abbc9066441ead5dfd7f1602f255e6..fc0e63e9ae0b4ad93ea9806e243e1d6ae6549540 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.
« no previous file with comments | « src/c/sk_surface.cpp ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698