Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkShadowTessellator.h
Go to the documentation of this file.
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
8#ifndef SkShadowTessellator_DEFINED
9#define SkShadowTessellator_DEFINED
10
11#if !defined(SK_ENABLE_OPTIMIZE_SIZE)
12
15
16#include <functional>
17
18class SkMatrix;
19class SkPath;
20class SkVertices;
21struct SkPoint3;
22
24
25typedef std::function<SkScalar(SkScalar, SkScalar)> HeightFunc;
26
27/**
28 * This function generates an ambient shadow mesh for a path by walking the path, outsetting by
29 * the radius, and setting inner and outer colors to umbraColor and penumbraColor, respectively.
30 * If transparent is true, then the center of the ambient shadow will be filled in.
31 */
32sk_sp<SkVertices> MakeAmbient(const SkPath& path, const SkMatrix& ctm,
33 const SkPoint3& zPlane, bool transparent);
34
35/**
36 * This function generates a spot shadow mesh for a path by walking the transformed path,
37 * further transforming by the scale and translation, and outsetting and insetting by a radius.
38 * The center will be clipped against the original path unless transparent is true.
39 */
40sk_sp<SkVertices> MakeSpot(const SkPath& path, const SkMatrix& ctm, const SkPoint3& zPlane,
41 const SkPoint3& lightPos, SkScalar lightRadius, bool transparent,
42 bool directional);
43
44
45} // namespace SkShadowTessellator
46
47#endif // SK_ENABLE_OPTIMIZE_SIZE
48
49#endif
float SkScalar
Definition extension.cpp:12
std::function< SkScalar(SkScalar, SkScalar)> HeightFunc
sk_sp< SkVertices > MakeAmbient(const SkPath &path, const SkMatrix &ctm, const SkPoint3 &zPlane, bool transparent)
sk_sp< SkVertices > MakeSpot(const SkPath &path, const SkMatrix &ctm, const SkPoint3 &zPlane, const SkPoint3 &lightPos, SkScalar lightRadius, bool transparent, bool directional)