Flutter Impeller
impeller::Tessellator::ArcVertexGenerator Class Reference

The |VertexGenerator| implementation common to all shapes that are based on a polygonal representation of an ellipse. More...

#include <tessellator.h>

Inheritance diagram for impeller::Tessellator::ArcVertexGenerator:
impeller::Tessellator::VertexGenerator

Public Member Functions

PrimitiveType GetTriangleType () const override
 |VertexGenerator| More...
 
size_t GetVertexCount () const override
 |VertexGenerator| More...
 
void GenerateVertices (const TessellatedVertexProc &proc) const override
 |VertexGenerator| More...
 

Friends

class Tessellator
 

Detailed Description

The |VertexGenerator| implementation common to all shapes that are based on a polygonal representation of an ellipse.

Definition at line 191 of file tessellator.h.

Member Function Documentation

◆ GenerateVertices()

void impeller::ArcVertexGenerator::GenerateVertices ( const TessellatedVertexProc proc) const
overridevirtual

|VertexGenerator|

Implements impeller::Tessellator::VertexGenerator.

Definition at line 542 of file tessellator.cc.

543  {
544  if (half_width_ > 0) {
545  FML_DCHECK(!use_center_);
546  Tessellator::GenerateStrokedArc(trigs_, iteration_, oval_bounds_,
547  half_width_, cap_, proc);
548  } else if (supports_triangle_fans_) {
549  Tessellator::GenerateFilledArcFan(trigs_, iteration_, oval_bounds_,
550  use_center_, proc);
551  } else {
552  Tessellator::GenerateFilledArcStrip(trigs_, iteration_, oval_bounds_,
553  use_center_, proc);
554  }
555 }

◆ GetTriangleType()

PrimitiveType impeller::ArcVertexGenerator::GetTriangleType ( ) const
overridevirtual

|VertexGenerator|

Implements impeller::Tessellator::VertexGenerator.

Definition at line 516 of file tessellator.cc.

516  {
517  return (half_width_ < 0 && supports_triangle_fans_)
520 }

References impeller::kTriangleFan, and impeller::kTriangleStrip.

◆ GetVertexCount()

size_t impeller::ArcVertexGenerator::GetVertexCount ( ) const
overridevirtual

|VertexGenerator|

Implements impeller::Tessellator::VertexGenerator.

Definition at line 522 of file tessellator.cc.

522  {
523  size_t count = iteration_.GetPointCount();
524  if (half_width_ > 0) {
525  FML_DCHECK(!use_center_);
526  FML_DCHECK(cap_ != Cap::kRound);
527  count *= 2;
528  if (cap_ == Cap::kSquare) {
529  count += 4;
530  }
531  } else if (supports_triangle_fans_) {
532  if (use_center_) {
533  count++;
534  }
535  } else {
536  // corrugated triangle fan
537  count += (count + 1) / 2;
538  }
539  return count;
540 }
size_t GetPointCount() const
Definition: arc.cc:36

References impeller::Arc::Iteration::GetPointCount(), impeller::kRound, and impeller::kSquare.

Friends And Related Function Documentation

◆ Tessellator

friend class Tessellator
friend

Definition at line 203 of file tessellator.h.


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