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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 210 } |
211 | 211 |
212 { | 212 { |
213 // test the following code path: | 213 // test the following code path: |
214 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() | 214 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() |
215 SkIRect srcRect; | 215 SkIRect srcRect; |
216 SkPaint paint; | 216 SkPaint paint; |
217 SkBitmap bm; | 217 SkBitmap bm; |
218 | 218 |
219 bm = make_chessbm(5, 5); | 219 bm = make_chessbm(5, 5); |
220 paint.setFilterLevel(SkPaint::kLow_FilterLevel); | 220 paint.setFilterQuality(kLow_SkFilterQuality); |
221 | 221 |
222 srcRect.setXYWH(1, 1, 3, 3); | 222 srcRect.setXYWH(1, 1, 3, 3); |
223 SkMaskFilter* mf = SkBlurMaskFilter::Create( | 223 SkMaskFilter* mf = SkBlurMaskFilter::Create( |
224 kNormal_SkBlurStyle, | 224 kNormal_SkBlurStyle, |
225 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), | 225 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), |
226 SkBlurMaskFilter::kHighQuality_BlurFlag | | 226 SkBlurMaskFilter::kHighQuality_BlurFlag | |
227 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); | 227 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); |
228 paint.setMaskFilter(mf)->unref(); | 228 paint.setMaskFilter(mf)->unref(); |
229 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint); | 229 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint); |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
233 private: | 233 private: |
234 typedef skiagm::GM INHERITED; | 234 typedef skiagm::GM INHERITED; |
235 }; | 235 }; |
236 | 236 |
237 DEF_GM( return new DrawBitmapRectGM(canvasproc, NULL); ) | 237 DEF_GM( return new DrawBitmapRectGM(canvasproc, NULL); ) |
238 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); ) | 238 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); ) |
239 DEF_GM( return new DrawBitmapRectGM(imagescaleproc, "-imagescale"); ) | 239 DEF_GM( return new DrawBitmapRectGM(imagescaleproc, "-imagescale"); ) |
OLD | NEW |