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

Unified Diff: gm/mixedtextblobs.cpp

Issue 1120823002: Move resource fonts to common location. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove now unused variable. Created 5 years, 8 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 | « gm/dftext.cpp ('k') | gyp/ports.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/mixedtextblobs.cpp
diff --git a/gm/mixedtextblobs.cpp b/gm/mixedtextblobs.cpp
index 20b91accfd594b8c6589647900d69c098859097a..fb1b632fb9f9dc79e708c8d1d2d08ae31ec78941 100644
--- a/gm/mixedtextblobs.cpp
+++ b/gm/mixedtextblobs.cpp
@@ -39,29 +39,15 @@ public:
protected:
void onOnceBeforeDraw() override {
- SkAutoTDelete<SkFILEStream> stream;
- SkString filename;
#ifndef SK_BUILD_FOR_MAC
- filename = GetResourcePath("/Funkster.ttf");
- stream.reset(new SkFILEStream(filename.c_str()));
- if (stream->isValid()) {
- fEmojiTypeface.reset(SkTypeface::CreateFromStream(stream.detach()));
- } else {
- SkDebugf("Could not find Funkster.ttf, please set --resourcePath correctly.\n");
- }
+ fEmojiTypeface.reset(GetResourceAsTypeface("/fonts/Funkster.ttf"));
fEmojiText = "Emoji!!!";
#else
fEmojiTypeface.reset(SkTypeface::CreateFromName("Apple Color Emoji", SkTypeface::kNormal));
fEmojiText = "\xF0\x9F\x92\xB0" "\xF0\x9F\x8F\xA1" "\xF0\x9F\x8E\x85" // 💰🏡🎅
"\xF0\x9F\x8D\xAA" "\xF0\x9F\x8D\x95" "\xF0\x9F\x9A\x80"; // 🍪🍕🚀
#endif
-
- filename = GetResourcePath("/ReallyBigA.ttf");
-
- stream.reset(new SkFILEStream(filename.c_str()));
- if (stream->isValid()) {
- fReallyBigATypeface.reset(SkTypeface::CreateFromStream(stream.detach()));
- }
+ fReallyBigATypeface.reset(GetResourceAsTypeface("/fonts/ReallyBigA.ttf"));
SkTextBlobBuilder builder;
« no previous file with comments | « gm/dftext.cpp ('k') | gyp/ports.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698