OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BD-style license that can be | 4 * Use of this source code is governed by a BD-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 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
(...skipping 21 matching lines...) Expand all Loading... |
32 void onDraw(SkCanvas* canvas) override { | 32 void onDraw(SkCanvas* canvas) override { |
33 // This GM exists to test a specific feature of the GPU backend. | 33 // This GM exists to test a specific feature of the GPU backend. |
34 if (NULL == canvas->getGrContext()) { | 34 if (NULL == canvas->getGrContext()) { |
35 this->drawGpuOnlyMessage(canvas); | 35 this->drawGpuOnlyMessage(canvas); |
36 return; | 36 return; |
37 } | 37 } |
38 | 38 |
39 const char text[] = "Hamburgefons"; | 39 const char text[] = "Hamburgefons"; |
40 | 40 |
41 SkPaint paint; | 41 SkPaint paint; |
42 sk_tool_utils::set_portable_typeface(&paint); | 42 sk_tool_utils::set_portable_typeface_always(&paint); |
| 43 paint.setAntiAlias(true); |
43 paint.setTextSize(20); | 44 paint.setTextSize(20); |
44 | 45 |
45 SkTextBlobBuilder builder; | 46 SkTextBlobBuilder builder; |
46 | 47 |
47 sk_tool_utils::add_to_text_blob(&builder, text, paint, 10, 10); | 48 sk_tool_utils::add_to_text_blob(&builder, text, paint, 10, 10); |
48 | 49 |
49 SkAutoTUnref<const SkTextBlob> blob(builder.build()); | 50 SkAutoTUnref<const SkTextBlob> blob(builder.build()); |
50 | 51 |
51 // draw textblob | 52 // draw textblob |
52 SkRect rect = SkRect::MakeLTRB(0.f, 0.f, SkIntToScalar(kWidth), kHeight
/ 2.f); | 53 SkRect rect = SkRect::MakeLTRB(0.f, 0.f, SkIntToScalar(kWidth), kHeight
/ 2.f); |
(...skipping 12 matching lines...) Expand all Loading... |
65 static const int kHeight = 200; | 66 static const int kHeight = 200; |
66 | 67 |
67 typedef GM INHERITED; | 68 typedef GM INHERITED; |
68 }; | 69 }; |
69 | 70 |
70 ////////////////////////////////////////////////////////////////////////////// | 71 ////////////////////////////////////////////////////////////////////////////// |
71 | 72 |
72 DEF_GM( return SkNEW(TextBlobUseAfterGpuFree); ) | 73 DEF_GM( return SkNEW(TextBlobUseAfterGpuFree); ) |
73 } | 74 } |
74 #endif | 75 #endif |
OLD | NEW |