OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |