16#define GL_CALL(X) GR_GL_CALL(this->glGpu()->glInterface(), X)
17#define GL_CALL_RET(RET, X) GR_GL_CALL_RET(this->glGpu()->glInterface(), RET, X)
19#define GL_ALLOC_CALL(gpu, call) \
21 if (gpu->glCaps().skipErrorChecks()) { \
22 GR_GL_CALL(gpu->glInterface(), call); \
23 return static_cast<GrGLenum>(GR_GL_NO_ERROR); \
25 gpu->clearErrorsAndCheckForOOM(); \
26 GR_GL_CALL_NOERRCHECK(gpu->glInterface(), call); \
27 return gpu->getErrorAndCheckForOOM(); \
43 if (0 ==
buffer->bufferID()) {
51#define DYNAMIC_DRAW_PARAM GR_GL_STREAM_DRAW
85 return drawUsage(pattern);
93 return drawUsage(pattern);
95 return readUsage(pattern);
100 return usageType(bufferType, accessPattern);
107 std::string_view label)
109 , fIntendedType(intendedType)
112 , fHasAttachedToTexture(
false) {
113 GL_CALL(GenBuffers(1, &fBufferID));
121 GL_CALL(DeleteBuffers(1, &fBufferID));
131inline GrGLGpu* GrGLBuffer::glGpu()
const {
136inline const GrGLCaps& GrGLBuffer::glCaps()
const {
137 return this->glGpu()->
glCaps();
146 GL_CALL(DeleteBuffers(1, &fBufferID));
178void GrGLBuffer::onMap(MapType
type) {
184 switch (this->glCaps().mapBufferType()) {
226void GrGLBuffer::onUnmap(MapType) {
229 switch (this->glCaps().mapBufferType()) {
239 this->glGpu()->
bindBuffer(fIntendedType,
this);
246bool GrGLBuffer::onClearToZero() {
263bool GrGLBuffer::onUpdateData(
const void*
src,
size_t offset,
size_t size,
bool preserve) {
278void GrGLBuffer::onSetLabel() {
281 const std::string label =
"_Skia_" + this->
getLabel();
282 if (this->glGpu()->glCaps().debugSupport()) {
#define DYNAMIC_DRAW_PARAM
static GrGLenum invalidate_buffer(GrGLGpu *gpu, GrGLenum target, GrGLenum usage, GrGLuint bufferID, size_t bufferSize)
#define GL_ALLOC_CALL(gpu, call)
static GrGLenum gr_to_gl_access_pattern(GrGpuBufferType bufferType, GrAccessPattern accessPattern, const GrGLCaps &caps)
#define GL_CALL_RET(RET, X)
#define GR_GL_STATIC_READ
#define GR_GL_MAP_INVALIDATE_BUFFER_BIT
#define GR_GL_MAP_WRITE_BIT
#define GR_GL_STATIC_DRAW
#define GR_GL_MAP_READ_BIT
#define GR_GL_STREAM_DRAW
#define GR_GL_DYNAMIC_READ
#define GR_GL_STREAM_READ
unsigned int GrGLbitfield
signed long int GrGLsizeiptr
#define GR_GL_CALL(IFACE, X)
@ kDynamic_GrAccessPattern
@ kStatic_GrAccessPattern
@ kStream_GrAccessPattern
static void * sk_calloc_throw(size_t size)
SK_API void sk_free(void *)
static sk_sp< GrGLBuffer > Make(GrGLGpu *, size_t size, GrGpuBufferType intendedType, GrAccessPattern)
void onAbandon() override
void setMemoryBacking(SkTraceMemoryDump *traceMemoryDump, const SkString &dumpName) const override
GrGLuint bufferID() const
void onRelease() override
GrGLBuffer(GrGLGpu *, size_t size, GrGpuBufferType intendedType, GrAccessPattern, std::string_view label)
@ kMapBufferRange_MapBufferType
@ kMapBuffer_MapBufferType
@ kChromium_MapBufferType
InvalidateBufferType invalidateBufferType() const
TransferBufferType transferBufferType() const
What type of transfer buffer is supported?
const GrGLCaps & glCaps() const
const GrGLInterface * glInterface() const
GrGLenum bindBuffer(GrGpuBufferType type, const GrBuffer *)
size_t size() const final
GrGpuBufferType intendedType() const
bool updateData(const void *src, size_t offset, size_t size, bool preserve)
GrAccessPattern accessPattern() const
void removeScratchKey() const
std::string getLabel() const
bool wasDestroyed() const
void registerWithCache(skgpu::Budgeted)
ResourcePriv resourcePriv()
void appendU32(uint32_t value)
const char * c_str() const
virtual void setMemoryBacking(const char *dumpName, const char *backingType, const char *backingObjectId)=0
EMSCRIPTEN_KEEPALIVE void empty()
const uint8_t uint32_t uint32_t GError ** error
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
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
static void usage(char *argv0)
#define TRACE_EVENT0(category_group, name)