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

Side by Side Diff: gm/dftext.cpp

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Android fix + nit fix Created 4 years, 6 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/colorwheel.cpp ('k') | gm/downsamplebitmap.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 #include "gm.h" 7 #include "gm.h"
8 #include "Resources.h" 8 #include "Resources.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 SkCanvas* canvas = inputCanvas; 63 SkCanvas* canvas = inputCanvas;
64 #endif 64 #endif
65 // apply global scale to test glyph positioning 65 // apply global scale to test glyph positioning
66 canvas->scale(1.05f, 1.05f); 66 canvas->scale(1.05f, 1.05f);
67 canvas->clear(0xffffffff); 67 canvas->clear(0xffffffff);
68 68
69 SkPaint paint; 69 SkPaint paint;
70 paint.setAntiAlias(true); 70 paint.setAntiAlias(true);
71 paint.setSubpixelText(true); 71 paint.setSubpixelText(true);
72 72
73 sk_tool_utils::set_portable_typeface(&paint, "serif", SkTypeface::kNorma l); 73 sk_tool_utils::set_portable_typeface(&paint, "serif");
74 74
75 const char* text = "Hamburgefons"; 75 const char* text = "Hamburgefons";
76 const size_t textLen = strlen(text); 76 const size_t textLen = strlen(text);
77 77
78 // check scaling up 78 // check scaling up
79 SkScalar x = SkIntToScalar(0); 79 SkScalar x = SkIntToScalar(0);
80 SkScalar y = SkIntToScalar(78); 80 SkScalar y = SkIntToScalar(78);
81 for (size_t i = 0; i < SK_ARRAY_COUNT(textSizes); ++i) { 81 for (size_t i = 0; i < SK_ARRAY_COUNT(textSizes); ++i) {
82 SkAutoCanvasRestore acr(canvas, true); 82 SkAutoCanvasRestore acr(canvas, true);
83 canvas->translate(x, y); 83 canvas->translate(x, y);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 211
212 private: 212 private:
213 sk_sp<SkTypeface> fEmojiTypeface; 213 sk_sp<SkTypeface> fEmojiTypeface;
214 const char* fEmojiText; 214 const char* fEmojiText;
215 215
216 typedef skiagm::GM INHERITED; 216 typedef skiagm::GM INHERITED;
217 }; 217 };
218 218
219 DEF_GM(return new DFTextGM;) 219 DEF_GM(return new DFTextGM;)
OLDNEW
« no previous file with comments | « gm/colorwheel.cpp ('k') | gm/downsamplebitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698