Remove the GrGLInterface callback mechanism.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1836013002 Review URL: https://codereview.chromium.org/1836013002
This commit is contained in:
parent
e0d62a5177
commit
dec294375a
@ -56,15 +56,6 @@
|
||||
* Chrome's cmd buffer will create a new allocation and memset the whole thing
|
||||
* to zero (for security reasons). Defaults to 1 (enabled).
|
||||
*
|
||||
* GR_GL_PER_GL_FUNC_CALLBACK: When set to 1 the GrGLInterface object provides
|
||||
* a function pointer that is called just before every gl function. The ptr must
|
||||
* be valid (i.e. there is no NULL check). However, by default the callback will
|
||||
* be set to a function that does nothing. The signature of the function is:
|
||||
* void function(const GrGLInterface*)
|
||||
* It is not extern "C".
|
||||
* The GrGLInterface field fCallback specifies the function ptr and there is an
|
||||
* additional field fCallbackData of type intptr_t for client data.
|
||||
*
|
||||
* GR_GL_CHECK_ALLOC_WITH_GET_ERROR: If set to 1 this will then glTexImage,
|
||||
* glBufferData, glRenderbufferStorage, etc will be checked for errors. This
|
||||
* amounts to ensuring the error is GL_NO_ERROR, calling the allocating
|
||||
@ -115,10 +106,6 @@
|
||||
#define GR_GL_USE_BUFFER_DATA_NULL_HINT 1
|
||||
#endif
|
||||
|
||||
#if !defined(GR_GL_PER_GL_FUNC_CALLBACK)
|
||||
#define GR_GL_PER_GL_FUNC_CALLBACK 0
|
||||
#endif
|
||||
|
||||
#if !defined(GR_GL_CHECK_ALLOC_WITH_GET_ERROR)
|
||||
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 1
|
||||
#endif
|
||||
|
@ -15,9 +15,6 @@
|
||||
// with NULL.
|
||||
#define GR_GL_USE_BUFFER_DATA_NULL_HINT 0
|
||||
|
||||
// chrome uses this to set the context on each GL call.
|
||||
#define GR_GL_PER_GL_FUNC_CALLBACK 1
|
||||
|
||||
// Check error is even more expensive in chrome (cmd buffer flush). The
|
||||
// compositor also doesn't check its allocations.
|
||||
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
|
||||
|
@ -76,11 +76,6 @@ const SK_API GrGLInterface* GrGLCreateNullInterface();
|
||||
*/
|
||||
const GrGLInterface* GrGLCreateDebugInterface();
|
||||
|
||||
#if GR_GL_PER_GL_FUNC_CALLBACK
|
||||
typedef void (*GrGLInterfaceCallbackProc)(const GrGLInterface*);
|
||||
typedef intptr_t GrGLInterfaceCallbackData;
|
||||
#endif
|
||||
|
||||
/** Function that returns a new interface identical to "interface" but without support for
|
||||
GL_NV_path_rendering. */
|
||||
const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface*);
|
||||
@ -492,12 +487,6 @@ public:
|
||||
GrGLFunction<GrEGLDestroyImageProc> fEGLDestroyImage;
|
||||
} fFunctions;
|
||||
|
||||
// Per-GL func callback
|
||||
#if GR_GL_PER_GL_FUNC_CALLBACK
|
||||
GrGLInterfaceCallbackProc fCallback;
|
||||
GrGLInterfaceCallbackData fCallbackData;
|
||||
#endif
|
||||
|
||||
// This exists for internal testing.
|
||||
virtual void abandon() const {}
|
||||
};
|
||||
|
@ -12,12 +12,6 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if GR_GL_PER_GL_FUNC_CALLBACK
|
||||
namespace {
|
||||
void GrGLDefaultInterfaceCallback(const GrGLInterface*) {}
|
||||
}
|
||||
#endif
|
||||
|
||||
const GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface* interface,
|
||||
GrGLInsertEventMarkerProc insertEventMarkerFn,
|
||||
GrGLPushGroupMarkerProc pushGroupMarkerFn,
|
||||
@ -68,11 +62,6 @@ const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) {
|
||||
|
||||
GrGLInterface::GrGLInterface() {
|
||||
fStandard = kNone_GrGLStandard;
|
||||
|
||||
#if GR_GL_PER_GL_FUNC_CALLBACK
|
||||
fCallback = GrGLDefaultInterfaceCallback;
|
||||
fCallbackData = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) {
|
||||
@ -82,10 +71,6 @@ GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) {
|
||||
clone->fStandard = interface->fStandard;
|
||||
clone->fExtensions = interface->fExtensions;
|
||||
clone->fFunctions = interface->fFunctions;
|
||||
#if GR_GL_PER_GL_FUNC_CALLBACK
|
||||
clone->fCallback = interface->fCallback;
|
||||
clone->fCallbackData = interface->fCallbackData;
|
||||
#endif
|
||||
return clone;
|
||||
}
|
||||
|
||||
|
@ -172,13 +172,6 @@ void GrGLClearErr(const GrGLInterface* gl);
|
||||
#define GR_GL_LOG_CALLS_IMPL(X)
|
||||
#endif
|
||||
|
||||
// internal macro that does the per-GL-call callback (if necessary)
|
||||
#if GR_GL_PER_GL_FUNC_CALLBACK
|
||||
#define GR_GL_CALLBACK_IMPL(IFACE) (IFACE)->fCallback(IFACE)
|
||||
#else
|
||||
#define GR_GL_CALLBACK_IMPL(IFACE)
|
||||
#endif
|
||||
|
||||
// makes a GL call on the interface and does any error checking and logging
|
||||
#define GR_GL_CALL(IFACE, X) \
|
||||
do { \
|
||||
@ -190,7 +183,6 @@ void GrGLClearErr(const GrGLInterface* gl);
|
||||
// the caller wants to do its own glGetError() call and examine the error value.
|
||||
#define GR_GL_CALL_NOERRCHECK(IFACE, X) \
|
||||
do { \
|
||||
GR_GL_CALLBACK_IMPL(IFACE); \
|
||||
(IFACE)->fFunctions.f##X; \
|
||||
GR_GL_LOG_CALLS_IMPL(X); \
|
||||
} while (false)
|
||||
@ -205,7 +197,6 @@ void GrGLClearErr(const GrGLInterface* gl);
|
||||
// same as GR_GL_CALL_RET but always skips the error check.
|
||||
#define GR_GL_CALL_RET_NOERRCHECK(IFACE, RET, X) \
|
||||
do { \
|
||||
GR_GL_CALLBACK_IMPL(IFACE); \
|
||||
(RET) = (IFACE)->fFunctions.f##X; \
|
||||
GR_GL_LOG_CALLS_IMPL(X); \
|
||||
} while (false)
|
||||
|
Loading…
Reference in New Issue
Block a user