Jim Van Verth | bce7496 | 2017-01-25 09:39:46 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 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 | |
Jim Van Verth | efe3ded | 2017-01-30 13:11:45 -0500 | [diff] [blame] | 8 | #ifndef SkShadowTessellator_DEFINED |
| 9 | #define SkShadowTessellator_DEFINED |
Jim Van Verth | bce7496 | 2017-01-25 09:39:46 -0500 | [diff] [blame] | 10 | |
Jim Van Verth | efe3ded | 2017-01-30 13:11:45 -0500 | [diff] [blame] | 11 | #include "SkColor.h" |
Brian Salomon | aff27a2 | 2017-02-06 15:47:44 -0500 | [diff] [blame] | 12 | #include "SkPoint.h" |
| 13 | #include "SkRefCnt.h" |
Jim Van Verth | bce7496 | 2017-01-25 09:39:46 -0500 | [diff] [blame] | 14 | |
| 15 | class SkMatrix; |
| 16 | class SkPath; |
Brian Salomon | aff27a2 | 2017-02-06 15:47:44 -0500 | [diff] [blame] | 17 | class SkVertices; |
Jim Van Verth | bce7496 | 2017-01-25 09:39:46 -0500 | [diff] [blame] | 18 | |
Brian Salomon | aff27a2 | 2017-02-06 15:47:44 -0500 | [diff] [blame] | 19 | namespace SkShadowTessellator { |
| 20 | /** |
| 21 | * This function generates an ambient shadow mesh for a path by walking the path, outsetting by |
| 22 | * the radius, and setting inner and outer colors to umbraColor and penumbraColor, respectively. |
| 23 | * If transparent is true, then the center of the ambient shadow will be filled in. |
| 24 | */ |
| 25 | sk_sp<SkVertices> MakeAmbient(const SkPath& path, const SkMatrix& ctm, SkScalar radius, |
| 26 | SkColor umbraColor, SkColor penumbraColor, bool transparent); |
Jim Van Verth | bce7496 | 2017-01-25 09:39:46 -0500 | [diff] [blame] | 27 | |
Brian Salomon | aff27a2 | 2017-02-06 15:47:44 -0500 | [diff] [blame] | 28 | /** |
| 29 | * This function generates a spot shadow mesh for a path by walking the transformed path, |
| 30 | * further transforming by the scale and translation, and outsetting and insetting by a radius. |
| 31 | * The center will be clipped against the original path unless transparent is true. |
| 32 | */ |
| 33 | sk_sp<SkVertices> MakeSpot(const SkPath& path, const SkMatrix& ctm, SkScalar scale, |
| 34 | const SkVector& translate, SkScalar radius, SkColor umbraColor, |
| 35 | SkColor penumbraColor, bool transparent); |
| 36 | } |
Jim Van Verth | 91af727 | 2017-01-27 14:15:54 -0500 | [diff] [blame] | 37 | |
Jim Van Verth | bce7496 | 2017-01-25 09:39:46 -0500 | [diff] [blame] | 38 | #endif |