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

Side by Side Diff: gm/filterbitmap.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/emptypath.cpp ('k') | gm/fontcache.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 9
10 #include "Resources.h" 10 #include "Resources.h"
11 #include "SkGradientShader.h" 11 #include "SkGradientShader.h"
12 #include "SkImageDecoder.h" 12 #include "SkImageDecoder.h"
13 #include "SkStream.h" 13 #include "SkStream.h"
14 #include "SkTypeface.h" 14 #include "SkTypeface.h"
15 15
16 static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style sty le) { 16 static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style sty le) {
17 SkSafeUnref(paint->setTypeface(SkTypeface::CreateFromName(name, style))); 17 sk_tool_utils::set_portable_typeface(paint, name, style);
18 } 18 }
19 19
20 static SkSize computeSize(const SkBitmap& bm, const SkMatrix& mat) { 20 static SkSize computeSize(const SkBitmap& bm, const SkMatrix& mat) {
21 SkRect bounds = SkRect::MakeWH(SkIntToScalar(bm.width()), 21 SkRect bounds = SkRect::MakeWH(SkIntToScalar(bm.width()),
22 SkIntToScalar(bm.height())); 22 SkIntToScalar(bm.height()));
23 mat.mapRect(&bounds); 23 mat.mapRect(&bounds);
24 return SkSize::Make(bounds.width(), bounds.height()); 24 return SkSize::Make(bounds.width(), bounds.height());
25 } 25 }
26 26
27 static void draw_row(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, SkScalar dx) { 27 static void draw_row(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, SkScalar dx) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 DEF_GM( return new FilterBitmapCheckerboardGM(32,32); ) 223 DEF_GM( return new FilterBitmapCheckerboardGM(32,32); )
224 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) 224 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); )
225 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) 225 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); )
226 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) 226 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); )
227 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) 227 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); )
228 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) 228 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); )
229 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) 229 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); )
230 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) 230 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); )
231 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) 231 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); )
232 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) 232 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); )
OLDNEW
« no previous file with comments | « gm/emptypath.cpp ('k') | gm/fontcache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698