| 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 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() | 156 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() |
| 157 SkIRect srcRect; | 157 SkIRect srcRect; |
| 158 SkPaint paint; | 158 SkPaint paint; |
| 159 SkBitmap bm; | 159 SkBitmap bm; |
| 160 | 160 |
| 161 bm = make_chessbm(5, 5); | 161 bm = make_chessbm(5, 5); |
| 162 paint.setFilterLevel(SkPaint::kLow_FilterLevel); | 162 paint.setFilterLevel(SkPaint::kLow_FilterLevel); |
| 163 | 163 |
| 164 srcRect.setXYWH(1, 1, 3, 3); | 164 srcRect.setXYWH(1, 1, 3, 3); |
| 165 SkMaskFilter* mf = SkBlurMaskFilter::Create( | 165 SkMaskFilter* mf = SkBlurMaskFilter::Create( |
| 166 SkBlurMaskFilter::kNormal_BlurStyle, | 166 kNormal_SkBlurStyle, |
| 167 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), | 167 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), |
| 168 SkBlurMaskFilter::kHighQuality_BlurFlag | | 168 SkBlurMaskFilter::kHighQuality_BlurFlag | |
| 169 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); | 169 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); |
| 170 paint.setMaskFilter(mf)->unref(); | 170 paint.setMaskFilter(mf)->unref(); |
| 171 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint); | 171 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 | 174 |
| 175 private: | 175 private: |
| 176 typedef GM INHERITED; | 176 typedef GM INHERITED; |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 ////////////////////////////////////////////////////////////////////////////// | 179 ////////////////////////////////////////////////////////////////////////////// |
| 180 | 180 |
| 181 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } | 181 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } |
| 182 static GMRegistry reg(MyFactory); | 182 static GMRegistry reg(MyFactory); |
| 183 } | 183 } |
| OLD | NEW |