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

Side by Side Diff: gm/imagefiltersgraph.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/imagefilterscropped.cpp ('k') | gm/imagemagnifier.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 9
10 #include "SkArithmeticMode.h" 10 #include "SkArithmeticMode.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 virtual SkString onShortName() { 92 virtual SkString onShortName() {
93 return SkString("imagefiltersgraph"); 93 return SkString("imagefiltersgraph");
94 } 94 }
95 95
96 void make_bitmap() { 96 void make_bitmap() {
97 fBitmap.allocN32Pixels(100, 100); 97 fBitmap.allocN32Pixels(100, 100);
98 SkCanvas canvas(fBitmap); 98 SkCanvas canvas(fBitmap);
99 canvas.clear(0x00000000); 99 canvas.clear(0x00000000);
100 SkPaint paint; 100 SkPaint paint;
101 paint.setAntiAlias(true); 101 paint.setAntiAlias(true);
102 sk_tool_utils::set_portable_typeface(&paint);
102 paint.setColor(0xFFFFFFFF); 103 paint.setColor(0xFFFFFFFF);
103 paint.setTextSize(SkIntToScalar(96)); 104 paint.setTextSize(SkIntToScalar(96));
104 const char* str = "e"; 105 const char* str = "e";
105 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint); 106 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
106 } 107 }
107 108
108 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai nt& paint) { 109 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai nt& paint) {
109 canvas->save(); 110 canvas->save();
110 canvas->clipRect(SkRect::MakeXYWH(0, 0, 111 canvas->clipRect(SkRect::MakeXYWH(0, 0,
111 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()))); 112 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height())));
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 210
210 private: 211 private:
211 typedef GM INHERITED; 212 typedef GM INHERITED;
212 SkBitmap fBitmap; 213 SkBitmap fBitmap;
213 }; 214 };
214 215
215 /////////////////////////////////////////////////////////////////////////////// 216 ///////////////////////////////////////////////////////////////////////////////
216 217
217 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } 218 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; }
218 static skiagm::GMRegistry reg(MyFactory); 219 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/imagefilterscropped.cpp ('k') | gm/imagemagnifier.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698