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

Unified Diff: src/core/SkBitmapProcShader.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/core/SkBitmapProcShader.h ('k') | src/core/SkBlitter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcShader.cpp
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index f26194280c579cfe4a34f2c16f1564e171359562..4813e01d543200f692bf9721d4237b84f24acb85 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -289,7 +289,7 @@ SkFlattenable* SkBitmapProcShader::CreateProc(SkReadBuffer& buffer) {
bm.setImmutable();
TileMode mx = (TileMode)buffer.readUInt();
TileMode my = (TileMode)buffer.readUInt();
- return SkShader::CreateBitmapShader(bm, mx, my, &lm);
+ return SkShader::MakeBitmapShader(bm, mx, my, &lm).release();
}
void SkBitmapProcShader::flatten(SkWriteBuffer& buffer) const {
@@ -352,9 +352,9 @@ static bool bitmap_is_too_big(const SkBitmap& bm) {
return bm.width() > kMaxSize || bm.height() > kMaxSize;
}
-SkShader* SkCreateBitmapShader(const SkBitmap& src, SkShader::TileMode tmx,
- SkShader::TileMode tmy, const SkMatrix* localMatrix,
- SkTBlitterAllocator* allocator) {
+sk_sp<SkShader> SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode tmx,
+ SkShader::TileMode tmy, const SkMatrix* localMatrix,
+ SkTBlitterAllocator* allocator) {
SkShader* shader;
SkColor color;
if (src.isNull() || bitmap_is_too_big(src)) {
@@ -376,7 +376,7 @@ SkShader* SkCreateBitmapShader(const SkBitmap& src, SkShader::TileMode tmx,
shader = allocator->createT<SkBitmapProcShader>(src, tmx, tmy, localMatrix);
}
}
- return shader;
+ return sk_sp<SkShader>(shader);
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/core/SkBitmapProcShader.h ('k') | src/core/SkBlitter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698