diff --git a/include/gpu/gl/GrGLFunctions.h b/include/gpu/gl/GrGLFunctions.h index 037ebfdd9f..1d96849cbb 100644 --- a/include/gpu/gl/GrGLFunctions.h +++ b/include/gpu/gl/GrGLFunctions.h @@ -64,6 +64,7 @@ extern "C" { typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLColorMaskProc)(GrGLboolean red, GrGLboolean green, GrGLboolean blue, GrGLboolean alpha); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCompileShaderProc)(GrGLuint shader); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCompressedTexImage2DProc)(GrGLenum target, GrGLint level, GrGLenum internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLsizei imageSize, const GrGLvoid* data); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCopyTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height); typedef GrGLuint (GR_GL_FUNCTION_TYPE* GrGLCreateProgramProc)(void); typedef GrGLuint (GR_GL_FUNCTION_TYPE* GrGLCreateShaderProc)(GrGLenum type); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCullFaceProc)(GrGLenum mode); diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h index 58e3814d75..5954c82ac5 100644 --- a/include/gpu/gl/GrGLInterface.h +++ b/include/gpu/gl/GrGLInterface.h @@ -159,6 +159,7 @@ public: GLPtr fColorMask; GLPtr fCompileShader; GLPtr fCompressedTexImage2D; + GLPtr fCopyTexSubImage2D; GLPtr fCreateProgram; GLPtr fCreateShader; GLPtr fCullFace; diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp index ebaacbc1af..5a5ec6b6cc 100644 --- a/src/gpu/gl/GrGLCreateNullInterface.cpp +++ b/src/gpu/gl/GrGLCreateNullInterface.cpp @@ -179,6 +179,7 @@ const GrGLInterface* GrGLCreateNullInterface() { interface->fColorMask = noOpGLColorMask; interface->fCompileShader = noOpGLCompileShader; interface->fCompressedTexImage2D = noOpGLCompressedTexImage2D; + interface->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D; interface->fCreateProgram = nullGLCreateProgram; interface->fCreateShader = nullGLCreateShader; interface->fCullFace = noOpGLCullFace; diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index 0c6bd8604d..89912a08c9 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -59,6 +59,9 @@ bool GrGLInterface::validate(GrGLBinding binding) const { NULL == fClearStencil || NULL == fColorMask || NULL == fCompileShader || +#if 0 // FIXME: Remove this once Chromium is updated to provide this function + NULL == fCopyTexSubImage2D || +#endif NULL == fCreateProgram || NULL == fCreateShader || NULL == fCullFace || diff --git a/src/gpu/gl/GrGLNoOpInterface.cpp b/src/gpu/gl/GrGLNoOpInterface.cpp index 8f753ec786..82e7a1b842 100644 --- a/src/gpu/gl/GrGLNoOpInterface.cpp +++ b/src/gpu/gl/GrGLNoOpInterface.cpp @@ -100,6 +100,16 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCompressedTexImage2D(GrGLenum target, const GrGLvoid* data) { } +GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCopyTexSubImage2D(GrGLenum target, + GrGLint level, + GrGLint xoffset, + GrGLint yoffset, + GrGLint x, + GrGLint y, + GrGLsizei width, + GrGLsizei height) { +} + GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCullFace(GrGLenum mode) { } diff --git a/src/gpu/gl/GrGLNoOpInterface.h b/src/gpu/gl/GrGLNoOpInterface.h index cea283359f..b04cdca6d4 100644 --- a/src/gpu/gl/GrGLNoOpInterface.h +++ b/src/gpu/gl/GrGLNoOpInterface.h @@ -55,6 +55,15 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCompressedTexImage2D(GrGLenum target, GrGLsizei imageSize, const GrGLvoid* data); +GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCopyTexSubImage2D(GrGLenum target, + GrGLint level, + GrGLint xoffset, + GrGLint yoffset, + GrGLint x, + GrGLint y, + GrGLsizei width, + GrGLsizei height); + GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCullFace(GrGLenum mode); GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDepthMask(GrGLboolean flag); diff --git a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp index 6f81cab41c..081fa050b0 100644 --- a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp +++ b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp @@ -37,6 +37,7 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fColorMask = glColorMask; interface->fCompileShader = glCompileShader; interface->fCompressedTexImage2D = glCompressedTexImage2D; + interface->fCopyTexSubImage2D = glCopyTexSubImage2D; interface->fCreateProgram = glCreateProgram; interface->fCreateShader = glCreateShader; interface->fCullFace = glCullFace; diff --git a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp index 059713d8e4..1b9f5c201c 100644 --- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp +++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp @@ -17,8 +17,8 @@ #include "GLES2/gl2ext.h" #include "EGL/egl.h" -#define GR_GET_PROC(procType, baseName) \ - interface->f ## baseName = (procType) GetProcAddress(ghANGLELib, "gl" #baseName); +#define GET_PROC(name) \ + interface->f ## name = (GrGL ## name ## Proc) GetProcAddress(ghANGLELib, "gl" #name); const GrGLInterface* GrGLCreateANGLEInterface() { @@ -39,117 +39,116 @@ const GrGLInterface* GrGLCreateANGLEInterface() { glInterface.reset(interface); interface->fBindingsExported = kES2_GrGLBinding; - GR_GET_PROC(GrGLActiveTextureProc, ActiveTexture); - GR_GET_PROC(GrGLAttachShaderProc, AttachShader); - GR_GET_PROC(GrGLBindAttribLocationProc, BindAttribLocation); - GR_GET_PROC(GrGLBindBufferProc, BindBuffer); - GR_GET_PROC(GrGLBindTextureProc, BindTexture); + GET_PROC(ActiveTexture); + GET_PROC(AttachShader); + GET_PROC(BindAttribLocation); + GET_PROC(BindBuffer); + GET_PROC(BindTexture); interface->fBindVertexArray = (GrGLBindVertexArrayProc) eglGetProcAddress("glBindVertexArrayOES"); - GR_GET_PROC(GrGLBlendColorProc, BlendColor); - GR_GET_PROC(GrGLBlendFuncProc, BlendFunc); - GR_GET_PROC(GrGLBufferDataProc, BufferData); - GR_GET_PROC(GrGLBufferSubDataProc, BufferSubData); - GR_GET_PROC(GrGLClearProc, Clear); - GR_GET_PROC(GrGLClearColorProc, ClearColor); - GR_GET_PROC(GrGLClearStencilProc, ClearStencil); - GR_GET_PROC(GrGLColorMaskProc, ColorMask); - GR_GET_PROC(GrGLCompileShaderProc, CompileShader); - GR_GET_PROC(GrGLCompressedTexImage2DProc, CompressedTexImage2D); - GR_GET_PROC(GrGLCreateProgramProc, CreateProgram); - GR_GET_PROC(GrGLCreateShaderProc, CreateShader); - GR_GET_PROC(GrGLCullFaceProc, CullFace); - GR_GET_PROC(GrGLDeleteBuffersProc, DeleteBuffers); - GR_GET_PROC(GrGLDeleteProgramProc, DeleteProgram); - GR_GET_PROC(GrGLDeleteShaderProc, DeleteShader); - GR_GET_PROC(GrGLDeleteTexturesProc, DeleteTextures); + GET_PROC(BlendColor); + GET_PROC(BlendFunc); + GET_PROC(BufferData); + GET_PROC(BufferSubData); + GET_PROC(Clear); + GET_PROC(ClearColor); + GET_PROC(ClearStencil); + GET_PROC(ColorMask); + GET_PROC(CompileShader); + GET_PROC(CompressedTexImage2D); + GET_PROC(CopyTexSubImage2D); + GET_PROC(CreateProgram); + GET_PROC(CreateShader); + GET_PROC(CullFace); + GET_PROC(DeleteBuffers); + GET_PROC(DeleteProgram); + GET_PROC(DeleteShader); + GET_PROC(DeleteTextures); interface->fDeleteVertexArrays = (GrGLDeleteVertexArraysProc) eglGetProcAddress("glDeleteVertexArraysOES"); - GR_GET_PROC(GrGLDepthMaskProc, DepthMask); - GR_GET_PROC(GrGLDisableProc, Disable); - GR_GET_PROC(GrGLDisableVertexAttribArrayProc, DisableVertexAttribArray); - GR_GET_PROC(GrGLDrawArraysProc, DrawArrays); - GR_GET_PROC(GrGLDrawElementsProc, DrawElements); - GR_GET_PROC(GrGLEnableProc, Enable); - GR_GET_PROC(GrGLEnableVertexAttribArrayProc, EnableVertexAttribArray); - GR_GET_PROC(GrGLFinishProc, Finish); - GR_GET_PROC(GrGLFlushProc, Flush); - GR_GET_PROC(GrGLFrontFaceProc, FrontFace); - GR_GET_PROC(GrGLGenBuffersProc, GenBuffers); - GR_GET_PROC(GrGLGenTexturesProc, GenTextures); + GET_PROC(DepthMask); + GET_PROC(Disable); + GET_PROC(DisableVertexAttribArray); + GET_PROC(DrawArrays); + GET_PROC(DrawElements); + GET_PROC(Enable); + GET_PROC(EnableVertexAttribArray); + GET_PROC(Finish); + GET_PROC(Flush); + GET_PROC(FrontFace); + GET_PROC(GenBuffers); + GET_PROC(GenTextures); interface->fGenVertexArrays = (GrGLGenVertexArraysProc) eglGetProcAddress("glGenVertexArraysOES"); - GR_GET_PROC(GrGLGetBufferParameterivProc, GetBufferParameteriv); - GR_GET_PROC(GrGLGetErrorProc, GetError); - GR_GET_PROC(GrGLGetIntegervProc, GetIntegerv); - GR_GET_PROC(GrGLGetProgramInfoLogProc, GetProgramInfoLog); - GR_GET_PROC(GrGLGetProgramivProc, GetProgramiv); - GR_GET_PROC(GrGLGetShaderInfoLogProc, GetShaderInfoLog); - GR_GET_PROC(GrGLGetShaderivProc, GetShaderiv); - GR_GET_PROC(GrGLGetStringProc, GetString); - GR_GET_PROC(GrGLGetUniformLocationProc, GetUniformLocation); - GR_GET_PROC(GrGLLineWidthProc, LineWidth); - GR_GET_PROC(GrGLLinkProgramProc, LinkProgram); - GR_GET_PROC(GrGLPixelStoreiProc, PixelStorei); - GR_GET_PROC(GrGLReadPixelsProc, ReadPixels); - GR_GET_PROC(GrGLScissorProc, Scissor); - GR_GET_PROC(GrGLShaderSourceProc, ShaderSource); - GR_GET_PROC(GrGLStencilFuncProc, StencilFunc); - GR_GET_PROC(GrGLStencilFuncSeparateProc, StencilFuncSeparate); - GR_GET_PROC(GrGLStencilMaskProc, StencilMask); - GR_GET_PROC(GrGLStencilMaskSeparateProc, StencilMaskSeparate); - GR_GET_PROC(GrGLStencilOpProc, StencilOp); - GR_GET_PROC(GrGLStencilOpSeparateProc, StencilOpSeparate); - GR_GET_PROC(GrGLTexImage2DProc, TexImage2D); - GR_GET_PROC(GrGLTexParameteriProc, TexParameteri); - GR_GET_PROC(GrGLTexParameterivProc, TexParameteriv); - GR_GET_PROC(GrGLTexSubImage2DProc, TexSubImage2D); + GET_PROC(GetBufferParameteriv); + GET_PROC(GetError); + GET_PROC(GetIntegerv); + GET_PROC(GetProgramInfoLog); + GET_PROC(GetProgramiv); + GET_PROC(GetShaderInfoLog); + GET_PROC(GetShaderiv); + GET_PROC(GetString); + GET_PROC(GetUniformLocation); + GET_PROC(LineWidth); + GET_PROC(LinkProgram); + GET_PROC(PixelStorei); + GET_PROC(ReadPixels); + GET_PROC(Scissor); + GET_PROC(ShaderSource); + GET_PROC(StencilFunc); + GET_PROC(StencilFuncSeparate); + GET_PROC(StencilMask); + GET_PROC(StencilMaskSeparate); + GET_PROC(StencilOp); + GET_PROC(StencilOpSeparate); + GET_PROC(TexImage2D); + GET_PROC(TexParameteri); + GET_PROC(TexParameteriv); + GET_PROC(TexSubImage2D); #if GL_ARB_texture_storage - GR_GET_PROC(GrGLTexStorage2DProc, TexStorage2D); + GET_PROC(TexStorage2D); #elif GL_EXT_texture_storage interface->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2DEXT"); #endif - GR_GET_PROC(GrGLUniform1fProc, Uniform1f); - GR_GET_PROC(GrGLUniform1iProc, Uniform1i); - GR_GET_PROC(GrGLUniform1fvProc, Uniform1fv); - GR_GET_PROC(GrGLUniform1ivProc, Uniform1iv); + GET_PROC(Uniform1f); + GET_PROC(Uniform1i); + GET_PROC(Uniform1fv); + GET_PROC(Uniform1iv); - GR_GET_PROC(GrGLUniform2fProc, Uniform2f); - GR_GET_PROC(GrGLUniform2iProc, Uniform2i); - GR_GET_PROC(GrGLUniform2fvProc, Uniform2fv); - GR_GET_PROC(GrGLUniform2ivProc, Uniform2iv); + GET_PROC(Uniform2f); + GET_PROC(Uniform2i); + GET_PROC(Uniform2fv); + GET_PROC(Uniform2iv); - GR_GET_PROC(GrGLUniform3fProc, Uniform3f); - GR_GET_PROC(GrGLUniform3iProc, Uniform3i); - GR_GET_PROC(GrGLUniform3fvProc, Uniform3fv); - GR_GET_PROC(GrGLUniform3ivProc, Uniform3iv); + GET_PROC(Uniform3f); + GET_PROC(Uniform3i); + GET_PROC(Uniform3fv); + GET_PROC(Uniform3iv); - GR_GET_PROC(GrGLUniform4fProc, Uniform4f); - GR_GET_PROC(GrGLUniform4iProc, Uniform4i); - GR_GET_PROC(GrGLUniform4fvProc, Uniform4fv); - GR_GET_PROC(GrGLUniform4ivProc, Uniform4iv); + GET_PROC(Uniform4f); + GET_PROC(Uniform4i); + GET_PROC(Uniform4fv); + GET_PROC(Uniform4iv); - GR_GET_PROC(GrGLUniformMatrix2fvProc, UniformMatrix2fv); - GR_GET_PROC(GrGLUniformMatrix3fvProc, UniformMatrix3fv); - GR_GET_PROC(GrGLUniformMatrix4fvProc, UniformMatrix4fv); - GR_GET_PROC(GrGLUseProgramProc, UseProgram); - GR_GET_PROC(GrGLVertexAttrib4fvProc, VertexAttrib4fv); - GR_GET_PROC(GrGLVertexAttribPointerProc, VertexAttribPointer); - GR_GET_PROC(GrGLViewportProc, Viewport); - GR_GET_PROC(GrGLBindFramebufferProc, BindFramebuffer); - GR_GET_PROC(GrGLBindRenderbufferProc, BindRenderbuffer); - GR_GET_PROC(GrGLCheckFramebufferStatusProc, CheckFramebufferStatus); - GR_GET_PROC(GrGLDeleteFramebuffersProc, DeleteFramebuffers); - GR_GET_PROC(GrGLDeleteRenderbuffersProc, DeleteRenderbuffers); - GR_GET_PROC(GrGLFramebufferRenderbufferProc, FramebufferRenderbuffer); - GR_GET_PROC(GrGLFramebufferTexture2DProc, FramebufferTexture2D); - GR_GET_PROC(GrGLGenFramebuffersProc, GenFramebuffers); - GR_GET_PROC(GrGLGenRenderbuffersProc, GenRenderbuffers); - GR_GET_PROC(GrGLGetFramebufferAttachmentParameterivProc, - GetFramebufferAttachmentParameteriv); - GR_GET_PROC(GrGLGetRenderbufferParameterivProc, - GetRenderbufferParameteriv); - GR_GET_PROC(GrGLRenderbufferStorageProc, RenderbufferStorage); + GET_PROC(UniformMatrix2fv); + GET_PROC(UniformMatrix3fv); + GET_PROC(UniformMatrix4fv); + GET_PROC(UseProgram); + GET_PROC(VertexAttrib4fv); + GET_PROC(VertexAttribPointer); + GET_PROC(Viewport); + GET_PROC(BindFramebuffer); + GET_PROC(BindRenderbuffer); + GET_PROC(CheckFramebufferStatus); + GET_PROC(DeleteFramebuffers); + GET_PROC(DeleteRenderbuffers); + GET_PROC(FramebufferRenderbuffer); + GET_PROC(FramebufferTexture2D); + GET_PROC(GenFramebuffers); + GET_PROC(GenRenderbuffers); + GET_PROC(GetFramebufferAttachmentParameteriv); + GET_PROC(GetRenderbufferParameteriv); + GET_PROC(RenderbufferStorage); interface->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOES"); interface->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBufferOES"); diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp index 1cf9b53442..b95b888e19 100644 --- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp +++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp @@ -797,6 +797,7 @@ const GrGLInterface* GrGLCreateDebugInterface() { interface->fColorMask = noOpGLColorMask; interface->fCompileShader = noOpGLCompileShader; interface->fCompressedTexImage2D = noOpGLCompressedTexImage2D; + interface->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D; interface->fCreateProgram = debugGLCreateProgram; interface->fCreateShader = debugGLCreateShader; interface->fCullFace = noOpGLCullFace; diff --git a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp index 5492e19714..0ab0dbb748 100644 --- a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp +++ b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp @@ -33,6 +33,7 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fColorMask = glColorMask; interface->fCompileShader = glCompileShader; interface->fCompressedTexImage2D = glCompressedTexImage2D; + interface->fCopyTexSubImage2D = glCopyTexSubImage2D; interface->fCreateProgram = glCreateProgram; interface->fCreateShader = glCreateShader; interface->fCullFace = glCullFace; diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp index 75cec63d7c..1455d1fcfb 100644 --- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp +++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp @@ -87,6 +87,7 @@ const GrGLInterface* GrGLCreateNativeInterface() { GET_PROC(ColorMask); GET_PROC(CompileShader); GET_PROC(CompressedTexImage2D); + GET_PROC(CopyTexSubImage2D); GET_PROC(CreateProgram); GET_PROC(CreateShader); GET_PROC(CullFace); diff --git a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp index 6ccd9fa734..55f4409621 100644 --- a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp +++ b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp @@ -66,6 +66,7 @@ const GrGLInterface* GrGLCreateMesaInterface() { GR_GL_GET_PROC(ColorMask); GR_GL_GET_PROC(CompileShader); GR_GL_GET_PROC(CompressedTexImage2D); + GR_GL_GET_PROC(CopyTexSubImage2D); GR_GL_GET_PROC(CreateProgram); GR_GL_GET_PROC(CreateShader); GR_GL_GET_PROC(CullFace); diff --git a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp b/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp index 6a27ee3cb7..00bff3f870 100644 --- a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp +++ b/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp @@ -66,6 +66,7 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fColorMask = glColorMask; GR_GL_GET_PROC(CompileShader); interface->fCompressedTexImage2D = glCompressedTexImage2D; + interface->fCopyTexSubImage2D = glCopyTexSubImage2D; GR_GL_GET_PROC(CreateProgram); GR_GL_GET_PROC(CreateShader); interface->fCullFace = glCullFace; diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp index 173b3a39e0..28ef2effc2 100644 --- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp +++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp @@ -92,6 +92,7 @@ const GrGLInterface* GrGLCreateNativeInterface() { SET_PROC(ClearColor) SET_PROC(ClearStencil) SET_PROC(ColorMask) + SET_PROC(CopyTexSubImage2D) SET_PROC(CullFace) SET_PROC(DeleteTextures) SET_PROC(DepthMask)