Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
utils
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
13
#include "
include/core/SkRefCnt.h
"
14
#include "
include/core/SkScalar.h
"
15
16
#include <functional>
17
18
class
SkMatrix
;
19
class
SkPath
;
20
class
SkVertices
;
21
struct
SkPoint3
;
22
23
namespace
SkShadowTessellator
{
24
25
typedef
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
*/
32
sk_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
*/
40
sk_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
SkRefCnt.h
SkScalar.h
SkMatrix
Definition
SkMatrix.h:54
SkPath
Definition
SkPath.h:59
SkVertices
Definition
SkVertices.h:26
sk_sp
Definition
SkRefCnt.h:220
SkScalar
float SkScalar
Definition
extension.cpp:12
SkShadowTessellator
Definition
SkShadowTessellator.h:23
SkShadowTessellator::HeightFunc
std::function< SkScalar(SkScalar, SkScalar)> HeightFunc
Definition
SkShadowTessellator.h:25
SkShadowTessellator::MakeAmbient
sk_sp< SkVertices > MakeAmbient(const SkPath &path, const SkMatrix &ctm, const SkPoint3 &zPlane, bool transparent)
Definition
SkShadowTessellator.cpp:1167
SkShadowTessellator::MakeSpot
sk_sp< SkVertices > MakeSpot(const SkPath &path, const SkMatrix &ctm, const SkPoint3 &zPlane, const SkPoint3 &lightPos, SkScalar lightRadius, bool transparent, bool directional)
Definition
SkShadowTessellator.cpp:1176
SkPoint3
Definition
SkPoint3.h:15
Generated on Fri Apr 26 2024 06:17:37 for Flutter Engine by
1.9.8