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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // test the following code path: | 204 // test the following code path: |
205 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() | 205 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() |
206 SkIRect srcRect; | 206 SkIRect srcRect; |
207 SkPaint paint; | 207 SkPaint paint; |
208 SkBitmap bm; | 208 SkBitmap bm; |
209 | 209 |
210 bm = make_chessbm(5, 5); | 210 bm = make_chessbm(5, 5); |
211 paint.setFilterQuality(kLow_SkFilterQuality); | 211 paint.setFilterQuality(kLow_SkFilterQuality); |
212 | 212 |
213 srcRect.setXYWH(1, 1, 3, 3); | 213 srcRect.setXYWH(1, 1, 3, 3); |
214 SkMaskFilter* mf = SkBlurMaskFilter::Create( | 214 paint.setMaskFilter(SkBlurMaskFilter::Make( |
215 kNormal_SkBlurStyle, | 215 kNormal_SkBlurStyle, |
216 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), | 216 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), |
217 SkBlurMaskFilter::kHighQuality_BlurFlag | | 217 SkBlurMaskFilter::kHighQuality_BlurFlag | |
218 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); | 218 SkBlurMaskFilter::kIgnoreTransform_BlurFlag)); |
219 paint.setMaskFilter(mf)->unref(); | |
220 canvas->drawBitmapRect(bm, srcRect, dstRect, &paint); | 219 canvas->drawBitmapRect(bm, srcRect, dstRect, &paint); |
221 } | 220 } |
222 } | 221 } |
223 | 222 |
224 private: | 223 private: |
225 typedef skiagm::GM INHERITED; | 224 typedef skiagm::GM INHERITED; |
226 }; | 225 }; |
227 | 226 |
228 DEF_GM( return new DrawBitmapRectGM(canvasproc, nullptr); ) | 227 DEF_GM( return new DrawBitmapRectGM(canvasproc, nullptr); ) |
229 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); ) | 228 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); ) |
OLD | NEW |