robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrBlurUtils_DEFINED |
| 9 | #define GrBlurUtils_DEFINED |
| 10 | |
| 11 | class GrClip; |
| 12 | class GrContext; |
| 13 | class GrDrawContext; |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 14 | class GrPaint; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 15 | class GrRenderTarget; |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 16 | class GrStrokeInfo; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 17 | struct SkIRect; |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 18 | class SkMaskFilter; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 19 | class SkMatrix; |
| 20 | class SkPaint; |
| 21 | class SkPath; |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 22 | class SkPathEffect; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 23 | |
| 24 | |
| 25 | /** |
| 26 | * Blur utilities. |
| 27 | */ |
| 28 | namespace GrBlurUtils { |
| 29 | /** |
| 30 | * Draw a path handling the mask filter if present. |
| 31 | */ |
| 32 | void drawPathWithMaskFilter(GrContext* context, |
| 33 | GrDrawContext* drawContext, |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 34 | const GrClip& clip, |
| 35 | const SkPath& origSrcPath, |
| 36 | const SkPaint& paint, |
| 37 | const SkMatrix& origViewMatrix, |
| 38 | const SkMatrix* prePathMatrix, |
| 39 | const SkIRect& clipBounds, |
| 40 | bool pathIsMutable); |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 41 | |
| 42 | /** |
| 43 | * Draw a path handling the mask filter. The mask filter is not optional. The path effect is |
| 44 | * optional. The GrPaint will be modified after return. |
| 45 | */ |
| 46 | void drawPathWithMaskFilter(GrContext*, |
| 47 | GrDrawContext*, |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 48 | const GrClip&, |
| 49 | const SkPath& path, |
| 50 | GrPaint*, |
| 51 | const SkMatrix& viewMatrix, |
| 52 | const SkMaskFilter*, |
| 53 | const SkPathEffect*, |
robertphillips | 0e7029e | 2015-11-30 05:45:06 -0800 | [diff] [blame] | 54 | const GrStrokeInfo&, |
| 55 | bool pathIsMutable); |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 56 | |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | #endif |