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

Side by Side Diff: gm/drawlooper.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/drawbitmaprect.cpp ('k') | gm/dropshadowimagefilter.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 2011 Google Inc. 2 * Copyright 2011 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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 22 matching lines...) Expand all
33 33
34 virtual SkString onShortName() SK_OVERRIDE { 34 virtual SkString onShortName() SK_OVERRIDE {
35 return SkString("drawlooper"); 35 return SkString("drawlooper");
36 } 36 }
37 37
38 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 38 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
39 this->init(); 39 this->init();
40 40
41 SkPaint paint; 41 SkPaint paint;
42 paint.setAntiAlias(true); 42 paint.setAntiAlias(true);
43 sk_tool_utils::set_portable_typeface(&paint);
43 paint.setTextSize(SkIntToScalar(72)); 44 paint.setTextSize(SkIntToScalar(72));
44 paint.setLooper(fLooper); 45 paint.setLooper(fLooper);
45 46
46 canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50), 47 canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50),
47 SkIntToScalar(30), paint); 48 SkIntToScalar(30), paint);
48 49
49 canvas->drawRectCoords(SkIntToScalar(150), SkIntToScalar(50), 50 canvas->drawRectCoords(SkIntToScalar(150), SkIntToScalar(50),
50 SkIntToScalar(200), SkIntToScalar(100), paint); 51 SkIntToScalar(200), SkIntToScalar(100), paint);
51 52
52 canvas->drawText("Looper", 6, SkIntToScalar(230), SkIntToScalar(100), 53 canvas->drawText("Looper", 6, SkIntToScalar(230), SkIntToScalar(100),
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 fLooper = looperBuilder.detachLooper(); 94 fLooper = looperBuilder.detachLooper();
94 } 95 }
95 96
96 typedef GM INHERITED; 97 typedef GM INHERITED;
97 }; 98 };
98 99
99 ////////////////////////////////////////////////////////////////////////////// 100 //////////////////////////////////////////////////////////////////////////////
100 101
101 static skiagm::GM* MyFactory(void*) { return new DrawLooperGM; } 102 static skiagm::GM* MyFactory(void*) { return new DrawLooperGM; }
102 static skiagm::GMRegistry reg(MyFactory); 103 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/drawbitmaprect.cpp ('k') | gm/dropshadowimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698