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 21 matching lines...) Expand all Loading... |
32 canvas->drawTextBlob(blob, 0, 0, paint); | 32 canvas->drawTextBlob(blob, 0, 0, paint); |
33 canvas->restore(); | 33 canvas->restore(); |
34 } | 34 } |
35 | 35 |
36 class MixedTextBlobsGM : public GM { | 36 class MixedTextBlobsGM : public GM { |
37 public: | 37 public: |
38 MixedTextBlobsGM() { } | 38 MixedTextBlobsGM() { } |
39 | 39 |
40 protected: | 40 protected: |
41 void onOnceBeforeDraw() override { | 41 void onOnceBeforeDraw() override { |
42 fEmojiTypeface.reset(sk_tool_utils::emoji_typeface()); | 42 sk_tool_utils::emoji_typeface(&fEmojiTypeface); |
43 fEmojiText = sk_tool_utils::emoji_sample_text(); | 43 fEmojiText = sk_tool_utils::emoji_sample_text(); |
44 fReallyBigATypeface.reset(GetResourceAsTypeface("/fonts/ReallyBigA.ttf")
); | 44 fReallyBigATypeface.reset(GetResourceAsTypeface("/fonts/ReallyBigA.ttf")
); |
45 | 45 |
46 SkTextBlobBuilder builder; | 46 SkTextBlobBuilder builder; |
47 | 47 |
48 // make textblob | 48 // make textblob |
49 // Text so large we draw as paths | 49 // Text so large we draw as paths |
50 SkPaint paint; | 50 SkPaint paint; |
51 paint.setTextSize(385); | 51 paint.setTextSize(385); |
52 const char* text = "O"; | 52 const char* text = "O"; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 static const int kWidth = 1250; | 156 static const int kWidth = 1250; |
157 static const int kHeight = 700; | 157 static const int kHeight = 700; |
158 | 158 |
159 typedef GM INHERITED; | 159 typedef GM INHERITED; |
160 }; | 160 }; |
161 | 161 |
162 ////////////////////////////////////////////////////////////////////////////// | 162 ////////////////////////////////////////////////////////////////////////////// |
163 | 163 |
164 DEF_GM( return SkNEW(MixedTextBlobsGM); ) | 164 DEF_GM( return SkNEW(MixedTextBlobsGM); ) |
165 } | 165 } |
OLD | NEW |