diff options
author | 2012-11-19 20:43:10 +0000 | |
---|---|---|
committer | 2012-11-19 20:43:10 +0000 | |
commit | e0d44ff614c211260fbf55ba895f7fdf4cd3c39c (patch) | |
tree | e6b27305a142b77c1810370ac0e635ebea85b687 /src/gpu | |
parent | 15393c7f34e42bce0ae037d6b1a86d624ce44653 (diff) |
Add support for new glShaderSource() signature from Khronos. Disabled by default.
Review URL: https://codereview.appspot.com/6853068
git-svn-id: http://skia.googlecode.com/svn/trunk@6491 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/gl/GrGLCreateNullInterface.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrGLCreateDebugInterface.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp | 5 |
4 files changed, 17 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp index d0e2bb6d3f..6cca6c89f6 100644 --- a/src/gpu/gl/GrGLCreateNullInterface.cpp +++ b/src/gpu/gl/GrGLCreateNullInterface.cpp @@ -49,7 +49,11 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLQueryCounter(GrGLuint id, GrGLenum target) {} GrGLvoid GR_GL_FUNCTION_TYPE nullGLReadBuffer(GrGLenum src) {} GrGLvoid GR_GL_FUNCTION_TYPE nullGLReadPixels(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels) {} GrGLvoid GR_GL_FUNCTION_TYPE nullGLScissor(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height) {} +#if GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE +GrGLvoid GR_GL_FUNCTION_TYPE nullGLShaderSource(GrGLuint shader, GrGLsizei count, const char* const * str, const GrGLint* length) {} +#else GrGLvoid GR_GL_FUNCTION_TYPE nullGLShaderSource(GrGLuint shader, GrGLsizei count, const char** str, const GrGLint* length) {} +#endif GrGLvoid GR_GL_FUNCTION_TYPE nullGLStencilFunc(GrGLenum func, GrGLint ref, GrGLuint mask) {} GrGLvoid GR_GL_FUNCTION_TYPE nullGLStencilFuncSeparate(GrGLenum face, GrGLenum func, GrGLint ref, GrGLuint mask) {} GrGLvoid GR_GL_FUNCTION_TYPE nullGLStencilMask(GrGLuint mask) {} diff --git a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp index 688f00dd2f..10792d997c 100644 --- a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp +++ b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp @@ -69,7 +69,11 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fPixelStorei = glPixelStorei; interface->fReadPixels = glReadPixels; interface->fScissor = glScissor; +#if GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE + interface->fShaderSource = (GrGLShaderSourceProc) glShaderSource; +#else interface->fShaderSource = glShaderSource; +#endif interface->fStencilFunc = glStencilFunc; interface->fStencilFuncSeparate = glStencilFuncSeparate; interface->fStencilMask = glStencilMask; diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp index 4aff202a9f..1af17b2f88 100644 --- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp +++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp @@ -318,7 +318,11 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLScissor(GrGLint x, GrGLvoid GR_GL_FUNCTION_TYPE debugGLShaderSource(GrGLuint shader, GrGLsizei count, +#if GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE + const char* const * str, +#else const char** str, +#endif const GrGLint* length) { } diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp index e0ecc382b3..17bfaebab9 100644 --- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp +++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp @@ -109,7 +109,12 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fReadBuffer = glReadBuffer; interface->fReadPixels = glReadPixels; interface->fScissor = glScissor; + // The new OpenGLES2 header has an extra "const" in it. :( +#if GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE + interface->fShaderSource = (GrGLShaderSourceProc) glShaderSource; +#else interface->fShaderSource = glShaderSource; +#endif interface->fStencilFunc = glStencilFunc; interface->fStencilFuncSeparate = glStencilFuncSeparate; interface->fStencilMask = glStencilMask; |