OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 fConcavePath.lineTo(points[(2 * i) % 5]); | 80 fConcavePath.lineTo(points[(2 * i) % 5]); |
81 } | 81 } |
82 fConcavePath.setFillType(SkPath::kEvenOdd_FillType); | 82 fConcavePath.setFillType(SkPath::kEvenOdd_FillType); |
83 SkASSERT(!fConcavePath.isConvex()); | 83 SkASSERT(!fConcavePath.isConvex()); |
84 } | 84 } |
85 canvas->drawPath(fConcavePath, *paint); | 85 canvas->drawPath(fConcavePath, *paint); |
86 break; | 86 break; |
87 case kText_ShapeType: { | 87 case kText_ShapeType: { |
88 const char* text = "Hello!"; | 88 const char* text = "Hello!"; |
89 paint->setTextSize(30); | 89 paint->setTextSize(30); |
| 90 sk_tool_utils::set_portable_typeface(paint); |
90 canvas->drawText(text, strlen(text), 0, 0, *paint); | 91 canvas->drawText(text, strlen(text), 0, 0, *paint); |
91 } | 92 } |
92 default: | 93 default: |
93 break; | 94 break; |
94 } | 95 } |
95 } | 96 } |
96 | 97 |
97 static SkColor GetColor(SkRandom* random, int i, int nextColor) { | 98 static SkColor GetColor(SkRandom* random, int i, int nextColor) { |
98 static SkColor colors[] = { SK_ColorRED, | 99 static SkColor colors[] = { SK_ColorRED, |
99 sk_tool_utils::color_to_565(0xFFFF7F00), //
Orange | 100 sk_tool_utils::color_to_565(0xFFFF7F00), //
Orange |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 static const int kHeight = 400; | 187 static const int kHeight = 400; |
187 typedef GM INHERITED; | 188 typedef GM INHERITED; |
188 }; | 189 }; |
189 | 190 |
190 ////////////////////////////////////////////////////////////////////////////// | 191 ////////////////////////////////////////////////////////////////////////////// |
191 | 192 |
192 static GM* MyFactory(void*) { return new DstReadShuffle; } | 193 static GM* MyFactory(void*) { return new DstReadShuffle; } |
193 static GMRegistry reg(MyFactory); | 194 static GMRegistry reg(MyFactory); |
194 | 195 |
195 } | 196 } |
OLD | NEW |