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