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 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkStream.h" | 10 #include "SkStream.h" |
11 #include "SkTypeface.h" | 11 #include "SkTypeface.h" |
12 | 12 |
13 namespace skiagm { | 13 namespace skiagm { |
14 | 14 |
15 class ColorEmojiGM : public GM { | 15 class ColorEmojiGM : public GM { |
16 public: | 16 public: |
17 ColorEmojiGM() { | 17 ColorEmojiGM() { |
18 fTypeface = NULL; | 18 fTypeface = NULL; |
19 } | 19 } |
20 | 20 |
21 ~ColorEmojiGM() { | 21 ~ColorEmojiGM() { |
22 SkSafeUnref(fTypeface); | 22 SkSafeUnref(fTypeface); |
23 } | 23 } |
24 protected: | 24 protected: |
| 25 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 26 return kSkipTiled_Flag; |
| 27 } |
| 28 |
25 virtual void onOnceBeforeDraw() SK_OVERRIDE { | 29 virtual void onOnceBeforeDraw() SK_OVERRIDE { |
26 | 30 |
27 SkString filename(INHERITED::gResourcePath); | 31 SkString filename(INHERITED::gResourcePath); |
28 filename.append("/Funkster.ttf"); | 32 filename.append("/Funkster.ttf"); |
29 | 33 |
30 SkAutoTUnref<SkFILEStream> stream(new SkFILEStream(filename.c_str())); | 34 SkAutoTUnref<SkFILEStream> stream(new SkFILEStream(filename.c_str())); |
31 if (!stream->isValid()) { | 35 if (!stream->isValid()) { |
32 SkDebugf("Could not find Funkster.ttf, please set --resourcePath cor
rectly.\n"); | 36 SkDebugf("Could not find Funkster.ttf, please set --resourcePath cor
rectly.\n"); |
33 return; | 37 return; |
34 } | 38 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 110 |
107 typedef GM INHERITED; | 111 typedef GM INHERITED; |
108 }; | 112 }; |
109 | 113 |
110 ////////////////////////////////////////////////////////////////////////////// | 114 ////////////////////////////////////////////////////////////////////////////// |
111 | 115 |
112 static GM* MyFactory(void*) { return new ColorEmojiGM; } | 116 static GM* MyFactory(void*) { return new ColorEmojiGM; } |
113 static GMRegistry reg(MyFactory); | 117 static GMRegistry reg(MyFactory); |
114 | 118 |
115 } | 119 } |
OLD | NEW |