Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
GrSimpleMesh Struct Reference

#include <GrSimpleMesh.h>

Public Member Functions

void set (sk_sp< const GrBuffer > vertexBuffer, int vertexCount, int baseVertex)
 
void setIndexed (sk_sp< const GrBuffer > indexBuffer, int indexCount, int baseIndex, uint16_t minIndexValue, uint16_t maxIndexValue, GrPrimitiveRestart, sk_sp< const GrBuffer > vertexBuffer, int baseVertex)
 
void setIndexedPatterned (sk_sp< const GrBuffer > indexBuffer, int indexCount, int patternRepeatCount, int maxPatternRepetitionsInIndexBuffer, sk_sp< const GrBuffer > vertexBuffer, int patternVertexCount, int baseVertex)
 

Public Attributes

sk_sp< const GrBufferfIndexBuffer
 
int fIndexCount
 
int fPatternRepeatCount
 
int fMaxPatternRepetitionsInIndexBuffer
 
int fBaseIndex
 
uint16_t fMinIndexValue
 
uint16_t fMaxIndexValue
 
GrPrimitiveRestart fPrimitiveRestart = GrPrimitiveRestart::kNo
 
sk_sp< const GrBufferfVertexBuffer
 
int fVertexCount
 
int fBaseVertex = 0
 

Detailed Description

Used to communicate simple (non-instanced, direct) draws from GrOp to GrOpsRenderPass. TODO: Consider migrating every Op to make the appropriate draw directly on GrOpsRenderPass.

Definition at line 21 of file GrSimpleMesh.h.

Member Function Documentation

◆ set()

void GrSimpleMesh::set ( sk_sp< const GrBuffer vertexBuffer,
int  vertexCount,
int  baseVertex 
)
inline

Definition at line 47 of file GrSimpleMesh.h.

47 {
48 SkASSERT(baseVertex >= 0);
50 fVertexBuffer = std::move(vertexBuffer);
51 fVertexCount = vertexCount;
52 fBaseVertex = baseVertex;
53 SkDEBUGCODE(fIsInitialized = true;)
54}
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
void reset(T *ptr=nullptr)
Definition: SkRefCnt.h:310
sk_sp< const GrBuffer > fIndexBuffer
Definition: GrSimpleMesh.h:31
sk_sp< const GrBuffer > fVertexBuffer
Definition: GrSimpleMesh.h:40

◆ setIndexed()

void GrSimpleMesh::setIndexed ( sk_sp< const GrBuffer indexBuffer,
int  indexCount,
int  baseIndex,
uint16_t  minIndexValue,
uint16_t  maxIndexValue,
GrPrimitiveRestart  primitiveRestart,
sk_sp< const GrBuffer vertexBuffer,
int  baseVertex 
)
inline

Definition at line 56 of file GrSimpleMesh.h.

59 {
60 SkASSERT(indexBuffer);
61 SkASSERT(indexCount >= 1);
62 SkASSERT(baseIndex >= 0);
63 SkASSERT(maxIndexValue >= minIndexValue);
64 SkASSERT(baseVertex >= 0);
65 fIndexBuffer = std::move(indexBuffer);
66 fIndexCount = indexCount;
68 fBaseIndex = baseIndex;
69 fMinIndexValue = minIndexValue;
70 fMaxIndexValue = maxIndexValue;
71 fPrimitiveRestart = primitiveRestart;
72 fVertexBuffer = std::move(vertexBuffer);
73 fBaseVertex = baseVertex;
74 SkDEBUGCODE(fIsInitialized = true;)
75}
uint16_t fMinIndexValue
Definition: GrSimpleMesh.h:36
uint16_t fMaxIndexValue
Definition: GrSimpleMesh.h:37
GrPrimitiveRestart fPrimitiveRestart
Definition: GrSimpleMesh.h:38
int fPatternRepeatCount
Definition: GrSimpleMesh.h:33

◆ setIndexedPatterned()

void GrSimpleMesh::setIndexedPatterned ( sk_sp< const GrBuffer indexBuffer,
int  indexCount,
int  patternRepeatCount,
int  maxPatternRepetitionsInIndexBuffer,
sk_sp< const GrBuffer vertexBuffer,
int  patternVertexCount,
int  baseVertex 
)
inline

Definition at line 77 of file GrSimpleMesh.h.

80 {
81 SkASSERT(indexBuffer);
82 SkASSERT(indexCount >= 1);
83 SkASSERT(patternVertexCount >= 1);
84 SkASSERT(patternRepeatCount >= 1);
85 SkASSERT(maxPatternRepetitionsInIndexBuffer >= 1);
86 SkASSERT(baseVertex >= 0);
87 fIndexBuffer = std::move(indexBuffer);
88 fIndexCount = indexCount;
89 fPatternRepeatCount = patternRepeatCount;
90 fVertexCount = patternVertexCount;
91 fMaxPatternRepetitionsInIndexBuffer = maxPatternRepetitionsInIndexBuffer;
93 fVertexBuffer = std::move(vertexBuffer);
94 fBaseVertex = baseVertex;
95 SkDEBUGCODE(fIsInitialized = true;)
96}
int fMaxPatternRepetitionsInIndexBuffer
Definition: GrSimpleMesh.h:34

Member Data Documentation

◆ fBaseIndex

int GrSimpleMesh::fBaseIndex

Definition at line 35 of file GrSimpleMesh.h.

◆ fBaseVertex

int GrSimpleMesh::fBaseVertex = 0

Definition at line 42 of file GrSimpleMesh.h.

◆ fIndexBuffer

sk_sp<const GrBuffer> GrSimpleMesh::fIndexBuffer

Definition at line 31 of file GrSimpleMesh.h.

◆ fIndexCount

int GrSimpleMesh::fIndexCount

Definition at line 32 of file GrSimpleMesh.h.

◆ fMaxIndexValue

uint16_t GrSimpleMesh::fMaxIndexValue

Definition at line 37 of file GrSimpleMesh.h.

◆ fMaxPatternRepetitionsInIndexBuffer

int GrSimpleMesh::fMaxPatternRepetitionsInIndexBuffer

Definition at line 34 of file GrSimpleMesh.h.

◆ fMinIndexValue

uint16_t GrSimpleMesh::fMinIndexValue

Definition at line 36 of file GrSimpleMesh.h.

◆ fPatternRepeatCount

int GrSimpleMesh::fPatternRepeatCount

Definition at line 33 of file GrSimpleMesh.h.

◆ fPrimitiveRestart

GrPrimitiveRestart GrSimpleMesh::fPrimitiveRestart = GrPrimitiveRestart::kNo

Definition at line 38 of file GrSimpleMesh.h.

◆ fVertexBuffer

sk_sp<const GrBuffer> GrSimpleMesh::fVertexBuffer

Definition at line 40 of file GrSimpleMesh.h.

◆ fVertexCount

int GrSimpleMesh::fVertexCount

Definition at line 41 of file GrSimpleMesh.h.


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