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 | |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 11 | #include "GrTypes.h" |
| 12 | |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 13 | class GrClip; |
| 14 | class GrContext; |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 15 | class GrPaint; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 16 | class GrRenderTarget; |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 17 | class GrRenderTargetContext; |
bsalomon | 6663acf | 2016-05-10 09:14:17 -0700 | [diff] [blame] | 18 | class GrStyle; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 19 | struct SkIRect; |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 20 | class SkMaskFilter; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 21 | class SkMatrix; |
| 22 | class SkPaint; |
| 23 | class SkPath; |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 24 | class SkPathEffect; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 25 | |
| 26 | |
| 27 | /** |
| 28 | * Blur utilities. |
| 29 | */ |
| 30 | namespace GrBlurUtils { |
| 31 | /** |
| 32 | * Draw a path handling the mask filter if present. |
| 33 | */ |
| 34 | void drawPathWithMaskFilter(GrContext* context, |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 35 | GrRenderTargetContext* renderTargetContext, |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 36 | const GrClip& clip, |
| 37 | const SkPath& origSrcPath, |
| 38 | const SkPaint& paint, |
| 39 | const SkMatrix& origViewMatrix, |
| 40 | const SkMatrix* prePathMatrix, |
| 41 | const SkIRect& clipBounds, |
| 42 | bool pathIsMutable); |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 43 | |
| 44 | /** |
| 45 | * Draw a path handling the mask filter. The mask filter is not optional. The path effect is |
| 46 | * optional. The GrPaint will be modified after return. |
| 47 | */ |
| 48 | void drawPathWithMaskFilter(GrContext*, |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 49 | GrRenderTargetContext*, |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 50 | const GrClip&, |
| 51 | const SkPath& path, |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 52 | GrPaint&&, |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 53 | GrAA, |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 54 | const SkMatrix& viewMatrix, |
| 55 | const SkMaskFilter*, |
bsalomon | 6663acf | 2016-05-10 09:14:17 -0700 | [diff] [blame] | 56 | const GrStyle&, |
robertphillips | 0e7029e | 2015-11-30 05:45:06 -0800 | [diff] [blame] | 57 | bool pathIsMutable); |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | #endif |