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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 blurPaint.setMaskFilter(SkBlurMaskFilter::Make((SkBlurStyle)j, k
Sigma)); | 73 blurPaint.setMaskFilter(SkBlurMaskFilter::Make((SkBlurStyle)j, k
Sigma)); |
74 | 74 |
75 for (int k = 0; k < (int)SK_ARRAY_COUNT(origins); ++k) { | 75 for (int k = 0; k < (int)SK_ARRAY_COUNT(origins); ++k) { |
76 canvas->save(); | 76 canvas->save(); |
77 | 77 |
78 SkRect clipRect = SkRect::MakeXYWH(SkIntToScalar(desiredX), | 78 SkRect clipRect = SkRect::MakeXYWH(SkIntToScalar(desiredX), |
79 SkIntToScalar(desiredY), | 79 SkIntToScalar(desiredY), |
80 SkIntToScalar(kCloseUpSiz
e), | 80 SkIntToScalar(kCloseUpSiz
e), |
81 SkIntToScalar(kCloseUpSiz
e)); | 81 SkIntToScalar(kCloseUpSiz
e)); |
82 | 82 |
83 canvas->clipRect(clipRect, SkRegion::kReplace_Op, false); | 83 canvas->clipRect(clipRect, SkCanvas::kReplace_Op, false); |
84 | 84 |
85 canvas->translate(desiredX-origins[k].fX, | 85 canvas->translate(desiredX-origins[k].fX, |
86 desiredY-origins[k].fY); | 86 desiredY-origins[k].fY); |
87 | 87 |
88 if (0 == i) { | 88 if (0 == i) { |
89 canvas->drawRect(bigRect, blurPaint); | 89 canvas->drawRect(bigRect, blurPaint); |
90 } else { | 90 } else { |
91 canvas->drawPath(rectori, blurPaint); | 91 canvas->drawPath(rectori, blurPaint); |
92 } | 92 } |
93 canvas->restore(); | 93 canvas->restore(); |
(...skipping 11 matching lines...) Expand all Loading... |
105 private: | 105 private: |
106 static constexpr int kCloseUpSize = 64; | 106 static constexpr int kCloseUpSize = 64; |
107 static constexpr int kWidth = 5 * kCloseUpSize; | 107 static constexpr int kWidth = 5 * kCloseUpSize; |
108 static constexpr int kHeight = 2 * (kLastEnum_SkBlurStyle + 1) * kCloseUpSiz
e; | 108 static constexpr int kHeight = 2 * (kLastEnum_SkBlurStyle + 1) * kCloseUpSiz
e; |
109 | 109 |
110 typedef GM INHERITED; | 110 typedef GM INHERITED; |
111 }; | 111 }; |
112 | 112 |
113 DEF_GM(return new BigBlursGM;) | 113 DEF_GM(return new BigBlursGM;) |
114 } | 114 } |
OLD | NEW |