blob: 4fb671ba6db71ec48f52701c04b722a196f1da2c [file] [log] [blame]
robertphillipsccb1b572015-05-27 11:02:55 -07001/*
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 Salomonf4a00e42018-03-23 15:15:03 -040011#include "GrTypesPriv.h"
Brian Salomon0e8fc8b2016-12-09 15:10:07 -050012
robertphillipsccb1b572015-05-27 11:02:55 -070013class GrClip;
14class GrContext;
bsalomonc55271f2015-11-09 11:55:57 -080015class GrPaint;
robertphillipsccb1b572015-05-27 11:02:55 -070016class GrRenderTarget;
Brian Salomon0e8fc8b2016-12-09 15:10:07 -050017class GrRenderTargetContext;
bsalomon6663acf2016-05-10 09:14:17 -070018class GrStyle;
robertphillipsccb1b572015-05-27 11:02:55 -070019struct SkIRect;
bsalomonc55271f2015-11-09 11:55:57 -080020class SkMaskFilter;
robertphillipsccb1b572015-05-27 11:02:55 -070021class SkMatrix;
22class SkPaint;
23class SkPath;
bsalomonc55271f2015-11-09 11:55:57 -080024class SkPathEffect;
robertphillipsccb1b572015-05-27 11:02:55 -070025
26
27/**
28 * Blur utilities.
29 */
30namespace GrBlurUtils {
31 /**
32 * Draw a path handling the mask filter if present.
33 */
Robert Phillips20390c32018-08-17 11:01:03 -040034 void drawPathWithMaskFilter(GrContext*,
35 GrRenderTargetContext*,
36 const GrClip&,
robertphillipsccb1b572015-05-27 11:02:55 -070037 const SkPath& origSrcPath,
Robert Phillips20390c32018-08-17 11:01:03 -040038 const SkPaint&,
39 const SkMatrix& viewMatrix,
robertphillipsccb1b572015-05-27 11:02:55 -070040 bool pathIsMutable);
bsalomonc55271f2015-11-09 11:55:57 -080041
42 /**
Robert Phillips20390c32018-08-17 11:01:03 -040043 * Draw a path handling the mask filter. The mask filter is not optional.
44 * The GrPaint will be modified after return.
bsalomonc55271f2015-11-09 11:55:57 -080045 */
46 void drawPathWithMaskFilter(GrContext*,
Brian Osman11052242016-10-27 14:47:55 -040047 GrRenderTargetContext*,
bsalomonc55271f2015-11-09 11:55:57 -080048 const GrClip&,
49 const SkPath& path,
Brian Salomon82f44312017-01-11 13:42:54 -050050 GrPaint&&,
Brian Salomon0e8fc8b2016-12-09 15:10:07 -050051 GrAA,
bsalomonc55271f2015-11-09 11:55:57 -080052 const SkMatrix& viewMatrix,
53 const SkMaskFilter*,
bsalomon6663acf2016-05-10 09:14:17 -070054 const GrStyle&,
robertphillips0e7029e2015-11-30 05:45:06 -080055 bool pathIsMutable);
robertphillipsccb1b572015-05-27 11:02:55 -070056};
57
58#endif