Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SkAmbientShadowTessellator Class Reference
Inheritance diagram for SkAmbientShadowTessellator:
SkBaseShadowTessellator

Public Member Functions

 SkAmbientShadowTessellator (const SkPath &path, const SkMatrix &ctm, const SkPoint3 &zPlaneParams, bool transparent)
 
- Public Member Functions inherited from SkBaseShadowTessellator
 SkBaseShadowTessellator (const SkPoint3 &zPlaneParams, const SkRect &bounds, bool transparent)
 
virtual ~SkBaseShadowTessellator ()
 
sk_sp< SkVerticesreleaseVertices ()
 

Additional Inherited Members

- Protected Member Functions inherited from SkBaseShadowTessellator
int vertexCount () const
 
int indexCount () const
 
bool accumulateCentroid (const SkPoint &c, const SkPoint &n)
 
bool checkConvexity (const SkPoint &p0, const SkPoint &p1, const SkPoint &p2)
 
void finishPathPolygon ()
 
bool computeConvexShadow (SkScalar inset, SkScalar outset, bool doClip)
 
void computeClipVectorsAndTestCentroid ()
 
bool clipUmbraPoint (const SkPoint &umbraPoint, const SkPoint &centroid, SkPoint *clipPoint)
 
void addEdge (const SkVector &nextPoint, const SkVector &nextNormal, SkColor umbraColor, const SkTDArray< SkPoint > &umbraPolygon, bool lastEdge, bool doClip)
 
bool addInnerPoint (const SkPoint &pathPoint, SkColor umbraColor, const SkTDArray< SkPoint > &umbraPolygon, int *currUmbraIndex)
 
int getClosestUmbraIndex (const SkPoint &point, const SkTDArray< SkPoint > &umbraPolygon)
 
bool computeConcaveShadow (SkScalar inset, SkScalar outset)
 
void stitchConcaveRings (const SkTDArray< SkPoint > &umbraPolygon, SkTDArray< int > *umbraIndices, const SkTDArray< SkPoint > &penumbraPolygon, SkTDArray< int > *penumbraIndices)
 
void handleLine (const SkPoint &p)
 
void handleLine (const SkMatrix &m, SkPoint *p)
 
void handleQuad (const SkPoint pts[3])
 
void handleQuad (const SkMatrix &m, SkPoint pts[3])
 
void handleCubic (const SkMatrix &m, SkPoint pts[4])
 
void handleConic (const SkMatrix &m, SkPoint pts[3], SkScalar w)
 
bool addArc (const SkVector &nextNormal, SkScalar offset, bool finishArc)
 
void appendTriangle (uint16_t index0, uint16_t index1, uint16_t index2)
 
void appendQuad (uint16_t index0, uint16_t index1, uint16_t index2, uint16_t index3)
 
SkScalar heightFunc (SkScalar x, SkScalar y)
 
- Protected Attributes inherited from SkBaseShadowTessellator
SkPoint3 fZPlaneParams
 
SkTDArray< SkPointfPointBuffer
 
SkTDArray< SkPointfPositions
 
SkTDArray< SkColorfColors
 
SkTDArray< uint16_t > fIndices
 
SkTDArray< SkPointfPathPolygon
 
SkTDArray< SkPointfClipPolygon
 
SkTDArray< SkVectorfClipVectors
 
SkRect fPathBounds
 
SkPoint fCentroid
 
SkScalar fArea
 
SkScalar fLastArea
 
SkScalar fLastCross
 
int fFirstVertexIndex
 
SkVector fFirstOutset
 
SkPoint fFirstPoint
 
bool fSucceeded
 
bool fTransparent
 
bool fIsConvex
 
bool fValidUmbra
 
SkScalar fDirection
 
int fPrevUmbraIndex
 
int fCurrUmbraIndex
 
int fCurrClipIndex
 
bool fPrevUmbraOutside
 
bool fFirstUmbraOutside
 
SkVector fPrevOutset
 
SkPoint fPrevPoint
 
- Static Protected Attributes inherited from SkBaseShadowTessellator
static constexpr auto kMinHeight = 0.1f
 
static constexpr auto kPenumbraColor = SK_ColorTRANSPARENT
 
static constexpr auto kUmbraColor = SK_ColorBLACK
 

Detailed Description

Definition at line 914 of file SkShadowTessellator.cpp.

Constructor & Destructor Documentation

◆ SkAmbientShadowTessellator()

SkAmbientShadowTessellator::SkAmbientShadowTessellator ( const SkPath path,
const SkMatrix ctm,
const SkPoint3 zPlaneParams,
bool  transparent 
)

Definition at line 925 of file SkShadowTessellator.cpp.

929 : INHERITED(zPlaneParams, path.getBounds(), transparent) {
930 // Set base colors
932 // umbraColor is the interior value, penumbraColor the exterior value.
935
936 if (!this->computePathPolygon(path, ctm)) {
937 return;
938 }
939 if (fPathPolygon.size() < 3 || !SkIsFinite(fArea)) {
940 fSucceeded = true; // We don't want to try to blur these cases, so we will
941 // return an empty SkVertices instead.
942 return;
943 }
944
945 // Outer ring: 3*numPts
946 // Middle ring: numPts
947 fPositions.reserve(4 * path.countPoints());
948 fColors.reserve(4 * path.countPoints());
949 // Outer ring: 12*numPts
950 // Middle ring: 0
951 fIndices.reserve(12 * path.countPoints());
952
953 if (fIsConvex) {
954 fSucceeded = this->computeConvexShadow(inset, outset, false);
955 } else {
956 fSucceeded = this->computeConcaveShadow(inset, outset);
957 }
958}
static const int outset
Definition BlurTest.cpp:58
static bool SkIsFinite(T x, Pack... values)
SkScalar heightFunc(SkScalar x, SkScalar y)
bool computeConcaveShadow(SkScalar inset, SkScalar outset)
bool computeConvexShadow(SkScalar inset, SkScalar outset, bool doClip)
SkTDArray< SkPoint > fPositions
SkTDArray< uint16_t > fIndices
SkTDArray< SkPoint > fPathPolygon
int size() const
Definition SkTDArray.h:138
void reserve(int n)
Definition SkTDArray.h:187
SkScalar AmbientRecipAlpha(SkScalar height)
SkScalar AmbientBlurRadius(SkScalar height)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57
static SkRect inset(const SkRect &r)
constexpr float centerX() const
Definition SkRect.h:776
constexpr float centerY() const
Definition SkRect.h:785

The documentation for this class was generated from the following file: