OLD | NEW |
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 "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 } gRecs[] = { | 33 } gRecs[] = { |
34 { NONE, 0, 0 }, | 34 { NONE, 0, 0 }, |
35 { kInner_SkBlurStyle, -1, 0 }, | 35 { kInner_SkBlurStyle, -1, 0 }, |
36 { kNormal_SkBlurStyle, 0, 1 }, | 36 { kNormal_SkBlurStyle, 0, 1 }, |
37 { kSolid_SkBlurStyle, 0, -1 }, | 37 { kSolid_SkBlurStyle, 0, -1 }, |
38 { kOuter_SkBlurStyle, 1, 0 }, | 38 { kOuter_SkBlurStyle, 1, 0 }, |
39 }; | 39 }; |
40 | 40 |
41 SkPaint paint; | 41 SkPaint paint; |
42 paint.setAntiAlias(true); | 42 paint.setAntiAlias(true); |
43 sk_tool_utils::set_portable_typeface(&paint); | 43 sk_tool_utils::set_portable_typeface_always(&paint); |
44 paint.setTextSize(SkIntToScalar(25)); | 44 paint.setTextSize(SkIntToScalar(25)); |
45 canvas->translate(SkIntToScalar(-40), SkIntToScalar(0)); | 45 canvas->translate(SkIntToScalar(-40), SkIntToScalar(0)); |
46 | 46 |
47 SkBlurMaskFilter::BlurFlags flags = SkBlurMaskFilter::kNone_BlurFlag; | 47 SkBlurMaskFilter::BlurFlags flags = SkBlurMaskFilter::kNone_BlurFlag; |
48 for (int j = 0; j < 2; j++) { | 48 for (int j = 0; j < 2; j++) { |
49 canvas->save(); | 49 canvas->save(); |
50 paint.setColor(SK_ColorBLUE); | 50 paint.setColor(SK_ColorBLUE); |
51 for (size_t i = 0; i < SK_ARRAY_COUNT(gRecs); i++) { | 51 for (size_t i = 0; i < SK_ARRAY_COUNT(gRecs); i++) { |
52 if (gRecs[i].fStyle != NONE) { | 52 if (gRecs[i].fStyle != NONE) { |
53 SkMaskFilter* mf = SkBlurMaskFilter::Create(gRecs[i].fStyle, | 53 SkMaskFilter* mf = SkBlurMaskFilter::Create(gRecs[i].fStyle, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 canvas->translate(dx, 0); | 157 canvas->translate(dx, 0); |
158 canvas->drawPath(path, paint); | 158 canvas->drawPath(path, paint); |
159 | 159 |
160 // Translate to outside of clip bounds. | 160 // Translate to outside of clip bounds. |
161 canvas->translate(-dx, 0); | 161 canvas->translate(-dx, 0); |
162 canvas->translate(-30, -150); | 162 canvas->translate(-30, -150); |
163 canvas->drawPath(path, paint); | 163 canvas->drawPath(path, paint); |
164 } | 164 } |
165 }; | 165 }; |
166 DEF_GM( return new Blur2RectsNonNinePatchGM; ) | 166 DEF_GM( return new Blur2RectsNonNinePatchGM; ) |
OLD | NEW |