Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
SkBasicEdgeBuilder Class Referencefinal

#include <SkEdgeBuilder.h>

Inheritance diagram for SkBasicEdgeBuilder:
SkEdgeBuilder

Public Member Functions

 SkBasicEdgeBuilder (int clipShift)
 
SkEdge ** edgeList ()
 
- Public Member Functions inherited from SkEdgeBuilder
int buildEdges (const SkPath &path, const SkIRect *shiftedClip)
 

Private Member Functions

char * allocEdges (size_t, size_t *) override
 
SkRect recoverClip (const SkIRect &) const override
 
void addLine (const SkPoint pts[]) override
 
void addQuad (const SkPoint pts[]) override
 
void addCubic (const SkPoint pts[]) override
 
Combine addPolyLine (const SkPoint pts[], char *edge, char **edgePtr) override
 

Additional Inherited Members

- Protected Types inherited from SkEdgeBuilder
enum  Combine { kNo_Combine , kPartial_Combine , kTotal_Combine }
 
- Protected Member Functions inherited from SkEdgeBuilder
 SkEdgeBuilder ()=default
 
virtual ~SkEdgeBuilder ()=default
 
- Protected Attributes inherited from SkEdgeBuilder
void ** fEdgeList = nullptr
 
SkTDArray< void * > fList
 
SkSTArenaAlloc< 512 > fAlloc
 

Detailed Description

Definition at line 55 of file SkEdgeBuilder.h.

Constructor & Destructor Documentation

◆ SkBasicEdgeBuilder()

SkBasicEdgeBuilder::SkBasicEdgeBuilder ( int  clipShift)
inlineexplicit

Definition at line 57 of file SkEdgeBuilder.h.

57: fClipShift(clipShift) {}

Member Function Documentation

◆ addCubic()

void SkBasicEdgeBuilder::addCubic ( const SkPoint  pts[])
overrideprivatevirtual

Implements SkEdgeBuilder.

Definition at line 175 of file SkEdgeBuilder.cpp.

175 {
177 if (edge->setCubic(pts, fClipShift)) {
178 fList.push_back(edge);
179 }
180}
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
SkTDArray< void * > fList
SkSTArenaAlloc< 512 > fAlloc
void push_back(const T &v)
Definition SkTDArray.h:219
int setCubic(const SkPoint pts[4], int shiftUp)
Definition SkEdge.cpp:474

◆ addLine()

void SkBasicEdgeBuilder::addLine ( const SkPoint  pts[])
overrideprivatevirtual

Implements SkEdgeBuilder.

Definition at line 133 of file SkEdgeBuilder.cpp.

133 {
134 SkEdge* edge = fAlloc.make<SkEdge>();
135 if (edge->setLine(pts[0], pts[1], fClipShift)) {
136 Combine combine = is_vertical(edge) && !fList.empty()
137 ? this->combineVertical(edge, (SkEdge*)fList.back())
138 : kNo_Combine;
139
140 switch (combine) {
141 case kTotal_Combine: fList.pop_back(); break;
142 case kPartial_Combine: break;
143 case kNo_Combine: fList.push_back(edge); break;
144 }
145 }
146}
static bool is_vertical(const Edge *edge)
const T & back() const
Definition SkTDArray.h:162
bool empty() const
Definition SkTDArray.h:135
void pop_back()
Definition SkTDArray.h:223
int setLine(const SkPoint &p0, const SkPoint &p1, const SkIRect *clip, int shiftUp)
Definition SkEdge.cpp:57

◆ addPolyLine()

SkEdgeBuilder::Combine SkBasicEdgeBuilder::addPolyLine ( const SkPoint  pts[],
char *  edge,
char **  edgePtr 
)
overrideprivatevirtual

Implements SkEdgeBuilder.

Definition at line 190 of file SkEdgeBuilder.cpp.

191 {
192 auto edge = (SkEdge*) arg_edge;
193 auto edgePtr = (SkEdge**)arg_edgePtr;
194
195 if (edge->setLine(pts[0], pts[1], fClipShift)) {
196 return is_vertical(edge) && edgePtr > (SkEdge**)fEdgeList
197 ? this->combineVertical(edge, edgePtr[-1])
198 : kNo_Combine;
199 }
200 return SkEdgeBuilder::kPartial_Combine; // A convenient lie. Same do-nothing behavior.
201}
void ** fEdgeList

◆ addQuad()

void SkBasicEdgeBuilder::addQuad ( const SkPoint  pts[])
overrideprivatevirtual

Implements SkEdgeBuilder.

Definition at line 162 of file SkEdgeBuilder.cpp.

162 {
164 if (edge->setQuadratic(pts, fClipShift)) {
165 fList.push_back(edge);
166 }
167}
int setQuadratic(const SkPoint pts[3], int shiftUp)
Definition SkEdge.cpp:303

◆ allocEdges()

char * SkBasicEdgeBuilder::allocEdges ( size_t  n,
size_t *  size 
)
overrideprivatevirtual

Implements SkEdgeBuilder.

Definition at line 225 of file SkEdgeBuilder.cpp.

225 {
226 *size = sizeof(SkEdge);
227 return (char*)fAlloc.makeArrayDefault<SkEdge>(n);
228}
T * makeArrayDefault(size_t count)
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
Definition switches.h:259

◆ edgeList()

SkEdge ** SkBasicEdgeBuilder::edgeList ( )
inline

Definition at line 59 of file SkEdgeBuilder.h.

59{ return (SkEdge**)fEdgeList; }

◆ recoverClip()

SkRect SkBasicEdgeBuilder::recoverClip ( const SkIRect src) const
overrideprivatevirtual

Implements SkEdgeBuilder.

Definition at line 215 of file SkEdgeBuilder.cpp.

215 {
216 return { SkIntToScalar(src.fLeft >> fClipShift),
217 SkIntToScalar(src.fTop >> fClipShift),
218 SkIntToScalar(src.fRight >> fClipShift),
219 SkIntToScalar(src.fBottom >> fClipShift), };
220}
#define SkIntToScalar(x)
Definition SkScalar.h:57

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