Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
SkVertices Class Reference

#include <SkVertices.h>

Inheritance diagram for SkVertices:
SkNVRefCnt< SkVertices >

Classes

class  Builder
 
struct  Desc
 
struct  Sizes
 

Public Types

enum  VertexMode { kTriangles_VertexMode , kTriangleStrip_VertexMode , kTriangleFan_VertexMode , kLast_VertexMode = kTriangleFan_VertexMode }
 
enum  BuilderFlags { kHasTexCoords_BuilderFlag = 1 << 0 , kHasColors_BuilderFlag = 1 << 1 }
 

Public Member Functions

uint32_t uniqueID () const
 
const SkRectbounds () const
 
size_t approximateSize () const
 
SkVerticesPriv priv ()
 
const SkVerticesPriv priv () const
 
- Public Member Functions inherited from SkNVRefCnt< SkVertices >
 SkNVRefCnt ()
 
 ~SkNVRefCnt ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
void deref () const
 
bool refCntGreaterThan (int32_t threadIsolatedTestCnt) const
 

Static Public Member Functions

static sk_sp< SkVerticesMakeCopy (VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
 
static sk_sp< SkVerticesMakeCopy (VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[])
 

Friends

class SkVerticesPriv
 
class SkNVRefCnt< SkVertices >
 

Detailed Description

An immutable set of vertex data that can be used with SkCanvas::drawVertices.

Definition at line 26 of file SkVertices.h.

Member Enumeration Documentation

◆ BuilderFlags

Enumerator
kHasTexCoords_BuilderFlag 
kHasColors_BuilderFlag 

Definition at line 62 of file SkVertices.h.

62 {
65 };
@ kHasTexCoords_BuilderFlag
Definition SkVertices.h:63
@ kHasColors_BuilderFlag
Definition SkVertices.h:64

◆ VertexMode

Enumerator
kTriangles_VertexMode 
kTriangleStrip_VertexMode 
kTriangleFan_VertexMode 
kLast_VertexMode 

Definition at line 30 of file SkVertices.h.

Member Function Documentation

◆ approximateSize()

size_t SkVertices::approximateSize ( ) const

Definition at line 221 of file SkVertices.cpp.

221 {
222 return this->getSizes().fTotal;
223}

◆ bounds()

const SkRect & SkVertices::bounds ( ) const
inline

Definition at line 98 of file SkVertices.h.

98{ return fBounds; }

◆ MakeCopy() [1/2]

static sk_sp< SkVertices > SkVertices::MakeCopy ( VertexMode  mode,
int  vertexCount,
const SkPoint  positions[],
const SkPoint  texs[],
const SkColor  colors[] 
)
inlinestatic

Definition at line 49 of file SkVertices.h.

52 {
53 return MakeCopy(mode,
54 vertexCount,
55 positions,
56 texs,
57 colors,
58 0,
59 nullptr);
60 }
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])

◆ MakeCopy() [2/2]

sk_sp< SkVertices > SkVertices::MakeCopy ( VertexMode  mode,
int  vertexCount,
const SkPoint  positions[],
const SkPoint  texs[],
const SkColor  colors[],
int  indexCount,
const uint16_t  indices[] 
)
static

Create a vertices by copying the specified arrays. texs, colors may be nullptr, and indices is ignored if indexCount == 0.

Definition at line 200 of file SkVertices.cpp.

203 {
204 auto desc = Desc{mode, vertexCount, indexCount, !!texs, !!colors};
205 Builder builder(desc);
206 if (!builder.isValid()) {
207 return nullptr;
208 }
209
210 Sizes sizes(desc);
211 SkASSERT(sizes.isValid());
212 sk_careful_memcpy(builder.positions(), pos, sizes.fVSize);
213 sk_careful_memcpy(builder.texCoords(), texs, sizes.fTSize);
214 sk_careful_memcpy(builder.colors(), colors, sizes.fCSize);
215 size_t isize = (mode == kTriangleFan_VertexMode) ? sizes.fBuilderTriFanISize : sizes.fISize;
216 sk_careful_memcpy(builder.indices(), indices, isize);
217
218 return builder.detach();
219}
SkPoint pos
#define SkASSERT(cond)
Definition SkAssert.h:116
static void * sk_careful_memcpy(void *dst, const void *src, size_t len)
Definition SkMalloc.h:125
PODArray< SkRect > texs
Definition SkRecords.h:333
PODArray< SkColor > colors
Definition SkRecords.h:276
DlVertices::Builder Builder
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition switches.h:228

◆ priv() [1/2]

SkVerticesPriv SkVertices::priv ( )
inline

Definition at line 58 of file SkVerticesPriv.h.

58{ return SkVerticesPriv(this); }
friend class SkVerticesPriv
Definition SkVertices.h:110

◆ priv() [2/2]

const SkVerticesPriv SkVertices::priv ( ) const
inline

Definition at line 60 of file SkVerticesPriv.h.

60 { // NOLINT(readability-const-return-type)
61 return SkVerticesPriv(const_cast<SkVertices*>(this));
62}

◆ uniqueID()

uint32_t SkVertices::uniqueID ( ) const
inline

Definition at line 97 of file SkVertices.h.

97{ return fUniqueID; }

Friends And Related Symbol Documentation

◆ SkNVRefCnt< SkVertices >

friend class SkNVRefCnt< SkVertices >
friend

Definition at line 110 of file SkVertices.h.

◆ SkVerticesPriv

friend class SkVerticesPriv
friend

Definition at line 110 of file SkVertices.h.


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