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

Side by Side Diff: gm/dropshadowimagefilter.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/drawlooper.cpp ('k') | gm/emptypath.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 "SkColorFilter.h" 9 #include "SkColorFilter.h"
10 10
(...skipping 21 matching lines...) Expand all
32 canvas->clipRect(r); 32 canvas->clipRect(r);
33 canvas->drawCircle(r.centerX(), r.centerY(), r.width()/3, paint); 33 canvas->drawCircle(r.centerX(), r.centerY(), r.width()/3, paint);
34 canvas->restore(); 34 canvas->restore();
35 } 35 }
36 36
37 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { 37 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
38 SkPaint paint; 38 SkPaint paint;
39 paint.setImageFilter(imf); 39 paint.setImageFilter(imf);
40 paint.setColor(SK_ColorGREEN); 40 paint.setColor(SK_ColorGREEN);
41 paint.setAntiAlias(true); 41 paint.setAntiAlias(true);
42 sk_tool_utils::set_portable_typeface(&paint);
42 paint.setTextSize(r.height()/2); 43 paint.setTextSize(r.height()/2);
43 paint.setTextAlign(SkPaint::kCenter_Align); 44 paint.setTextAlign(SkPaint::kCenter_Align);
44 canvas->save(); 45 canvas->save();
45 canvas->clipRect(r); 46 canvas->clipRect(r);
46 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint); 47 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint);
47 canvas->restore(); 48 canvas->restore();
48 } 49 }
49 50
50 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { 51 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
51 SkPaint paint; 52 SkPaint paint;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 164 }
164 165
165 private: 166 private:
166 typedef GM INHERITED; 167 typedef GM INHERITED;
167 }; 168 };
168 169
169 /////////////////////////////////////////////////////////////////////////////// 170 ///////////////////////////////////////////////////////////////////////////////
170 171
171 static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; } 172 static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; }
172 static skiagm::GMRegistry reg(MyFactory); 173 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/drawlooper.cpp ('k') | gm/emptypath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698