2 * Copyright 2017 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkShadowTessellator_DEFINED
9 #define SkShadowTessellator_DEFINED
11 #include "include/core/SkRefCnt.h"
12 #include "include/core/SkScalar.h"
21 namespace SkShadowTessellator {
23 typedef std::function<SkScalar(SkScalar, SkScalar)> HeightFunc;
26 * This function generates an ambient shadow mesh for a path by walking the path, outsetting by
27 * the radius, and setting inner and outer colors to umbraColor and penumbraColor, respectively.
28 * If transparent is true, then the center of the ambient shadow will be filled in.
30 sk_sp<SkVertices> MakeAmbient(const SkPath& path, const SkMatrix& ctm,
31 const SkPoint3& zPlane, bool transparent);
34 * This function generates a spot shadow mesh for a path by walking the transformed path,
35 * further transforming by the scale and translation, and outsetting and insetting by a radius.
36 * The center will be clipped against the original path unless transparent is true.
38 sk_sp<SkVertices> MakeSpot(const SkPath& path, const SkMatrix& ctm, const SkPoint3& zPlane,
39 const SkPoint3& lightPos, SkScalar lightRadius, bool transparent,
43 } // namespace SkShadowTessellator