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

Side by Side Diff: gm/imagefiltersbase.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/imageblurtiled.cpp ('k') | gm/imagefilterscropped.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 paint.setImageFilter(imf); 106 paint.setImageFilter(imf);
107 paint.setAntiAlias(true); 107 paint.setAntiAlias(true);
108 canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, paint); 108 canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, paint);
109 } 109 }
110 110
111 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { 111 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
112 SkPaint paint; 112 SkPaint paint;
113 paint.setImageFilter(imf); 113 paint.setImageFilter(imf);
114 paint.setColor(SK_ColorCYAN); 114 paint.setColor(SK_ColorCYAN);
115 paint.setAntiAlias(true); 115 paint.setAntiAlias(true);
116 sk_tool_utils::set_portable_typeface(&paint);
116 paint.setTextSize(r.height()/2); 117 paint.setTextSize(r.height()/2);
117 paint.setTextAlign(SkPaint::kCenter_Align); 118 paint.setTextAlign(SkPaint::kCenter_Align);
118 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint); 119 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint);
119 } 120 }
120 121
121 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { 122 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
122 SkPaint paint; 123 SkPaint paint;
123 paint.setImageFilter(imf); 124 paint.setImageFilter(imf);
124 125
125 SkIRect bounds; 126 SkIRect bounds;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 227 }
227 228
228 private: 229 private:
229 typedef GM INHERITED; 230 typedef GM INHERITED;
230 }; 231 };
231 232
232 /////////////////////////////////////////////////////////////////////////////// 233 ///////////////////////////////////////////////////////////////////////////////
233 234
234 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } 235 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; }
235 static skiagm::GMRegistry reg(MyFactory); 236 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/imageblurtiled.cpp ('k') | gm/imagefilterscropped.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698