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

Side by Side Diff: gm/blurs.cpp

Issue 348323003: use platform-independent font for gm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add include tools for skimage Created 6 years, 6 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/bitmapsource.cpp ('k') | gm/complexclip.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 27 matching lines...) Expand all
38 } gRecs[] = { 38 } gRecs[] = {
39 { NONE, 0, 0 }, 39 { NONE, 0, 0 },
40 { kInner_SkBlurStyle, -1, 0 }, 40 { kInner_SkBlurStyle, -1, 0 },
41 { kNormal_SkBlurStyle, 0, 1 }, 41 { kNormal_SkBlurStyle, 0, 1 },
42 { kSolid_SkBlurStyle, 0, -1 }, 42 { kSolid_SkBlurStyle, 0, -1 },
43 { kOuter_SkBlurStyle, 1, 0 }, 43 { kOuter_SkBlurStyle, 1, 0 },
44 }; 44 };
45 45
46 SkPaint paint; 46 SkPaint paint;
47 paint.setAntiAlias(true); 47 paint.setAntiAlias(true);
48 sk_tool_utils::set_portable_typeface(&paint);
48 paint.setTextSize(SkIntToScalar(25)); 49 paint.setTextSize(SkIntToScalar(25));
49 canvas->translate(SkIntToScalar(-40), SkIntToScalar(0)); 50 canvas->translate(SkIntToScalar(-40), SkIntToScalar(0));
50 51
51 SkBlurMaskFilter::BlurFlags flags = SkBlurMaskFilter::kNone_BlurFlag; 52 SkBlurMaskFilter::BlurFlags flags = SkBlurMaskFilter::kNone_BlurFlag;
52 for (int j = 0; j < 2; j++) { 53 for (int j = 0; j < 2; j++) {
53 canvas->save(); 54 canvas->save();
54 paint.setColor(SK_ColorBLUE); 55 paint.setColor(SK_ColorBLUE);
55 for (size_t i = 0; i < SK_ARRAY_COUNT(gRecs); i++) { 56 for (size_t i = 0; i < SK_ARRAY_COUNT(gRecs); i++) {
56 if (gRecs[i].fStyle != NONE) { 57 if (gRecs[i].fStyle != NONE) {
57 SkMaskFilter* mf = SkBlurMaskFilter::Create(gRecs[i].fStyle, 58 SkMaskFilter* mf = SkBlurMaskFilter::Create(gRecs[i].fStyle,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 private: 94 private:
94 typedef GM INHERITED; 95 typedef GM INHERITED;
95 }; 96 };
96 97
97 ////////////////////////////////////////////////////////////////////////////// 98 //////////////////////////////////////////////////////////////////////////////
98 99
99 static GM* MyFactory(void*) { return new BlursGM; } 100 static GM* MyFactory(void*) { return new BlursGM; }
100 static GMRegistry reg(MyFactory); 101 static GMRegistry reg(MyFactory);
101 102
102 } 103 }
OLDNEW
« no previous file with comments | « gm/bitmapsource.cpp ('k') | gm/complexclip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698