Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
VertState Struct Reference

#include <SkVertState.h>

Public Types

typedef bool(* Proc) (VertState *)
 

Public Member Functions

 VertState (int vCount, const uint16_t indices[], int indexCount)
 
Proc chooseProc (SkVertices::VertexMode mode)
 

Public Attributes

int f0
 
int f1
 
int f2
 

Detailed Description

This is a helper for drawVertices(). It is used to iterate over the triangles that are to be rendered based on an SkCanvas::VertexMode and (optionally) an index array. It does not copy the index array and the client must ensure it remains valid for the lifetime of the VertState object.

Definition at line 22 of file SkVertState.h.

Member Typedef Documentation

◆ Proc

typedef bool(* VertState::Proc) (VertState *)

Definition at line 39 of file SkVertState.h.

Constructor & Destructor Documentation

◆ VertState()

VertState::VertState ( int  vCount,
const uint16_t  indices[],
int  indexCount 
)
inline

Construct a VertState from a vertex count, index array, and index count. If the vertices are unindexed pass nullptr for indices.

Definition at line 29 of file SkVertState.h.

30 : fIndices(indices) {
31 fCurrIndex = 0;
32 if (indices) {
33 fCount = indexCount;
34 } else {
35 fCount = vCount;
36 }
37 }

Member Function Documentation

◆ chooseProc()

VertState::Proc VertState::chooseProc ( SkVertices::VertexMode  mode)

Choose an appropriate function to traverse the vertices.

Parameters
modeSpecifies the SkCanvas::VertexMode.

Definition at line 95 of file SkVertState.cpp.

95 {
96 switch (mode) {
98 return fIndices ? TrianglesX : Triangles;
100 return fIndices ? TriangleStripX : TriangleStrip;
102 return fIndices ? TriangleFanX : TriangleFan;
103 default:
104 return nullptr;
105 }
106}
@ kTriangleStrip_VertexMode
Definition SkVertices.h:32
@ kTriangleFan_VertexMode
Definition SkVertices.h:33
@ kTriangles_VertexMode
Definition SkVertices.h:31

Member Data Documentation

◆ f0

int VertState::f0

Definition at line 23 of file SkVertState.h.

◆ f1

int VertState::f1

Definition at line 23 of file SkVertState.h.

◆ f2

int VertState::f2

Definition at line 23 of file SkVertState.h.


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