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

Side by Side Diff: gm/pathreverse.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/offsetimagefilter.cpp ('k') | gm/pictureimagefilter.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 canvas->translate(0, 100); 45 canvas->translate(0, 100);
46 path.reset(); 46 path.reset();
47 path.moveTo(10, 10); path.lineTo(30, 30); 47 path.moveTo(10, 10); path.lineTo(30, 30);
48 path.addOval(r); 48 path.addOval(r);
49 r.offset(50, 20); 49 r.offset(50, 20);
50 path.addOval(r); 50 path.addOval(r);
51 test_rev(canvas, path); 51 test_rev(canvas, path);
52 52
53 SkPaint paint; 53 SkPaint paint;
54 paint.setTextSize(SkIntToScalar(100)); 54 paint.setTextSize(SkIntToScalar(100));
55 SkTypeface* hira = SkTypeface::CreateFromName("Hiragino Maru Gothic Pro", Sk Typeface::kNormal); 55 sk_tool_utils::set_portable_typeface(&paint, "Hiragino Maru Gothic Pro");
56 SkSafeUnref(paint.setTypeface(hira));
57 path.reset(); 56 path.reset();
58 paint.getTextPath("e", 1, 50, 50, &path); 57 paint.getTextPath("e", 1, 50, 50, &path);
59 canvas->translate(0, 100); 58 canvas->translate(0, 100);
60 test_rev(canvas, path); 59 test_rev(canvas, path);
61 } 60 }
62 61
63 namespace skiagm { 62 namespace skiagm {
64 63
65 class PathReverseGM : public GM { 64 class PathReverseGM : public GM {
66 public: 65 public:
(...skipping 29 matching lines...) Expand all
96 canvas->translate(0, 100); 95 canvas->translate(0, 100);
97 path.reset(); 96 path.reset();
98 path.moveTo(10, 10); path.lineTo(30, 30); 97 path.moveTo(10, 10); path.lineTo(30, 30);
99 path.addOval(r); 98 path.addOval(r);
100 r.offset(50, 20); 99 r.offset(50, 20);
101 path.addOval(r); 100 path.addOval(r);
102 test_rev(canvas, path); 101 test_rev(canvas, path);
103 102
104 SkPaint paint; 103 SkPaint paint;
105 paint.setTextSize(SkIntToScalar(100)); 104 paint.setTextSize(SkIntToScalar(100));
106 SkTypeface* hira = SkTypeface::CreateFromName("Hiragino Maru Gothic Pro" , SkTypeface::kNormal); 105 sk_tool_utils::set_portable_typeface(&paint, "Hiragino Maru Gothic Pro") ;
107 SkSafeUnref(paint.setTypeface(hira));
108 path.reset(); 106 path.reset();
109 paint.getTextPath("e", 1, 50, 50, &path); 107 paint.getTextPath("e", 1, 50, 50, &path);
110 canvas->translate(0, 100); 108 canvas->translate(0, 100);
111 test_rev(canvas, path); 109 test_rev(canvas, path);
112 } 110 }
113 111
114 private: 112 private:
115 typedef GM INHERITED; 113 typedef GM INHERITED;
116 }; 114 };
117 115
118 ////////////////////////////////////////////////////////////////////////////// 116 //////////////////////////////////////////////////////////////////////////////
119 117
120 static GM* MyFactory(void*) { return new PathReverseGM; } 118 static GM* MyFactory(void*) { return new PathReverseGM; }
121 static GMRegistry reg(MyFactory); 119 static GMRegistry reg(MyFactory);
122 120
123 } 121 }
OLDNEW
« no previous file with comments | « gm/offsetimagefilter.cpp ('k') | gm/pictureimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698