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)
108 :
INHERITED(gpu, size, intendedType, accessPattern, 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));
184 switch (this->glCaps().mapBufferType()) {
229 switch (this->glCaps().mapBufferType()) {
239 this->glGpu()->
bindBuffer(fIntendedType,
this);
281 const std::string label =
"_Skia_" + this->
getLabel();
282 if (this->glGpu()->glCaps().debugSupport()) {
#define GL_ALLOC_CALL(call)
#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 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
#define GL_CALL_RET(R, X)
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
bool onUpdateData(const void *src, size_t offset, size_t size, bool preserve) override
void setMemoryBacking(SkTraceMemoryDump *traceMemoryDump, const SkString &dumpName) const override
GrGLuint bufferID() const
void onUnmap(MapType) override
void onRelease() override
void onSetLabel() override
bool onClearToZero() override
GrGLBuffer(GrGLGpu *, size_t size, GrGpuBufferType intendedType, GrAccessPattern, std::string_view label)
void onMap(MapType) override
@ 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()
static const uint8_t buffer[]
const uint8_t uint32_t uint32_t GError ** error
static void usage(char *argv0)
#define TRACE_EVENT0(category_group, name)