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

Side by Side Diff: gm/tileimagefilter.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/texteffects.cpp ('k') | gm/tilemodes.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 2013 Google Inc. 2 * Copyright 2013 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 "SkColorMatrixFilter.h" 9 #include "SkColorMatrixFilter.h"
10 #include "SkColorFilterImageFilter.h" 10 #include "SkColorFilterImageFilter.h"
(...skipping 16 matching lines...) Expand all
27 virtual SkString onShortName() { 27 virtual SkString onShortName() {
28 return SkString("tileimagefilter"); 28 return SkString("tileimagefilter");
29 } 29 }
30 30
31 void make_bitmap() { 31 void make_bitmap() {
32 fBitmap.allocN32Pixels(50, 50); 32 fBitmap.allocN32Pixels(50, 50);
33 SkCanvas canvas(fBitmap); 33 SkCanvas canvas(fBitmap);
34 canvas.clear(0xFF000000); 34 canvas.clear(0xFF000000);
35 SkPaint paint; 35 SkPaint paint;
36 paint.setAntiAlias(true); 36 paint.setAntiAlias(true);
37 sk_tool_utils::set_portable_typeface(&paint);
37 paint.setColor(0xD000D000); 38 paint.setColor(0xD000D000);
38 paint.setTextSize(SkIntToScalar(50)); 39 paint.setTextSize(SkIntToScalar(50));
39 const char* str = "e"; 40 const char* str = "e";
40 canvas.drawText(str, strlen(str), SkIntToScalar(10), SkIntToScalar(45), paint); 41 canvas.drawText(str, strlen(str), SkIntToScalar(10), SkIntToScalar(45), paint);
41 } 42 }
42 43
43 void make_checkerboard() { 44 void make_checkerboard() {
44 fCheckerboard.allocN32Pixels(80, 80); 45 fCheckerboard.allocN32Pixels(80, 80);
45 SkCanvas canvas(fCheckerboard); 46 SkCanvas canvas(fCheckerboard);
46 canvas.clear(0x00000000); 47 canvas.clear(0x00000000);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 SkBitmap fBitmap, fCheckerboard; 129 SkBitmap fBitmap, fCheckerboard;
129 bool fInitialized; 130 bool fInitialized;
130 }; 131 };
131 132
132 ////////////////////////////////////////////////////////////////////////////// 133 //////////////////////////////////////////////////////////////////////////////
133 134
134 static GM* MyFactory(void*) { return new TileImageFilterGM; } 135 static GM* MyFactory(void*) { return new TileImageFilterGM; }
135 static GMRegistry reg(MyFactory); 136 static GMRegistry reg(MyFactory);
136 137
137 } 138 }
OLDNEW
« no previous file with comments | « gm/texteffects.cpp ('k') | gm/tilemodes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698