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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 { | 158 { |
159 // test the following code path: | 159 // test the following code path: |
160 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() | 160 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() |
161 SkIRect srcRect; | 161 SkIRect srcRect; |
162 SkPaint paint; | 162 SkPaint paint; |
163 SkBitmap bm; | 163 SkBitmap bm; |
164 | 164 |
165 bm = make_chessbm(5, 5); | 165 bm = make_chessbm(5, 5); |
166 paint.setFilterBitmap(true); | 166 paint.setFilterLevel(SkPaint::kLow_FilterLevel); |
167 | 167 |
168 srcRect.setXYWH(1, 1, 3, 3); | 168 srcRect.setXYWH(1, 1, 3, 3); |
169 SkMaskFilter* mf = SkBlurMaskFilter::Create( | 169 SkMaskFilter* mf = SkBlurMaskFilter::Create( |
170 SkBlurMaskFilter::kNormal_BlurStyle, | 170 SkBlurMaskFilter::kNormal_BlurStyle, |
171 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), | 171 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), |
172 SkBlurMaskFilter::kHighQuality_BlurFlag | | 172 SkBlurMaskFilter::kHighQuality_BlurFlag | |
173 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); | 173 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); |
174 paint.setMaskFilter(mf)->unref(); | 174 paint.setMaskFilter(mf)->unref(); |
175 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint); | 175 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint); |
176 } | 176 } |
177 } | 177 } |
178 | 178 |
179 private: | 179 private: |
180 typedef GM INHERITED; | 180 typedef GM INHERITED; |
181 }; | 181 }; |
182 | 182 |
183 ////////////////////////////////////////////////////////////////////////////// | 183 ////////////////////////////////////////////////////////////////////////////// |
184 | 184 |
185 #ifndef SK_BUILD_FOR_ANDROID | 185 #ifndef SK_BUILD_FOR_ANDROID |
186 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } | 186 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } |
187 static GMRegistry reg(MyFactory); | 187 static GMRegistry reg(MyFactory); |
188 #endif | 188 #endif |
189 } | 189 } |
OLD | NEW |