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

Side by Side Diff: gm/xfermodes.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/xfermodeimagefilter.cpp ('k') | gm/xfermodes2.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 const SkScalar h = SkIntToScalar(H); 218 const SkScalar h = SkIntToScalar(H);
219 SkMatrix m; 219 SkMatrix m;
220 m.setScale(SkIntToScalar(6), SkIntToScalar(6)); 220 m.setScale(SkIntToScalar(6), SkIntToScalar(6));
221 SkShader* s = SkShader::CreateBitmapShader(fBG, 221 SkShader* s = SkShader::CreateBitmapShader(fBG,
222 SkShader::kRepeat_TileMode, 222 SkShader::kRepeat_TileMode,
223 SkShader::kRepeat_TileMode, 223 SkShader::kRepeat_TileMode,
224 &m); 224 &m);
225 225
226 SkPaint labelP; 226 SkPaint labelP;
227 labelP.setAntiAlias(true); 227 labelP.setAntiAlias(true);
228 sk_tool_utils::set_portable_typeface(&labelP);
228 labelP.setTextAlign(SkPaint::kCenter_Align); 229 labelP.setTextAlign(SkPaint::kCenter_Align);
229 230
230 const int W = 5; 231 const int W = 5;
231 232
232 SkScalar x0 = 0; 233 SkScalar x0 = 0;
233 SkScalar y0 = 0; 234 SkScalar y0 = 0;
234 for (int sourceType = 1; sourceType & kAll_SrcType; sourceType <<= 1) { 235 for (int sourceType = 1; sourceType & kAll_SrcType; sourceType <<= 1) {
235 SkScalar x = x0, y = y0; 236 SkScalar x = x0, y = y0;
236 for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); i++) { 237 for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); i++) {
237 if ((gModes[i].fSourceTypeMask & sourceType) == 0) { 238 if ((gModes[i].fSourceTypeMask & sourceType) == 0) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 private: 284 private:
284 typedef GM INHERITED; 285 typedef GM INHERITED;
285 }; 286 };
286 287
287 ////////////////////////////////////////////////////////////////////////////// 288 //////////////////////////////////////////////////////////////////////////////
288 289
289 static GM* MyFactory(void*) { return new XfermodesGM; } 290 static GM* MyFactory(void*) { return new XfermodesGM; }
290 static GMRegistry reg(MyFactory); 291 static GMRegistry reg(MyFactory);
291 292
292 } 293 }
OLDNEW
« no previous file with comments | « gm/xfermodeimagefilter.cpp ('k') | gm/xfermodes2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698