| Flutter Impeller |

Public Member Functions | List of all members
impeller::StripVertexWriter Class Reference

A vertex writer that generates a triangle strip and requires primitive restart. More...

`#include <path_component.h>`

Inheritance diagram for impeller::StripVertexWriter:

## Public Member Functions
| StripVertexWriter (Point *point_buffer, uint16_t *index_buffer)
| ~StripVertexWriter ()
size_t | GetIndexCount () const
void | EndContour () override
void | Write (Point point) override

## Detailed Description

A vertex writer that generates a triangle strip and requires primitive restart.

Definition at line 51 of file path_component.h.

## Constructor & Destructor Documentation

## ◆ StripVertexWriter()

impeller::StripVertexWriter::StripVertexWriter | ( | Point * | point_buffer,
|  | uint16_t * | index_buffer
| ) |  |
| explicit

Definition at line 41 of file path_component.cc.

43 : point_buffer_(point_buffer), index_buffer_(index_buffer) {}

## ◆ ~StripVertexWriter()

impeller::StripVertexWriter::~StripVertexWriter | ( |  | ) |
| default

## Member Function Documentation

## ◆ EndContour()

void impeller::StripVertexWriter::EndContour | ( |  | ) |
| override virtual

Implements impeller::VertexWriter.

Definition at line 51 of file path_component.cc.

51 {
52 if (count_ == 0u || contour_start_ == count_ - 1) {
53 // Empty or first contour.
54 return;
55 }
56
57 size_t start = contour_start_;
58 size_t end = count_ - 1;
59
60 index_buffer_[index_count_++] = start;
61
62 size_t a = start + 1;
63 size_t b = end;
64 while (a < b) {
65 index_buffer_[index_count_++] = a;
66 index_buffer_[index_count_++] = b;
67 a++;
68 b--;
69 }
70 if (a == b) {
71 index_buffer_[index_count_++] = a;
72 }
73
74 contour_start_ = count_;
75 index_buffer_[index_count_++] = 0xFFFF;
76 }
impeller::saturated::b
SI b
Definition: saturated_math.h:87

References impeller::saturated::b.

## ◆ GetIndexCount()

size_t impeller::StripVertexWriter::GetIndexCount | ( |  | ) | const

Definition at line 47 of file path_component.cc.

47 {
48 return index_count_;
49 }

Referenced by impeller::Tessellator::TessellateConvex(), and impeller::testing::TEST().

## ◆ Write()

void impeller::StripVertexWriter::Write | ( | Point | point | ) |
| override virtual

Implements impeller::VertexWriter.

Definition at line 78 of file path_component.cc.

78 {
79 point_buffer_[count_++] = point;
80 }

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

- impeller/geometry/path_component.h
- impeller/geometry/path_component.cc