| 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 50 of file path_component.h.

## Constructor & Destructor Documentation

## ◆ StripVertexWriter()

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

Definition at line 40 of file path_component.cc.

42 : 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 50 of file path_component.cc.

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

References impeller::saturated::b.

## ◆ GetIndexCount()

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

Definition at line 46 of file path_component.cc.

46 {
47 return index_count_;
48 }

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

## ◆ Write()

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

Implements impeller::VertexWriter.

Definition at line 77 of file path_component.cc.

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

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

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

impeller::saturated::b
SI b
Definition: saturated_math.h:87