122template <
typename Edge>
126 return edge->fDX == 0
127 && edge->fEdgeType == Edge::kLine_Type;
133void SkBasicEdgeBuilder::addLine(
const SkPoint pts[]) {
135 if (edge->
setLine(pts[0], pts[1], fClipShift)) {
147void SkAnalyticEdgeBuilder::addLine(
const SkPoint pts[]) {
149 if (edge->
setLine(pts[0], pts[1])) {
162void SkBasicEdgeBuilder::addQuad(
const SkPoint pts[]) {
168void SkAnalyticEdgeBuilder::addQuad(
const SkPoint pts[]) {
175void SkBasicEdgeBuilder::addCubic(
const SkPoint pts[]) {
177 if (edge->
setCubic(pts, fClipShift)) {
181void SkAnalyticEdgeBuilder::addCubic(
const SkPoint pts[]) {
191 char* arg_edge,
char** arg_edgePtr) {
192 auto edge = (
SkEdge*) arg_edge;
193 auto edgePtr = (
SkEdge**)arg_edgePtr;
195 if (edge->
setLine(pts[0], pts[1], fClipShift)) {
197 ? this->combineVertical(edge, edgePtr[-1])
203 char* arg_edge,
char** arg_edgePtr) {
207 if (edge->
setLine(pts[0], pts[1])) {
209 ? this->combineVertical(edge, edgePtr[-1])
225char* SkBasicEdgeBuilder::allocEdges(
size_t n,
size_t*
size) {
229char* SkAnalyticEdgeBuilder::allocEdges(
size_t n,
size_t*
size) {
235int SkEdgeBuilder::buildPoly(
const SkPath&
path,
const SkIRect* iclip,
bool canCullToTheRight) {
236 size_t maxEdgeCount =
path.countPoints();
249 char* edge = this->
allocEdges(maxEdgeCount, &edgeSize);
259 while (
auto e = iter.next()) {
265 for (
int i = 0;
i < lineCount;
i++) {
281 while (
auto e = iter.next()) {
298 SkASSERT((
size_t)(edge - edgeStart) <= maxEdgeCount * edgeSize);
303int SkEdgeBuilder::build(
const SkPath&
path,
const SkIRect* iclip,
bool canCullToTheRight) {
306 bool is_finite =
true;
314 } rec = {
this,
true };
318 Rec* rec = (Rec*)ctx;
325 rec->fIsFinite =
false;
336 is_finite = rec.fIsFinite;
338 auto handle_quad = [
this](
const SkPoint pts[3]) {
341 for (
int i = 0;
i <= n;
i++) {
345 while (
auto e = iter.next()) {
356 e.fPts, iter.conicWeight(), conicTol);
358 handle_quad(quadPts);
365 for (
int i = 0;
i <= n;
i++) {
380 const bool canCullToTheRight = !
path.isConvex();
385 ? this->buildPoly(
path, shiftedClip, canCullToTheRight)
386 : this->
build (path, shiftedClip, canCullToTheRight);
391 if (!canCullToTheRight) {
#define SkDEBUGFAIL(message)
static bool is_vertical(const Edge *edge)
static bool SkIsFinite(T x, Pack... values)
int SkChopCubicAtYExtrema(const SkPoint src[4], SkPoint dst[10])
int SkChopQuadAtYExtrema(const SkPoint src[3], SkPoint dst[5])
bool approximately_equal(double x, double y)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
static int32_t SkAbs32(int32_t value)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
constexpr int SkToInt(S x)
T * makeArrayDefault(size_t count)
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
const SkPoint * computeQuads(const SkConic &conic, SkScalar tol)
virtual void addLine(const SkPoint pts[])=0
virtual SkRect recoverClip(const SkIRect &) const =0
SkTDArray< void * > fList
virtual void addCubic(const SkPoint pts[])=0
virtual void addQuad(const SkPoint pts[])=0
SkSTArenaAlloc< 512 > fAlloc
int buildEdges(const SkPath &path, const SkIRect *shiftedClip)
virtual char * allocEdges(size_t n, size_t *sizeof_edge)=0
virtual Combine addPolyLine(const SkPoint pts[], char *edge, char **edgePtr)=0
static void ClipPath(const SkPath &path, const SkRect &clip, bool canCullToTheRight, void(*consume)(SkEdgeClipper *, bool newCtr, void *ctx), void *ctx)
SkPath::Verb next(SkPoint pts[])
@ kMaxClippedLineSegments
static int ClipLine(const SkPoint pts[2], const SkRect &clip, SkPoint lines[kMaxPoints], bool canCullToTheRight)
static int PtsInIter(unsigned verb)
size_t mul(size_t x, size_t y)
void push_back(const T &v)
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
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
bool setCubic(const SkPoint pts[4], bool sortY=true)
bool setLine(const SkPoint &p0, const SkPoint &p1)
bool setQuadratic(const SkPoint pts[3])
int setCubic(const SkPoint pts[4], int shiftUp)
int setLine(const SkPoint &p0, const SkPoint &p1, const SkIRect *clip, int shiftUp)
int setQuadratic(const SkPoint pts[3], int shiftUp)
static SkRect Make(const SkISize &size)