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

Side by Side Diff: gm/xfermodes2.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/xfermodes.cpp ('k') | gm/xfermodes3.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 2013 Google Inc. 3 * Copyright 2013 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 16 matching lines...) Expand all
27 } 27 }
28 28
29 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 29 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
30 canvas->translate(SkIntToScalar(10), SkIntToScalar(20)); 30 canvas->translate(SkIntToScalar(10), SkIntToScalar(20));
31 31
32 const SkScalar w = SkIntToScalar(kSize); 32 const SkScalar w = SkIntToScalar(kSize);
33 const SkScalar h = SkIntToScalar(kSize); 33 const SkScalar h = SkIntToScalar(kSize);
34 34
35 SkPaint labelP; 35 SkPaint labelP;
36 labelP.setAntiAlias(true); 36 labelP.setAntiAlias(true);
37 sk_tool_utils::set_portable_typeface(&labelP);
37 labelP.setTextAlign(SkPaint::kCenter_Align); 38 labelP.setTextAlign(SkPaint::kCenter_Align);
38 39
39 const int W = 6; 40 const int W = 6;
40 41
41 SkScalar x = 0, y = 0; 42 SkScalar x = 0, y = 0;
42 for (size_t m = 0; m <= SkXfermode::kLastMode; m++) { 43 for (size_t m = 0; m <= SkXfermode::kLastMode; m++) {
43 SkXfermode::Mode mode = static_cast<SkXfermode::Mode>(m); 44 SkXfermode::Mode mode = static_cast<SkXfermode::Mode>(m);
44 SkXfermode* xm = SkXfermode::Create(mode); 45 SkXfermode* xm = SkXfermode::Create(mode);
45 SkAutoUnref aur(xm); 46 SkAutoUnref aur(xm);
46 47
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 145
145 typedef GM INHERITED; 146 typedef GM INHERITED;
146 }; 147 };
147 148
148 ////////////////////////////////////////////////////////////////////////////// 149 //////////////////////////////////////////////////////////////////////////////
149 150
150 static GM* MyFactory(void*) { return new Xfermodes2GM; } 151 static GM* MyFactory(void*) { return new Xfermodes2GM; }
151 static GMRegistry reg(MyFactory); 152 static GMRegistry reg(MyFactory);
152 153
153 } 154 }
OLDNEW
« no previous file with comments | « gm/xfermodes.cpp ('k') | gm/xfermodes3.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698