OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SkData.h" | 9 #include "SkData.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 static const char* kLabel5 = "Over-crop"; | 142 static const char* kLabel5 = "Over-crop"; |
143 static const char* kLabel6 = "Upper-left"; | 143 static const char* kLabel6 = "Upper-left"; |
144 static const char* kLabel7 = "No Crop"; | 144 static const char* kLabel7 = "No Crop"; |
145 | 145 |
146 static const char* kLabel8 = "Pre-Alloc Img"; | 146 static const char* kLabel8 = "Pre-Alloc Img"; |
147 static const char* kLabel9 = "New Alloc Img"; | 147 static const char* kLabel9 = "New Alloc Img"; |
148 static const char* kLabel10 = "GPU"; | 148 static const char* kLabel10 = "GPU"; |
149 | 149 |
150 SkPaint textPaint; | 150 SkPaint textPaint; |
151 textPaint.setAntiAlias(true); | 151 textPaint.setAntiAlias(true); |
152 sk_tool_utils::set_portable_typeface(&textPaint); | 152 sk_tool_utils::set_portable_typeface_always(&textPaint); |
153 textPaint.setTextSize(8); | 153 textPaint.setTextSize(8); |
154 | 154 |
155 canvas->drawText(kLabel1, strlen(kLabel1), 10, 60, textPaint); | 155 canvas->drawText(kLabel1, strlen(kLabel1), 10, 60, textPaint); |
156 canvas->drawText(kLabel2, strlen(kLabel2), 10, 140, textPaint); | 156 canvas->drawText(kLabel2, strlen(kLabel2), 10, 140, textPaint); |
157 canvas->drawText(kLabel3, strlen(kLabel3), 10, 220, textPaint); | 157 canvas->drawText(kLabel3, strlen(kLabel3), 10, 220, textPaint); |
158 canvas->drawText(kLabel4, strlen(kLabel4), 10, 300, textPaint); | 158 canvas->drawText(kLabel4, strlen(kLabel4), 10, 300, textPaint); |
159 canvas->drawText(kLabel5, strlen(kLabel5), 10, 380, textPaint); | 159 canvas->drawText(kLabel5, strlen(kLabel5), 10, 380, textPaint); |
160 canvas->drawText(kLabel6, strlen(kLabel6), 10, 460, textPaint); | 160 canvas->drawText(kLabel6, strlen(kLabel6), 10, 460, textPaint); |
161 canvas->drawText(kLabel7, strlen(kLabel7), 10, 540, textPaint); | 161 canvas->drawText(kLabel7, strlen(kLabel7), 10, 540, textPaint); |
162 | 162 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 278 } |
279 canvas->translate(0, image->height() + 20.0f); | 279 canvas->translate(0, image->height() + 20.0f); |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 private: | 283 private: |
284 typedef skiagm::GM INHERITED; | 284 typedef skiagm::GM INHERITED; |
285 }; | 285 }; |
286 DEF_GM( return new ImageResizeGM; ) | 286 DEF_GM( return new ImageResizeGM; ) |
287 | 287 |
OLD | NEW |