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

Unified Diff: tools/Resources.cpp

Issue 2343933002: Revert of SkFontData to use smart pointers. (Closed)
Patch Set: Created 4 years, 3 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 | « tests/YUVTest.cpp ('k') | tools/dump_record.cpp » ('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 9c12a67c20a3250c0b9c99cd1b46918e7427596b..899f5d2bc4332321941777bdf43f2fc1e3888851 100644
--- a/tools/Resources.cpp
+++ b/tools/Resources.cpp
@@ -41,11 +41,12 @@
SkStreamAsset* GetResourceAsStream(const char* resource) {
SkString resourcePath = GetResourcePath(resource);
SkAutoTDelete<SkFILEStream> stream(new SkFILEStream(resourcePath.c_str()));
- if (!stream->isValid()) {
+ if (stream->isValid()) {
+ return stream.release();
+ } else {
SkDebugf("Resource %s not found.\n", resource);
return nullptr;
}
- return stream.release();
}
sk_sp<SkTypeface> MakeResourceAsTypeface(const char* resource) {
« no previous file with comments | « tests/YUVTest.cpp ('k') | tools/dump_record.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698