OLD | NEW |
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 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 outlinePaint.setStyle(SkPaint::kStroke_Style); | 63 outlinePaint.setStyle(SkPaint::kStroke_Style); |
64 | 64 |
65 SkPaint blurPaint; | 65 SkPaint blurPaint; |
66 blurPaint.setAntiAlias(true); | 66 blurPaint.setAntiAlias(true); |
67 blurPaint.setColor(SK_ColorBLACK); | 67 blurPaint.setColor(SK_ColorBLACK); |
68 | 68 |
69 int desiredX = 0, desiredY = 0; | 69 int desiredX = 0, desiredY = 0; |
70 | 70 |
71 for (int i = 0; i < 2; ++i) { | 71 for (int i = 0; i < 2; ++i) { |
72 for (int j = 0; j <= kLastEnum_SkBlurStyle; ++j) { | 72 for (int j = 0; j <= kLastEnum_SkBlurStyle; ++j) { |
73 SkMaskFilter* mf = SkBlurMaskFilter::Create((SkBlurStyle)j, kSig
ma); | 73 blurPaint.setMaskFilter(SkBlurMaskFilter::Make((SkBlurStyle)j, k
Sigma)); |
74 blurPaint.setMaskFilter(mf)->unref(); | |
75 | 74 |
76 for (int k = 0; k < (int)SK_ARRAY_COUNT(origins); ++k) { | 75 for (int k = 0; k < (int)SK_ARRAY_COUNT(origins); ++k) { |
77 canvas->save(); | 76 canvas->save(); |
78 | 77 |
79 SkRect clipRect = SkRect::MakeXYWH(SkIntToScalar(desiredX), | 78 SkRect clipRect = SkRect::MakeXYWH(SkIntToScalar(desiredX), |
80 SkIntToScalar(desiredY), | 79 SkIntToScalar(desiredY), |
81 SkIntToScalar(kCloseUpSiz
e), | 80 SkIntToScalar(kCloseUpSiz
e), |
82 SkIntToScalar(kCloseUpSiz
e)); | 81 SkIntToScalar(kCloseUpSiz
e)); |
83 | 82 |
84 canvas->clipRect(clipRect, SkRegion::kReplace_Op, false); | 83 canvas->clipRect(clipRect, SkRegion::kReplace_Op, false); |
(...skipping 21 matching lines...) Expand all Loading... |
106 private: | 105 private: |
107 static const int kCloseUpSize = 64; | 106 static const int kCloseUpSize = 64; |
108 static const int kWidth = 5 * kCloseUpSize; | 107 static const int kWidth = 5 * kCloseUpSize; |
109 static const int kHeight = 2 * (kLastEnum_SkBlurStyle + 1) * kCloseUpSize; | 108 static const int kHeight = 2 * (kLastEnum_SkBlurStyle + 1) * kCloseUpSize; |
110 | 109 |
111 typedef GM INHERITED; | 110 typedef GM INHERITED; |
112 }; | 111 }; |
113 | 112 |
114 DEF_GM(return new BigBlursGM;) | 113 DEF_GM(return new BigBlursGM;) |
115 } | 114 } |
OLD | NEW |