Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
GrMeshBuffer< Base, GrGpuBufferType > Class Template Referencefinal

#include <GrMeshBuffers.h>

Inheritance diagram for GrMeshBuffer< Base, GrGpuBufferType >:

Public Member Functions

 GrMeshBuffer ()=default
 
 ~GrMeshBuffer () override
 
size_t size () const override
 
bool isGaneshBacked () const override
 
sk_sp< const GrGpuBufferasGpuBuffer () const
 

Static Public Member Functions

static sk_sp< Base > Make (GrDirectContext *, const void *data, size_t size)
 

Detailed Description

template<typename Base, GrGpuBufferType>
class GrMeshBuffer< Base, GrGpuBufferType >

Definition at line 20 of file GrMeshBuffers.h.

Constructor & Destructor Documentation

◆ GrMeshBuffer()

template<typename Base , GrGpuBufferType >
GrMeshBuffer< Base, GrGpuBufferType >::GrMeshBuffer ( )
default

◆ ~GrMeshBuffer()

template<typename Base , GrGpuBufferType Type>
GrMeshBuffer< Base, Type >::~GrMeshBuffer
override

Definition at line 29 of file GrMeshBuffers.cpp.

29 {
30 GrResourceCache::ReturnResourceFromThread(std::move(fBuffer), fContextID);
31}
static std::enable_if_t< std::is_base_of_v< GrGpuResource, T >, void > ReturnResourceFromThread(sk_sp< T > &&resource, GrDirectContext::DirectContextID id)

Member Function Documentation

◆ asGpuBuffer()

template<typename Base , GrGpuBufferType >
sk_sp< const GrGpuBuffer > GrMeshBuffer< Base, GrGpuBufferType >::asGpuBuffer ( ) const
inline

Definition at line 35 of file GrMeshBuffers.h.

35{ return fBuffer; }

◆ isGaneshBacked()

template<typename Base , GrGpuBufferType >
bool GrMeshBuffer< Base, GrGpuBufferType >::isGaneshBacked ( ) const
inlineoverride

Definition at line 33 of file GrMeshBuffers.h.

33{ return true; }

◆ Make()

template<typename Base , GrGpuBufferType Type>
sk_sp< Base > GrMeshBuffer< Base, Type >::Make ( GrDirectContext dc,
const void *  data,
size_t  size 
)
static

Definition at line 34 of file GrMeshBuffers.cpp.

34 {
35 SkASSERT(dc);
36
38 size,
39 Type,
42 if (!buffer) {
43 return nullptr;
44 }
45
46 if (data && !buffer->updateData(data, 0, size, /*preserve=*/false)) {
47 return nullptr;
48 }
49
50 auto result = new GrMeshBuffer;
51 result->fBuffer = std::move(buffer);
52 result->fContextID = dc->directContextID();
53 return sk_sp<Base>(result);
54}
@ kStatic_GrAccessPattern
Definition: GrTypesPriv.h:428
#define SkASSERT(cond)
Definition: SkAssert.h:116
GrResourceProvider * resourceProvider()
DirectContextID directContextID() const
GrDirectContextPriv priv()
GrMeshBuffer()=default
size_t size() const override
Definition: GrMeshBuffers.h:28
sk_sp< GrGpuBuffer > createBuffer(size_t size, GrGpuBufferType, GrAccessPattern, ZeroInit)
GAsyncResult * result
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ size()

template<typename Base , GrGpuBufferType >
size_t GrMeshBuffer< Base, GrGpuBufferType >::size ( ) const
inlineoverride

Definition at line 28 of file GrMeshBuffers.h.

28 {
29 SkASSERT(fBuffer);
30 return fBuffer->size();
31 }
size_t size() const final
Definition: GrGpuBuffer.h:34

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