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

Unified Diff: tools/Resources.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage 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 | « tools/Resources.h ('k') | tools/VisualBench/WrappedBenchmark.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/Resources.cpp
diff --git a/tools/Resources.cpp b/tools/Resources.cpp
index ecbf88c17ae924eefe9b67ecc164c06ae7680c44..0117404ac27fda9c7933a085ad405fe8e99ed6fe 100644
--- a/tools/Resources.cpp
+++ b/tools/Resources.cpp
@@ -32,10 +32,10 @@ bool GetResourceAsBitmap(const char* resource, SkBitmap* dst) {
return gen && gen->tryGenerateBitmap(dst);
}
-SkImage* GetResourceAsImage(const char* resource) {
+sk_sp<SkImage> GetResourceAsImage(const char* resource) {
SkString path = GetResourcePath(resource);
- SkAutoTUnref<SkData> resourceData(SkData::NewFromFileName(path.c_str()));
- return SkImage::NewFromEncoded(resourceData);
+ sk_sp<SkData> resourceData(SkData::NewFromFileName(path.c_str()));
+ return SkImage::MakeFromEncoded(resourceData);
}
SkStreamAsset* GetResourceAsStream(const char* resource) {
« no previous file with comments | « tools/Resources.h ('k') | tools/VisualBench/WrappedBenchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698