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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/private/GrTypesPriv.h" |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 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; |
Robert Phillips | 7af8fe5 | 2019-02-14 17:27:00 -0500 | [diff] [blame] | 16 | class GrRecordingContext; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 17 | class GrRenderTarget; |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 18 | class GrRenderTargetContext; |
Robert Phillips | 27927a5 | 2018-08-20 13:18:12 -0400 | [diff] [blame] | 19 | class GrShape; |
bsalomon | 6663acf | 2016-05-10 09:14:17 -0700 | [diff] [blame] | 20 | class GrStyle; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 21 | struct SkIRect; |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 22 | class SkMaskFilter; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 23 | class SkMatrix; |
| 24 | class SkPaint; |
| 25 | class SkPath; |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 26 | class SkPathEffect; |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 27 | |
| 28 | |
| 29 | /** |
| 30 | * Blur utilities. |
| 31 | */ |
| 32 | namespace GrBlurUtils { |
| 33 | /** |
Robert Phillips | 27927a5 | 2018-08-20 13:18:12 -0400 | [diff] [blame] | 34 | * Draw a shape handling the mask filter if present. |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 35 | */ |
Robert Phillips | 6989370 | 2019-02-22 11:16:30 -0500 | [diff] [blame] | 36 | void drawShapeWithMaskFilter(GrRecordingContext*, |
Robert Phillips | 27927a5 | 2018-08-20 13:18:12 -0400 | [diff] [blame] | 37 | GrRenderTargetContext*, |
| 38 | const GrClip&, |
| 39 | const SkPaint&, |
| 40 | const SkMatrix& viewMatrix, |
| 41 | const GrShape&); |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 42 | |
| 43 | /** |
Robert Phillips | 27927a5 | 2018-08-20 13:18:12 -0400 | [diff] [blame] | 44 | * Draw a shape handling the mask filter. The mask filter is not optional. |
Robert Phillips | 20390c3 | 2018-08-17 11:01:03 -0400 | [diff] [blame] | 45 | * The GrPaint will be modified after return. |
bsalomon | c55271f | 2015-11-09 11:55:57 -0800 | [diff] [blame] | 46 | */ |
Robert Phillips | 7af8fe5 | 2019-02-14 17:27:00 -0500 | [diff] [blame] | 47 | void drawShapeWithMaskFilter(GrRecordingContext*, |
Robert Phillips | 27927a5 | 2018-08-20 13:18:12 -0400 | [diff] [blame] | 48 | GrRenderTargetContext*, |
| 49 | const GrClip&, |
| 50 | const GrShape&, |
| 51 | GrPaint&&, |
Robert Phillips | 27927a5 | 2018-08-20 13:18:12 -0400 | [diff] [blame] | 52 | const SkMatrix& viewMatrix, |
| 53 | const SkMaskFilter*); |
robertphillips | ccb1b57 | 2015-05-27 11:02:55 -0700 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | #endif |