| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "gm.h" | 7 #include "gm.h" |
| 8 #include "Resources.h" | 8 #include "Resources.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkStream.h" | 10 #include "SkStream.h" |
| 11 #include "SkSurface.h" | 11 #include "SkSurface.h" |
| 12 #include "SkTypeface.h" | 12 #include "SkTypeface.h" |
| 13 | 13 |
| 14 class DFTextGM : public skiagm::GM { | 14 class DFTextGM : public skiagm::GM { |
| 15 public: | 15 public: |
| 16 DFTextGM() { | 16 DFTextGM() { |
| 17 this->setBGColor(0xFFFFFFFF); | 17 this->setBGColor(0xFFFFFFFF); |
| 18 } | 18 } |
| 19 | 19 |
| 20 protected: | 20 protected: |
| 21 void onOnceBeforeDraw() override { | 21 void onOnceBeforeDraw() override { |
| 22 fEmojiTypeface.reset(sk_tool_utils::emoji_typeface()); | 22 sk_tool_utils::emoji_typeface(&fEmojiTypeface); |
| 23 fEmojiText = sk_tool_utils::emoji_sample_text(); | 23 fEmojiText = sk_tool_utils::emoji_sample_text(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 SkString onShortName() override { | 26 SkString onShortName() override { |
| 27 SkString name("dftext"); | 27 SkString name("dftext"); |
| 28 name.append(sk_tool_utils::platform_os_emoji()); | 28 name.append(sk_tool_utils::platform_os_emoji()); |
| 29 return name; | 29 return name; |
| 30 } | 30 } |
| 31 | 31 |
| 32 SkISize onISize() override { | 32 SkISize onISize() override { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 221 } |
| 222 | 222 |
| 223 private: | 223 private: |
| 224 SkAutoTUnref<SkTypeface> fEmojiTypeface; | 224 SkAutoTUnref<SkTypeface> fEmojiTypeface; |
| 225 const char* fEmojiText; | 225 const char* fEmojiText; |
| 226 | 226 |
| 227 typedef skiagm::GM INHERITED; | 227 typedef skiagm::GM INHERITED; |
| 228 }; | 228 }; |
| 229 | 229 |
| 230 DEF_GM( return SkNEW(DFTextGM); ) | 230 DEF_GM( return SkNEW(DFTextGM); ) |
| OLD | NEW |