Flutter Engine
The Flutter Engine
Functions
SkMeshes Namespace Reference

Functions

SK_API sk_sp< SkMesh::IndexBufferMakeIndexBuffer (const void *data, size_t size)
 
SK_API sk_sp< SkMesh::IndexBufferCopyIndexBuffer (const sk_sp< SkMesh::IndexBuffer > &)
 
SK_API sk_sp< SkMesh::VertexBufferMakeVertexBuffer (const void *, size_t size)
 
SK_API sk_sp< SkMesh::VertexBufferCopyVertexBuffer (const sk_sp< SkMesh::VertexBuffer > &)
 
SK_API sk_sp< SkMesh::IndexBufferMakeIndexBuffer (GrDirectContext *, const void *data, size_t size)
 
SK_API sk_sp< SkMesh::IndexBufferCopyIndexBuffer (GrDirectContext *, sk_sp< SkMesh::IndexBuffer >)
 
SK_API sk_sp< SkMesh::VertexBufferMakeVertexBuffer (GrDirectContext *, const void *, size_t size)
 
SK_API sk_sp< SkMesh::VertexBufferCopyVertexBuffer (GrDirectContext *, sk_sp< SkMesh::VertexBuffer >)
 

Function Documentation

◆ CopyIndexBuffer() [1/2]

sk_sp< IndexBuffer > SkMeshes::CopyIndexBuffer ( const sk_sp< SkMesh::IndexBuffer > &  src)

Makes a copy of an index buffer. The copy will be CPU-backed.

Definition at line 893 of file SkMesh.cpp.

893 {
894 if (!src) {
895 return nullptr;
896 }
897 auto* ib = static_cast<SkMeshPriv::IB*>(src.get());
898 const void* data = ib->peek();
899 if (!data) {
900 return nullptr;
901 }
902 return MakeIndexBuffer(data, ib->size());
903}
SK_API sk_sp< SkMesh::IndexBuffer > MakeIndexBuffer(const void *data, size_t size)
Definition: SkMesh.cpp:889
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ CopyIndexBuffer() [2/2]

sk_sp< SkMesh::IndexBuffer > SkMeshes::CopyIndexBuffer ( GrDirectContext dc,
sk_sp< SkMesh::IndexBuffer src 
)

Makes a copy of an index buffer. The copy will be GPU backed if the context is non-null.

Definition at line 113 of file GrMeshBuffers.cpp.

113 {
114 if (!src) {
115 return nullptr;
116 }
117 auto* ib = static_cast<SkMeshPriv::IB*>(src.get());
118 const void* data = ib->peek();
119 if (!data) {
120 return nullptr;
121 }
122 if (!dc) {
123 return MakeIndexBuffer(data, ib->size());
124 }
125 return MakeIndexBuffer(dc, data, ib->size());
126}

◆ CopyVertexBuffer() [1/2]

sk_sp< VertexBuffer > SkMeshes::CopyVertexBuffer ( const sk_sp< SkMesh::VertexBuffer > &  src)

Makes a copy of a vertex buffer. The copy will be CPU-backed.

Definition at line 909 of file SkMesh.cpp.

909 {
910 if (!src) {
911 return nullptr;
912 }
913 auto* vb = static_cast<SkMeshPriv::VB*>(src.get());
914 const void* data = vb->peek();
915 if (!data) {
916 return nullptr;
917 }
918 return MakeVertexBuffer(data, vb->size());
919}
SK_API sk_sp< SkMesh::VertexBuffer > MakeVertexBuffer(const void *, size_t size)
Definition: SkMesh.cpp:905

◆ CopyVertexBuffer() [2/2]

sk_sp< SkMesh::VertexBuffer > SkMeshes::CopyVertexBuffer ( GrDirectContext dc,
sk_sp< SkMesh::VertexBuffer src 
)

Makes a copy of a vertex buffer. The copy will be GPU backed if the context is non-null.

Definition at line 135 of file GrMeshBuffers.cpp.

135 {
136 if (!src) {
137 return nullptr;
138 }
139 auto* vb = static_cast<SkMeshPriv::VB*>(src.get());
140 const void* data = vb->peek();
141 if (!data) {
142 return nullptr;
143 }
144 if (!dc) {
145 return MakeVertexBuffer(data, vb->size());
146 }
147 return MakeVertexBuffer(dc, data, vb->size());
148}

◆ MakeIndexBuffer() [1/2]

sk_sp< IndexBuffer > SkMeshes::MakeIndexBuffer ( const void *  data,
size_t  size 
)

Makes a CPU-backed index buffer to be used with SkMeshes.

Parameters
dataThe data used to populate the buffer, or nullptr to create a zero- initialized buffer.
sizeBoth the size of the data in 'data' and the size of the resulting buffer, in bytes.

Definition at line 889 of file SkMesh.cpp.

889 {
891}
static sk_sp< Base > Make(const void *data, size_t size)
Definition: SkMeshPriv.h:123
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 keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ MakeIndexBuffer() [2/2]

sk_sp< SkMesh::IndexBuffer > SkMeshes::MakeIndexBuffer ( GrDirectContext dc,
const void *  data,
size_t  size 
)

Makes a GPU-backed index buffer to be used with SkMeshes.

Parameters
GrDirectContext*If non-null, the data will be uploaded to the corresponding GPU and the returned buffer will only be compatible with surfaces using the same context. If null, the data will be uploaded to a CPU buffer.
dataThe data used to populate the buffer, or nullptr to create a zero- initialized buffer.
sizeBoth the size of the data in 'data' and the size of the resulting buffer.

Definition at line 105 of file GrMeshBuffers.cpp.

105 {
106 if (!dc) {
107 // Fallback to a CPU buffer.
108 return MakeIndexBuffer(data, size);
109 }
111}
static sk_sp< Base > Make(GrDirectContext *, const void *data, size_t size)

◆ MakeVertexBuffer() [1/2]

sk_sp< VertexBuffer > SkMeshes::MakeVertexBuffer ( const void *  data,
size_t  size 
)

Makes a CPU-backed vertex buffer to be used with SkMeshes.

Parameters
dataThe data used to populate the buffer, or nullptr to create a zero- initialized buffer.
sizeBoth the size of the data in 'data' and the size of the resulting buffer, in bytes.

Definition at line 905 of file SkMesh.cpp.

905 {
907}

◆ MakeVertexBuffer() [2/2]

sk_sp< SkMesh::VertexBuffer > SkMeshes::MakeVertexBuffer ( GrDirectContext dc,
const void *  data,
size_t  size 
)

Makes a GPU-backed vertex buffer to be used with SkMeshes.

Parameters
GrDirectContext*If non-null, the data will be uploaded to the corresponding GPU and the returned buffer will only be compatible with surfaces using the same context. If null, the data will be uploaded to a CPU buffer.
dataThe data used to populate the buffer, or nullptr to create a zero- initialized buffer.
sizeBoth the size of the data in 'data' and the size of the resulting buffer.

Definition at line 128 of file GrMeshBuffers.cpp.

128 {
129 if (!dc) {
130 return MakeVertexBuffer(data, size);
131 }
133}