Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
GrThreadSafeCache::VertexData Class Reference

#include <GrThreadSafeCache.h>

Inheritance diagram for GrThreadSafeCache::VertexData:
SkNVRefCnt< VertexData >

Public Member Functions

 ~VertexData ()
 
const void * vertices () const
 
size_t size () const
 
int numVertices () const
 
size_t vertexSize () const
 
GrGpuBuffergpuBuffer ()
 
sk_sp< GrGpuBufferrefGpuBuffer ()
 
void setGpuBuffer (sk_sp< GrGpuBuffer > gpuBuffer)
 
void reset ()
 
- Public Member Functions inherited from SkNVRefCnt< VertexData >
 SkNVRefCnt ()
 
 ~SkNVRefCnt ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
void deref () const
 
bool refCntGreaterThan (int32_t threadIsolatedTestCnt) const
 

Friends

class GrThreadSafeCache
 

Detailed Description

Definition at line 106 of file GrThreadSafeCache.h.

Constructor & Destructor Documentation

◆ ~VertexData()

GrThreadSafeCache::VertexData::~VertexData ( )

Definition at line 20 of file GrThreadSafeCache.cpp.

20 {
21 this->reset();
22}

Member Function Documentation

◆ gpuBuffer()

GrGpuBuffer * GrThreadSafeCache::VertexData::gpuBuffer ( )
inline

Definition at line 117 of file GrThreadSafeCache.h.

117{ return fGpuBuffer.get(); }
T * get() const
Definition: SkRefCnt.h:303

◆ numVertices()

int GrThreadSafeCache::VertexData::numVertices ( ) const
inline

Definition at line 113 of file GrThreadSafeCache.h.

113{ return fNumVertices; }

◆ refGpuBuffer()

sk_sp< GrGpuBuffer > GrThreadSafeCache::VertexData::refGpuBuffer ( )
inline

Definition at line 118 of file GrThreadSafeCache.h.

118{ return fGpuBuffer; }

◆ reset()

void GrThreadSafeCache::VertexData::reset ( )
inline

Definition at line 127 of file GrThreadSafeCache.h.

127 {
128 sk_free(const_cast<void*>(fVertices));
129 fVertices = nullptr;
130 fNumVertices = 0;
131 fVertexSize = 0;
132 fGpuBuffer.reset();
133 }
SK_API void sk_free(void *)
void reset(T *ptr=nullptr)
Definition: SkRefCnt.h:310

◆ setGpuBuffer()

void GrThreadSafeCache::VertexData::setGpuBuffer ( sk_sp< GrGpuBuffer gpuBuffer)
inline

Definition at line 120 of file GrThreadSafeCache.h.

120 {
121 // TODO: once we add the gpuBuffer we could free 'fVertices'. Deinstantiable
122 // DDLs could throw a monkey wrench into that plan though.
123 SkASSERT(!fGpuBuffer);
124 fGpuBuffer = std::move(gpuBuffer);
125 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ size()

size_t GrThreadSafeCache::VertexData::size ( ) const
inline

Definition at line 111 of file GrThreadSafeCache.h.

111{ return fNumVertices * fVertexSize; }

◆ vertexSize()

size_t GrThreadSafeCache::VertexData::vertexSize ( ) const
inline

Definition at line 114 of file GrThreadSafeCache.h.

114{ return fVertexSize; }

◆ vertices()

const void * GrThreadSafeCache::VertexData::vertices ( ) const
inline

Definition at line 110 of file GrThreadSafeCache.h.

110{ return fVertices; }

Friends And Related Function Documentation

◆ GrThreadSafeCache

friend class GrThreadSafeCache
friend

Definition at line 136 of file GrThreadSafeCache.h.


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