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

Side by Side Diff: gm/coloremoji.cpp

Issue 351133003: Cleanup usage of GetResourcePath() after commit bcbc1788b478b1e54079318ad073e8490aa66fae. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « gm/cmykjpeg.cpp ('k') | gm/copyTo4444.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 11 matching lines...) Expand all
22 22
23 ~ColorEmojiGM() { 23 ~ColorEmojiGM() {
24 SkSafeUnref(fTypeface); 24 SkSafeUnref(fTypeface);
25 } 25 }
26 protected: 26 protected:
27 virtual uint32_t onGetFlags() const SK_OVERRIDE { 27 virtual uint32_t onGetFlags() const SK_OVERRIDE {
28 return kSkipTiled_Flag; 28 return kSkipTiled_Flag;
29 } 29 }
30 30
31 virtual void onOnceBeforeDraw() SK_OVERRIDE { 31 virtual void onOnceBeforeDraw() SK_OVERRIDE {
32 SkString filename = GetResourcePath(); 32 SkString filename = GetResourcePath("/Funkster.ttf");
33 filename.append("/Funkster.ttf");
34
35 SkAutoTUnref<SkFILEStream> stream(new SkFILEStream(filename.c_str())); 33 SkAutoTUnref<SkFILEStream> stream(new SkFILEStream(filename.c_str()));
36 if (!stream->isValid()) { 34 if (!stream->isValid()) {
37 SkDebugf("Could not find Funkster.ttf, please set --resourcePath cor rectly.\n"); 35 SkDebugf("Could not find Funkster.ttf, please set --resourcePath cor rectly.\n");
38 return; 36 return;
39 } 37 }
40 38
41 fTypeface = SkTypeface::CreateFromStream(stream); 39 fTypeface = SkTypeface::CreateFromStream(stream);
42 } 40 }
43 41
44 virtual SkString onShortName() { 42 virtual SkString onShortName() {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 109
112 typedef GM INHERITED; 110 typedef GM INHERITED;
113 }; 111 };
114 112
115 ////////////////////////////////////////////////////////////////////////////// 113 //////////////////////////////////////////////////////////////////////////////
116 114
117 static GM* MyFactory(void*) { return new ColorEmojiGM; } 115 static GM* MyFactory(void*) { return new ColorEmojiGM; }
118 static GMRegistry reg(MyFactory); 116 static GMRegistry reg(MyFactory);
119 117
120 } 118 }
OLDNEW
« no previous file with comments | « gm/cmykjpeg.cpp ('k') | gm/copyTo4444.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698