Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: gm/image.cpp

Issue 407183003: add portable and canonical font support for DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add atexit; rename to create_... Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/gradtext.cpp ('k') | gm/imageblur.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SkSurface.h" 9 #include "SkSurface.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 static const char* kLabel6 = "Upper-left"; 151 static const char* kLabel6 = "Upper-left";
152 static const char* kLabel7 = "No Crop"; 152 static const char* kLabel7 = "No Crop";
153 153
154 static const char* kLabel8 = "Pre-Alloc Img"; 154 static const char* kLabel8 = "Pre-Alloc Img";
155 static const char* kLabel9 = "New Alloc Img"; 155 static const char* kLabel9 = "New Alloc Img";
156 static const char* kLabel10 = "Null Paint"; 156 static const char* kLabel10 = "Null Paint";
157 static const char* kLabel11 = "GPU"; 157 static const char* kLabel11 = "GPU";
158 158
159 SkPaint textPaint; 159 SkPaint textPaint;
160 textPaint.setAntiAlias(true); 160 textPaint.setAntiAlias(true);
161 sk_tool_utils::set_portable_typeface(&textPaint);
161 textPaint.setTextSize(8); 162 textPaint.setTextSize(8);
162 163
163 canvas->drawText(kLabel1, strlen(kLabel1), 10, 60, textPaint); 164 canvas->drawText(kLabel1, strlen(kLabel1), 10, 60, textPaint);
164 canvas->drawText(kLabel2, strlen(kLabel2), 10, 140, textPaint); 165 canvas->drawText(kLabel2, strlen(kLabel2), 10, 140, textPaint);
165 canvas->drawText(kLabel3, strlen(kLabel3), 10, 220, textPaint); 166 canvas->drawText(kLabel3, strlen(kLabel3), 10, 220, textPaint);
166 canvas->drawText(kLabel4, strlen(kLabel4), 10, 300, textPaint); 167 canvas->drawText(kLabel4, strlen(kLabel4), 10, 300, textPaint);
167 canvas->drawText(kLabel5, strlen(kLabel5), 10, 380, textPaint); 168 canvas->drawText(kLabel5, strlen(kLabel5), 10, 380, textPaint);
168 canvas->drawText(kLabel6, strlen(kLabel6), 10, 460, textPaint); 169 canvas->drawText(kLabel6, strlen(kLabel6), 10, 460, textPaint);
169 canvas->drawText(kLabel7, strlen(kLabel7), 10, 540, textPaint); 170 canvas->drawText(kLabel7, strlen(kLabel7), 10, 540, textPaint);
170 171
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 204 }
204 205
205 private: 206 private:
206 typedef skiagm::GM INHERITED; 207 typedef skiagm::GM INHERITED;
207 }; 208 };
208 209
209 ////////////////////////////////////////////////////////////////////////////// 210 //////////////////////////////////////////////////////////////////////////////
210 211
211 static skiagm::GM* MyFactory(void*) { return new ImageGM; } 212 static skiagm::GM* MyFactory(void*) { return new ImageGM; }
212 static skiagm::GMRegistry reg(MyFactory); 213 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/gradtext.cpp ('k') | gm/imageblur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698