OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |