| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 canvas->translate(SkIntToScalar(bm.width() * 4), 0); | 74 canvas->translate(SkIntToScalar(bm.width() * 4), 0); |
| 75 matrix.reset(); | 75 matrix.reset(); |
| 76 matrix.setSinCos(SK_ScalarHalf, SkIntToScalar(2)); | 76 matrix.setSinCos(SK_ScalarHalf, SkIntToScalar(2)); |
| 77 canvas->drawBitmapMatrix(bm, matrix, &paint); | 77 canvas->drawBitmapMatrix(bm, matrix, &paint); |
| 78 | 78 |
| 79 { | 79 { |
| 80 // test the following code path: | 80 // test the following code path: |
| 81 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() | 81 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() |
| 82 SkPaint paint; | 82 SkPaint paint; |
| 83 | 83 |
| 84 paint.setFilterBitmap(true); | 84 paint.setFilterLevel(SkPaint::kLow_FilterLevel); |
| 85 | 85 |
| 86 SkMaskFilter* mf = SkBlurMaskFilter::Create( | 86 SkMaskFilter* mf = SkBlurMaskFilter::Create( |
| 87 SkBlurMaskFilter::kNormal_BlurStyle, | 87 SkBlurMaskFilter::kNormal_BlurStyle, |
| 88 SkBlurMask::ConvertRadiusToSigma(5), | 88 SkBlurMask::ConvertRadiusToSigma(5), |
| 89 SkBlurMaskFilter::kHighQuality_BlurFlag | | 89 SkBlurMaskFilter::kHighQuality_BlurFlag | |
| 90 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); | 90 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); |
| 91 paint.setMaskFilter(mf)->unref(); | 91 paint.setMaskFilter(mf)->unref(); |
| 92 | 92 |
| 93 canvas->translate(SkIntToScalar(bm.width()*2 + 20), 0); | 93 canvas->translate(SkIntToScalar(bm.width()*2 + 20), 0); |
| 94 | 94 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 123 canvas.drawPath(path, paint); | 123 canvas.drawPath(path, paint); |
| 124 } | 124 } |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 //////////////////////////////////////////////////////////////////////////////// | 127 //////////////////////////////////////////////////////////////////////////////// |
| 128 | 128 |
| 129 static GM* MyFactory(void*) { return new DrawBitmapMatrixGM; } | 129 static GM* MyFactory(void*) { return new DrawBitmapMatrixGM; } |
| 130 static GMRegistry reg(MyFactory); | 130 static GMRegistry reg(MyFactory); |
| 131 | 131 |
| 132 } | 132 } |
| OLD | NEW |