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

Side by Side Diff: gm/offsetimagefilter.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/morphology.cpp ('k') | gm/pathreverse.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 "SkOffsetImageFilter.h" 9 #include "SkOffsetImageFilter.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 14 matching lines...) Expand all
25 virtual SkString onShortName() { 25 virtual SkString onShortName() {
26 return SkString("offsetimagefilter"); 26 return SkString("offsetimagefilter");
27 } 27 }
28 28
29 void make_bitmap() { 29 void make_bitmap() {
30 fBitmap.allocN32Pixels(80, 80); 30 fBitmap.allocN32Pixels(80, 80);
31 SkCanvas canvas(fBitmap); 31 SkCanvas canvas(fBitmap);
32 canvas.clear(0x00000000); 32 canvas.clear(0x00000000);
33 SkPaint paint; 33 SkPaint paint;
34 paint.setAntiAlias(true); 34 paint.setAntiAlias(true);
35 sk_tool_utils::set_portable_typeface(&paint);
35 paint.setColor(0xD000D000); 36 paint.setColor(0xD000D000);
36 paint.setTextSize(SkIntToScalar(96)); 37 paint.setTextSize(SkIntToScalar(96));
37 const char* str = "e"; 38 const char* str = "e";
38 canvas.drawText(str, strlen(str), SkIntToScalar(15), SkIntToScalar(65), paint); 39 canvas.drawText(str, strlen(str), SkIntToScalar(15), SkIntToScalar(65), paint);
39 } 40 }
40 41
41 void make_checkerboard() { 42 void make_checkerboard() {
42 fCheckerboard.allocN32Pixels(80, 80); 43 fCheckerboard.allocN32Pixels(80, 80);
43 SkCanvas canvas(fCheckerboard); 44 SkCanvas canvas(fCheckerboard);
44 canvas.clear(0x00000000); 45 canvas.clear(0x00000000);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 SkBitmap fBitmap, fCheckerboard; 124 SkBitmap fBitmap, fCheckerboard;
124 bool fInitialized; 125 bool fInitialized;
125 }; 126 };
126 127
127 ////////////////////////////////////////////////////////////////////////////// 128 //////////////////////////////////////////////////////////////////////////////
128 129
129 static GM* MyFactory(void*) { return new OffsetImageFilterGM; } 130 static GM* MyFactory(void*) { return new OffsetImageFilterGM; }
130 static GMRegistry reg(MyFactory); 131 static GMRegistry reg(MyFactory);
131 132
132 } 133 }
OLDNEW
« no previous file with comments | « gm/morphology.cpp ('k') | gm/pathreverse.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698