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

Side by Side Diff: gm/shadertext.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/samplerstress.cpp ('k') | gm/shadertext2.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 "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 for (size_t ty = 0; ty < SK_ARRAY_COUNT(tileModes); ++ty) { 148 for (size_t ty = 0; ty < SK_ARRAY_COUNT(tileModes); ++ty) {
149 shaders[shdIdx++] = MakeBitmapShader(tileModes[tx], 149 shaders[shdIdx++] = MakeBitmapShader(tileModes[tx],
150 tileModes[ty], 150 tileModes[ty],
151 w/8, h); 151 w/8, h);
152 } 152 }
153 } 153 }
154 154
155 SkPaint paint; 155 SkPaint paint;
156 paint.setDither(true); 156 paint.setDither(true);
157 paint.setAntiAlias(true); 157 paint.setAntiAlias(true);
158 sk_tool_utils::set_portable_typeface(&paint);
158 paint.setTextSize(SkIntToScalar(pointSize)); 159 paint.setTextSize(SkIntToScalar(pointSize));
159 160
160 canvas->save(); 161 canvas->save();
161 canvas->translate(SkIntToScalar(20), SkIntToScalar(10)); 162 canvas->translate(SkIntToScalar(20), SkIntToScalar(10));
162 163
163 SkPath path; 164 SkPath path;
164 path.arcTo(SkRect::MakeXYWH(SkIntToScalar(-40), SkIntToScalar(15), 165 path.arcTo(SkRect::MakeXYWH(SkIntToScalar(-40), SkIntToScalar(15),
165 SkIntToScalar(300), SkIntToScalar(90)), 166 SkIntToScalar(300), SkIntToScalar(90)),
166 SkIntToScalar(225), SkIntToScalar(90), 167 SkIntToScalar(225), SkIntToScalar(90),
167 false); 168 false);
(...skipping 24 matching lines...) Expand all
192 193
193 private: 194 private:
194 typedef GM INHERITED; 195 typedef GM INHERITED;
195 }; 196 };
196 197
197 /////////////////////////////////////////////////////////////////////////////// 198 ///////////////////////////////////////////////////////////////////////////////
198 199
199 static GM* MyFactory(void*) { return new ShaderTextGM; } 200 static GM* MyFactory(void*) { return new ShaderTextGM; }
200 static GMRegistry reg(MyFactory); 201 static GMRegistry reg(MyFactory);
201 } 202 }
OLDNEW
« no previous file with comments | « gm/samplerstress.cpp ('k') | gm/shadertext2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698