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

Side by Side Diff: gm/downsamplebitmap.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/deviceproperties.cpp ('k') | gm/drawbitmaprect.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 "Resources.h" 10 #include "Resources.h"
11 #include "SkGradientShader.h" 11 #include "SkGradientShader.h"
12 #include "SkTypeface.h" 12 #include "SkTypeface.h"
13 #include "SkImageDecoder.h" 13 #include "SkImageDecoder.h"
14 #include "SkStream.h" 14 #include "SkStream.h"
15 #include "SkPaint.h" 15 #include "SkPaint.h"
16 16
17 static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style sty le) { 17 static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style sty le) {
18 SkSafeUnref(paint->setTypeface(SkTypeface::CreateFromName(name, style))); 18 sk_tool_utils::set_portable_typeface(paint, name, style);
19 } 19 }
20 20
21 class DownsampleBitmapGM : public skiagm::GM { 21 class DownsampleBitmapGM : public skiagm::GM {
22 public: 22 public:
23 SkBitmap fBM; 23 SkBitmap fBM;
24 SkString fName; 24 SkString fName;
25 bool fBitmapMade; 25 bool fBitmapMade;
26 SkPaint::FilterLevel fFilterLevel; 26 SkPaint::FilterLevel fFilterLevel;
27 27
28 DownsampleBitmapGM(SkPaint::FilterLevel filterLevel) 28 DownsampleBitmapGM(SkPaint::FilterLevel filterLevel)
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kMedium_Filt erLevel); ) 202 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kMedium_Filt erLevel); )
203 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kMedium_ FilterLevel); ) 203 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kMedium_ FilterLevel); )
204 204
205 DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kLow_FilterLevel); ) 205 DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kLow_FilterLevel); )
206 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kLow_FilterL evel); ) 206 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kLow_FilterL evel); )
207 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kLow_Fil terLevel); ) 207 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kLow_Fil terLevel); )
208 208
209 DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kNone_FilterLevel); ) 209 DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kNone_FilterLevel); )
210 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kNone_Filter Level); ) 210 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kNone_Filter Level); )
211 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kNone_Fi lterLevel); ) 211 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kNone_Fi lterLevel); )
OLDNEW
« no previous file with comments | « gm/deviceproperties.cpp ('k') | gm/drawbitmaprect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698