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

Side by Side Diff: gm/lighting.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/lcdtext.cpp ('k') | gm/linepaths.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 2012 Google Inc. 2 * Copyright 2012 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 "SkLightingImageFilter.h" 9 #include "SkLightingImageFilter.h"
10 10
(...skipping 16 matching lines...) Expand all
27 virtual SkString onShortName() { 27 virtual SkString onShortName() {
28 return SkString("lighting"); 28 return SkString("lighting");
29 } 29 }
30 30
31 void make_bitmap() { 31 void make_bitmap() {
32 fBitmap.allocN32Pixels(100, 100); 32 fBitmap.allocN32Pixels(100, 100);
33 SkCanvas canvas(fBitmap); 33 SkCanvas canvas(fBitmap);
34 canvas.clear(0x00000000); 34 canvas.clear(0x00000000);
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(0xFFFFFFFF); 38 paint.setColor(0xFFFFFFFF);
38 paint.setTextSize(SkIntToScalar(96)); 39 paint.setTextSize(SkIntToScalar(96));
39 const char* str = "e"; 40 const char* str = "e";
40 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint); 41 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
41 } 42 }
42 43
43 virtual SkISize onISize() { 44 virtual SkISize onISize() {
44 return SkISize::Make(WIDTH, HEIGHT); 45 return SkISize::Make(WIDTH, HEIGHT);
45 } 46 }
46 47
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 SkBitmap fBitmap; 122 SkBitmap fBitmap;
122 bool fInitialized; 123 bool fInitialized;
123 }; 124 };
124 125
125 ////////////////////////////////////////////////////////////////////////////// 126 //////////////////////////////////////////////////////////////////////////////
126 127
127 static GM* MyFactory(void*) { return new ImageLightingGM; } 128 static GM* MyFactory(void*) { return new ImageLightingGM; }
128 static GMRegistry reg(MyFactory); 129 static GMRegistry reg(MyFactory);
129 130
130 } 131 }
OLDNEW
« no previous file with comments | « gm/lcdtext.cpp ('k') | gm/linepaths.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698