blob: bf6d6387486167c81612487ac5211a5c75f2be66 [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 Salomon0e8fc8b2016-12-09 15:10:07 -050011#include "GrTypes.h"
12
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 */
34 void drawPathWithMaskFilter(GrContext* context,
Brian Osman11052242016-10-27 14:47:55 -040035 GrRenderTargetContext* renderTargetContext,
robertphillipsccb1b572015-05-27 11:02:55 -070036 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);
bsalomonc55271f2015-11-09 11:55:57 -080043
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 Osman11052242016-10-27 14:47:55 -040049 GrRenderTargetContext*,
bsalomonc55271f2015-11-09 11:55:57 -080050 const GrClip&,
51 const SkPath& path,
Brian Salomon82f44312017-01-11 13:42:54 -050052 GrPaint&&,
Brian Salomon0e8fc8b2016-12-09 15:10:07 -050053 GrAA,
bsalomonc55271f2015-11-09 11:55:57 -080054 const SkMatrix& viewMatrix,
55 const SkMaskFilter*,
bsalomon6663acf2016-05-10 09:14:17 -070056 const GrStyle&,
robertphillips0e7029e2015-11-30 05:45:06 -080057 bool pathIsMutable);
robertphillipsccb1b572015-05-27 11:02:55 -070058};
59
60#endif