OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 | 9 |
10 namespace skiagm { | 10 namespace skiagm { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 SkCanvas canvasTmp(src); | 70 SkCanvas canvasTmp(src); |
71 | 71 |
72 draw_checks(&canvasTmp, 40, 40); | 72 draw_checks(&canvasTmp, 40, 40); |
73 | 73 |
74 for (unsigned i = 0; i < NUM_CONFIGS; ++i) { | 74 for (unsigned i = 0; i < NUM_CONFIGS; ++i) { |
75 src.copyTo(&fDst[i], gColorTypes[i]); | 75 src.copyTo(&fDst[i], gColorTypes[i]); |
76 } | 76 } |
77 | 77 |
78 canvas->clear(0xFFDDDDDD); | 78 canvas->clear(0xFFDDDDDD); |
79 paint.setAntiAlias(true); | 79 paint.setAntiAlias(true); |
| 80 sk_tool_utils::set_portable_typeface(&paint); |
| 81 |
80 SkScalar width = SkIntToScalar(40); | 82 SkScalar width = SkIntToScalar(40); |
81 SkScalar height = SkIntToScalar(40); | 83 SkScalar height = SkIntToScalar(40); |
82 if (paint.getFontSpacing() > height) { | 84 if (paint.getFontSpacing() > height) { |
83 height = paint.getFontSpacing(); | 85 height = paint.getFontSpacing(); |
84 } | 86 } |
85 for (unsigned i = 0; i < NUM_CONFIGS; i++) { | 87 for (unsigned i = 0; i < NUM_CONFIGS; i++) { |
86 const char* name = gColorTypeNames[src.colorType()]; | 88 const char* name = gColorTypeNames[src.colorType()]; |
87 SkScalar textWidth = paint.measureText(name, strlen(name)); | 89 SkScalar textWidth = paint.measureText(name, strlen(name)); |
88 if (textWidth > width) { | 90 if (textWidth > width) { |
89 width = textWidth; | 91 width = textWidth; |
(...skipping 27 matching lines...) Expand all Loading... |
117 | 119 |
118 private: | 120 private: |
119 typedef GM INHERITED; | 121 typedef GM INHERITED; |
120 }; | 122 }; |
121 | 123 |
122 ////////////////////////////////////////////////////////////////////////////// | 124 ////////////////////////////////////////////////////////////////////////////// |
123 | 125 |
124 static GM* MyFactory(void*) { return new BitmapCopyGM; } | 126 static GM* MyFactory(void*) { return new BitmapCopyGM; } |
125 static GMRegistry reg(MyFactory); | 127 static GMRegistry reg(MyFactory); |
126 } | 128 } |
OLD | NEW |