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

Side by Side Diff: gm/glyph_pos.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/getpostextpath.cpp ('k') | gm/gradtext.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 2014 Google Inc. 2 * Copyright 2014 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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkTypeface.h" 10 #include "SkTypeface.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } else { 45 } else {
46 str.append("_b"); // b == Both. 46 str.append("_b"); // b == Both.
47 } 47 }
48 return str; 48 return str;
49 } 49 }
50 50
51 virtual SkISize onISize() { return SkISize::Make(800, 600); } 51 virtual SkISize onISize() { return SkISize::Make(800, 600); }
52 52
53 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 53 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
54 if (!fProp) { 54 if (!fProp) {
55 fProp.reset(SkTypeface::CreateFromName("Helvetica", SkTypeface::kNor mal)); 55 fProp.reset(sk_tool_utils::create_portable_typeface("Helvetica", SkT ypeface::kNormal));
56 } 56 }
57 57
58 // There's a black pixel at 40, 40 for reference. 58 // There's a black pixel at 40, 40 for reference.
59 canvas->drawPoint(40.0f, 40.0f, SK_ColorBLACK); 59 canvas->drawPoint(40.0f, 40.0f, SK_ColorBLACK);
60 60
61 // Two reference images. 61 // Two reference images.
62 canvas->translate(50.0f, 50.0f); 62 canvas->translate(50.0f, 50.0f);
63 drawTestCase(canvas, 1.0f); 63 drawTestCase(canvas, 1.0f);
64 64
65 canvas->translate(0.0f, 50.0f); 65 canvas->translate(0.0f, 50.0f);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 static GMRegistry reg1(GlyphPosHairlineStrokeAndFillFactory); 196 static GMRegistry reg1(GlyphPosHairlineStrokeAndFillFactory);
197 static GMRegistry reg2(GlyphPosStrokeAndFillFactory); 197 static GMRegistry reg2(GlyphPosStrokeAndFillFactory);
198 static GMRegistry reg3(GlyphPosHairlineStrokeFactory); 198 static GMRegistry reg3(GlyphPosHairlineStrokeFactory);
199 static GMRegistry reg4(GlyphPosStrokeFactory); 199 static GMRegistry reg4(GlyphPosStrokeFactory);
200 static GMRegistry reg5(GlyphPosHairlineFillFactory); 200 static GMRegistry reg5(GlyphPosHairlineFillFactory);
201 static GMRegistry reg6(GlyphPosFillFactory); 201 static GMRegistry reg6(GlyphPosFillFactory);
202 202
203 203
204 } 204 }
OLDNEW
« no previous file with comments | « gm/getpostextpath.cpp ('k') | gm/gradtext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698