Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions | Variables
SkShadowTessellator.cpp File Reference
#include "src/utils/SkShadowTessellator.h"
#include "include/core/SkColor.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPath.h"
#include "include/core/SkPoint.h"
#include "include/core/SkPoint3.h"
#include "include/core/SkRect.h"
#include "include/core/SkTypes.h"
#include "include/core/SkVertices.h"
#include "include/private/SkColorData.h"
#include "include/private/base/SkFloatingPoint.h"
#include "include/private/base/SkTDArray.h"
#include "include/private/base/SkTemplates.h"
#include "src/core/SkDrawShadowInfo.h"
#include "src/core/SkGeometry.h"
#include "src/core/SkPointPriv.h"
#include "src/core/SkRectPriv.h"
#include "src/utils/SkPolyUtils.h"
#include <algorithm>
#include <cstdint>

Go to the source code of this file.

Classes

class  SkBaseShadowTessellator
 
class  SkAmbientShadowTessellator
 
class  SkSpotShadowTessellator
 

Functions

static bool compute_normal (const SkPoint &p0, const SkPoint &p1, SkScalar dir, SkVector *newNormal)
 
static bool duplicate_pt (const SkPoint &p0, const SkPoint &p1)
 
static SkScalar perp_dot (const SkPoint &p0, const SkPoint &p1, const SkPoint &p2)
 
static void sanitize_point (const SkPoint &in, SkPoint *out)
 

Variables

static constexpr SkScalar kConicTolerance = 0.25f
 

Function Documentation

◆ compute_normal()

static bool compute_normal ( const SkPoint p0,
const SkPoint p1,
SkScalar  dir,
SkVector newNormal 
)
static

Definition at line 145 of file SkShadowTessellator.cpp.

146 {
148 // compute perpendicular
149 normal.fX = p0.fY - p1.fY;
150 normal.fY = p1.fX - p0.fX;
151 normal *= dir;
152 if (!normal.normalize()) {
153 return false;
154 }
155 *newNormal = normal;
156 return true;
157}
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 to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
Definition switches.h:145
float fX
x-axis value
float fY
y-axis value

◆ duplicate_pt()

static bool duplicate_pt ( const SkPoint p0,
const SkPoint p1 
)
static

Definition at line 159 of file SkShadowTessellator.cpp.

159 {
160 static constexpr SkScalar kClose = (SK_Scalar1 / 16);
161 static constexpr SkScalar kCloseSqd = kClose * kClose;
162
163 SkScalar distSq = SkPointPriv::DistanceToSqd(p0, p1);
164 return distSq < kCloseSqd;
165}
static constexpr SkScalar kClose
static constexpr SkScalar kCloseSqd
#define SK_Scalar1
Definition SkScalar.h:18
static SkScalar DistanceToSqd(const SkPoint &pt, const SkPoint &a)
Definition SkPointPriv.h:48
float SkScalar
Definition extension.cpp:12

◆ perp_dot()

static SkScalar perp_dot ( const SkPoint p0,
const SkPoint p1,
const SkPoint p2 
)
static

Definition at line 167 of file SkShadowTessellator.cpp.

167 {
168 SkVector v0 = p1 - p0;
169 SkVector v1 = p2 - p1;
170 return v0.cross(v1);
171}
float cross(const SkVector &vec) const

◆ sanitize_point()

static void sanitize_point ( const SkPoint in,
SkPoint out 
)
static

Definition at line 753 of file SkShadowTessellator.cpp.

753 {
754 out->fX = SkScalarRoundToScalar(16.f*in.fX)*0.0625f;
755 out->fY = SkScalarRoundToScalar(16.f*in.fY)*0.0625f;
756}
#define SkScalarRoundToScalar(x)
Definition SkScalar.h:32

Variable Documentation

◆ kConicTolerance

constexpr SkScalar kConicTolerance = 0.25f
staticconstexpr

Definition at line 750 of file SkShadowTessellator.cpp.