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

Side by Side Diff: gm/pictureimagefilter.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/pathreverse.cpp ('k') | gm/poly2poly.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 9
10 #include "SkPictureImageFilter.h" 10 #include "SkPictureImageFilter.h"
(...skipping 10 matching lines...) Expand all
21 virtual SkString onShortName() SK_OVERRIDE { 21 virtual SkString onShortName() SK_OVERRIDE {
22 return SkString("pictureimagefilter"); 22 return SkString("pictureimagefilter");
23 } 23 }
24 24
25 void makePicture() { 25 void makePicture() {
26 SkPictureRecorder recorder; 26 SkPictureRecorder recorder;
27 SkCanvas* canvas = recorder.beginRecording(100, 100, NULL, 0); 27 SkCanvas* canvas = recorder.beginRecording(100, 100, NULL, 0);
28 canvas->clear(0x00000000); 28 canvas->clear(0x00000000);
29 SkPaint paint; 29 SkPaint paint;
30 paint.setAntiAlias(true); 30 paint.setAntiAlias(true);
31 sk_tool_utils::set_portable_typeface(&paint);
31 paint.setColor(0xFFFFFFFF); 32 paint.setColor(0xFFFFFFFF);
32 paint.setTextSize(SkIntToScalar(96)); 33 paint.setTextSize(SkIntToScalar(96));
33 const char* str = "e"; 34 const char* str = "e";
34 canvas->drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint); 35 canvas->drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
35 fPicture.reset(recorder.endRecording()); 36 fPicture.reset(recorder.endRecording());
36 } 37 }
37 38
38 virtual SkISize onISize() SK_OVERRIDE { return SkISize::Make(500, 150); } 39 virtual SkISize onISize() SK_OVERRIDE { return SkISize::Make(500, 150); }
39 40
40 virtual void onOnceBeforeDraw() SK_OVERRIDE { 41 virtual void onOnceBeforeDraw() SK_OVERRIDE {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 85 }
85 86
86 private: 87 private:
87 SkAutoTUnref<SkPicture> fPicture; 88 SkAutoTUnref<SkPicture> fPicture;
88 typedef GM INHERITED; 89 typedef GM INHERITED;
89 }; 90 };
90 91
91 /////////////////////////////////////////////////////////////////////////////// 92 ///////////////////////////////////////////////////////////////////////////////
92 93
93 DEF_GM( return new PictureImageFilterGM; ) 94 DEF_GM( return new PictureImageFilterGM; )
OLDNEW
« no previous file with comments | « gm/pathreverse.cpp ('k') | gm/poly2poly.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698