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 541 of file tessellator.cc.

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

◆ GetTriangleType()

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

|VertexGenerator|

Implements impeller::Tessellator::VertexGenerator.

Definition at line 515 of file tessellator.cc.

515  {
516  return (half_width_ < 0 && supports_triangle_fans_)
519 }

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

◆ GetVertexCount()

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

|VertexGenerator|

Implements impeller::Tessellator::VertexGenerator.

Definition at line 521 of file tessellator.cc.

521  {
522  size_t count = iteration_.GetPointCount();
523  if (half_width_ > 0) {
524  FML_DCHECK(!use_center_);
525  FML_DCHECK(cap_ != Cap::kRound);
526  count *= 2;
527  if (cap_ == Cap::kSquare) {
528  count += 4;
529  }
530  } else if (supports_triangle_fans_) {
531  if (use_center_) {
532  count++;
533  }
534  } else {
535  // corrugated triangle fan
536  count += (count + 1) / 2;
537  }
538  return count;
539 }
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: