Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
GrTriangulator::EdgeList Struct Reference

#include <GrTriangulator.h>

Public Member Functions

 EdgeList ()
 
void insert (Edge *edge, Edge *prev, Edge *next)
 
bool insert (Edge *edge, Edge *prev)
 
void append (Edge *e)
 
bool remove (Edge *edge)
 
void removeAll ()
 
void close ()
 
bool contains (Edge *edge) const
 

Public Attributes

EdgefHead
 
EdgefTail
 

Detailed Description

Definition at line 463 of file GrTriangulator.h.

Constructor & Destructor Documentation

◆ EdgeList()

GrTriangulator::EdgeList::EdgeList ( )
inline

Definition at line 464 of file GrTriangulator.h.

464: fHead(nullptr), fTail(nullptr) {}

Member Function Documentation

◆ append()

void GrTriangulator::EdgeList::append ( Edge e)
inline

Definition at line 469 of file GrTriangulator.h.

469{ insert(e, fTail, nullptr); }
void insert(Edge *edge, Edge *prev, Edge *next)

◆ close()

void GrTriangulator::EdgeList::close ( )
inline

Definition at line 476 of file GrTriangulator.h.

476 {
477 if (fHead && fTail) {
478 fTail->fRight = fHead;
479 fHead->fLeft = fTail;
480 }
481 }

◆ contains()

bool GrTriangulator::EdgeList::contains ( Edge edge) const
inline

Definition at line 482 of file GrTriangulator.h.

482{ return edge->fLeft || edge->fRight || fHead == edge; }

◆ insert() [1/2]

bool EdgeList::insert ( Edge edge,
Edge prev 
)

Definition at line 657 of file GrTriangulator.cpp.

657 {
658 TESS_LOG("inserting edge %g -> %g\n", edge->fTop->fID, edge->fBottom->fID);
659 // SkASSERT(!this->contains(edge)); // Leave this here for debugging.
660 if (this->contains(edge)) {
661 return false;
662 }
663 Edge* next = prev ? prev->fRight : fHead;
664 this->insert(edge, prev, next);
665 return true;
666}
#define TESS_LOG(...)
static float next(float f)
static float prev(float f)
bool contains(Edge *edge) const

◆ insert() [2/2]

void GrTriangulator::EdgeList::insert ( Edge edge,
Edge prev,
Edge next 
)

Definition at line 304 of file GrTriangulator.cpp.

304 {
305 list_insert<Edge, &Edge::fLeft, &Edge::fRight>(edge, prev, next, &fHead, &fTail);
306}

◆ remove()

bool GrTriangulator::EdgeList::remove ( Edge edge)

Definition at line 308 of file GrTriangulator.cpp.

308 {
309 TESS_LOG("removing edge %g -> %g\n", edge->fTop->fID, edge->fBottom->fID);
310 // SkASSERT(this->contains(edge)); // Leave this here for future debugging.
311 if (!this->contains(edge)) {
312 return false;
313 }
314 list_remove<Edge, &Edge::fLeft, &Edge::fRight>(edge, &fHead, &fTail);
315 return true;
316}

◆ removeAll()

void GrTriangulator::EdgeList::removeAll ( )
inline

Definition at line 471 of file GrTriangulator.h.

471 {
472 while (fHead) {
473 this->remove(fHead);
474 }
475 }

Member Data Documentation

◆ fHead

Edge* GrTriangulator::EdgeList::fHead

Definition at line 465 of file GrTriangulator.h.

◆ fTail

Edge* GrTriangulator::EdgeList::fTail

Definition at line 466 of file GrTriangulator.h.


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