Add hooks for GL_EXT_debug_marker in gpu
BUG=skia:
R=bsalomon@google.com
Author: egdaniel@google.com
Review URL: https://codereview.chromium.org/174123003
git-svn-id: http://skia.googlecode.com/svn/trunk@13538 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/gl/GrGLExtensions.h b/include/gpu/gl/GrGLExtensions.h
index 76516cf..dbfc3be 100644
--- a/include/gpu/gl/GrGLExtensions.h
+++ b/include/gpu/gl/GrGLExtensions.h
@@ -54,6 +54,11 @@
*/
bool remove(const char[]);
+ /**
+ * Adds an extension to list
+ */
+ void add(const char[]);
+
void reset() { fStrings->reset(); }
void print(const char* sep = "\n") const;
diff --git a/include/gpu/gl/GrGLFunctions.h b/include/gpu/gl/GrGLFunctions.h
index b6d68c7..634af56 100644
--- a/include/gpu/gl/GrGLFunctions.h
+++ b/include/gpu/gl/GrGLFunctions.h
@@ -147,10 +147,13 @@
typedef const GrGLubyte* (GR_GL_FUNCTION_TYPE* GrGLGetStringiProc)(GrGLenum name, GrGLuint index);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetTexLevelParameterivProc)(GrGLenum target, GrGLint level, GrGLenum pname, GrGLint* params);
typedef GrGLint (GR_GL_FUNCTION_TYPE* GrGLGetUniformLocationProc)(GrGLuint program, const char* name);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLInsertEventMarkerProc)(GrGLsizei length, const char* marker);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLLineWidthProc)(GrGLfloat width);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLLinkProgramProc)(GrGLuint program);
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMapBufferProc)(GrGLenum target, GrGLenum access);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPixelStoreiProc)(GrGLenum pname, GrGLint param);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPopGroupMarkerProc)();
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPushGroupMarkerProc)(GrGLsizei length, const char* marker);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLQueryCounterProc)(GrGLuint id, GrGLenum target);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLReadBufferProc)(GrGLenum src);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLReadPixelsProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels);
@@ -261,6 +264,7 @@
typedef GrGLboolean (GR_GL_FUNCTION_TYPE* GrGLIsPointInStrokePathProc)(GrGLuint path, GrGLfloat x, GrGLfloat y);
typedef GrGLfloat (GR_GL_FUNCTION_TYPE* GrGLGetPathLengthProc)(GrGLuint path, GrGLsizei startSegment, GrGLsizei numSegments);
typedef GrGLboolean (GR_GL_FUNCTION_TYPE* GrGLPointAlongPathProc)(GrGLuint path, GrGLsizei startSegment, GrGLsizei numSegments, GrGLfloat distance, GrGLfloat *x, GrGLfloat *y, GrGLfloat *tangentX, GrGLfloat *tangentY);
+
} // extern "C"
#endif
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index f5bcd16..52d96ef 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -76,6 +76,13 @@
GL_NV_path_rendering. */
const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface*);
+/** Function that returns a new interface identical to "interface" but with support for
+ test version of GL_EXT_debug_marker. */
+const GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface*,
+ GrGLInsertEventMarkerProc insertEventMarkerFn,
+ GrGLPushGroupMarkerProc pushGroupMarkerFn,
+ GrGLPopGroupMarkerProc popGroupMarkerFn);
+
/**
* GrContext uses the following interface to make all calls into OpenGL. When a
* GrContext is created it is given a GrGLInterface. The interface's function
@@ -228,6 +235,7 @@
GLPtr<GrGLGetStringiProc> fGetStringi;
GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation;
+ GLPtr<GrGLInsertEventMarkerProc> fInsertEventMarker;
GLPtr<GrGLLineWidthProc> fLineWidth;
GLPtr<GrGLLinkProgramProc> fLinkProgram;
GLPtr<GrGLLoadIdentityProc> fLoadIdentity;
@@ -235,6 +243,8 @@
GLPtr<GrGLMapBufferProc> fMapBuffer;
GLPtr<GrGLMatrixModeProc> fMatrixMode;
GLPtr<GrGLPixelStoreiProc> fPixelStorei;
+ GLPtr<GrGLPopGroupMarkerProc> fPopGroupMarker;
+ GLPtr<GrGLPushGroupMarkerProc> fPushGroupMarker;
GLPtr<GrGLQueryCounterProc> fQueryCounter;
GLPtr<GrGLReadBufferProc> fReadBuffer;
GLPtr<GrGLReadPixelsProc> fReadPixels;
@@ -445,6 +455,7 @@
GLPtrAlias<GrGLGetStringiProc> fGetStringi;
GLPtrAlias<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
GLPtrAlias<GrGLGetUniformLocationProc> fGetUniformLocation;
+ GLPtrAlias<GrGLInsertEventMarkerProc> fInsertEventMarker;
GLPtrAlias<GrGLLineWidthProc> fLineWidth;
GLPtrAlias<GrGLLinkProgramProc> fLinkProgram;
GLPtrAlias<GrGLLoadIdentityProc> fLoadIdentity;
@@ -452,6 +463,8 @@
GLPtrAlias<GrGLMapBufferProc> fMapBuffer;
GLPtrAlias<GrGLMatrixModeProc> fMatrixMode;
GLPtrAlias<GrGLPixelStoreiProc> fPixelStorei;
+ GLPtrAlias<GrGLPopGroupMarkerProc> fPopGroupMarker;
+ GLPtrAlias<GrGLPushGroupMarkerProc> fPushGroupMarker;
GLPtrAlias<GrGLQueryCounterProc> fQueryCounter;
GLPtrAlias<GrGLReadBufferProc> fReadBuffer;
GLPtrAlias<GrGLReadPixelsProc> fReadPixels;