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

Unified Diff: tools/Resources.cpp

Issue 2339273002: SkFontData to use smart pointers. (Closed)
Patch Set: Add trivial bodies to the trivial implementations. 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 899f5d2bc4332321941777bdf43f2fc1e3888851..9c12a67c20a3250c0b9c99cd1b46918e7427596b 100644
--- a/tools/Resources.cpp
+++ b/tools/Resources.cpp
@@ -41,12 +41,11 @@ sk_sp<SkImage> GetResourceAsImage(const char* resource) {
SkStreamAsset* GetResourceAsStream(const char* resource) {
SkString resourcePath = GetResourcePath(resource);
SkAutoTDelete<SkFILEStream> stream(new SkFILEStream(resourcePath.c_str()));
- if (stream->isValid()) {
- return stream.release();
- } else {
+ if (!stream->isValid()) {
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