Index: src/gpu/gl/GrGLCreateNullInterface.cpp |
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp |
index 50b1828399944705022b523fa146f7036e203810..391aea27f4667f3a922a3dba469f3faa3a97104b 100644 |
--- a/src/gpu/gl/GrGLCreateNullInterface.cpp |
+++ b/src/gpu/gl/GrGLCreateNullInterface.cpp |
@@ -259,148 +259,144 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLGetBufferParameteriv(GrGLenum target, GrGLenu |
} // end anonymous namespace |
const GrGLInterface* GrGLCreateNullInterface() { |
- // The gl functions are not context-specific so we create one global |
- // interface |
- static SkAutoTUnref<GrGLInterface> glInterface; |
- if (!glInterface.get()) { |
- GrGLInterface* interface = SkNEW(GrGLInterface); |
- glInterface.reset(interface); |
- |
- interface->fStandard = kGL_GrGLStandard; |
- |
- GrGLInterface::Functions* functions = &interface->fFunctions; |
- functions->fActiveTexture = nullGLActiveTexture; |
- functions->fAttachShader = nullGLAttachShader; |
- functions->fBeginQuery = nullGLBeginQuery; |
- functions->fBindAttribLocation = nullGLBindAttribLocation; |
- functions->fBindBuffer = nullGLBindBuffer; |
- functions->fBindFragDataLocation = noOpGLBindFragDataLocation; |
- functions->fBindTexture = nullGLBindTexture; |
- functions->fBindVertexArray = nullGLBindVertexArray; |
- functions->fBlendColor = noOpGLBlendColor; |
- functions->fBlendFunc = noOpGLBlendFunc; |
- functions->fBufferData = nullGLBufferData; |
- functions->fBufferSubData = noOpGLBufferSubData; |
- functions->fClear = noOpGLClear; |
- functions->fClearColor = noOpGLClearColor; |
- functions->fClearStencil = noOpGLClearStencil; |
- functions->fColorMask = noOpGLColorMask; |
- functions->fCompileShader = noOpGLCompileShader; |
- functions->fCompressedTexImage2D = noOpGLCompressedTexImage2D; |
- functions->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D; |
- functions->fCreateProgram = nullGLCreateProgram; |
- functions->fCreateShader = nullGLCreateShader; |
- functions->fCullFace = noOpGLCullFace; |
- functions->fDeleteBuffers = nullGLDeleteBuffers; |
- functions->fDeleteProgram = nullGLDelete; |
- functions->fDeleteQueries = noOpGLDeleteIds; |
- functions->fDeleteShader = nullGLDelete; |
- functions->fDeleteTextures = noOpGLDeleteIds; |
- functions->fDeleteVertexArrays = noOpGLDeleteIds; |
- functions->fDepthMask = noOpGLDepthMask; |
- functions->fDisable = noOpGLDisable; |
- functions->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray; |
- functions->fDrawArrays = noOpGLDrawArrays; |
- functions->fDrawBuffer = noOpGLDrawBuffer; |
- functions->fDrawBuffers = noOpGLDrawBuffers; |
- functions->fDrawElements = noOpGLDrawElements; |
- functions->fEnable = noOpGLEnable; |
- functions->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray; |
- functions->fEndQuery = noOpGLEndQuery; |
- functions->fFinish = noOpGLFinish; |
- functions->fFlush = noOpGLFlush; |
- functions->fFrontFace = noOpGLFrontFace; |
- functions->fGenBuffers = nullGLGenBuffers; |
- functions->fGenerateMipmap = nullGLGenerateMipmap; |
- functions->fGenQueries = noOpGLGenIds; |
- functions->fGenTextures = noOpGLGenIds; |
- functions->fGenVertexArrays = noOpGLGenIds; |
- functions->fGetBufferParameteriv = nullGLGetBufferParameteriv; |
- functions->fGetError = noOpGLGetError; |
- functions->fGetIntegerv = noOpGLGetIntegerv; |
- functions->fGetQueryObjecti64v = noOpGLGetQueryObjecti64v; |
- functions->fGetQueryObjectiv = noOpGLGetQueryObjectiv; |
- functions->fGetQueryObjectui64v = noOpGLGetQueryObjectui64v; |
- functions->fGetQueryObjectuiv = noOpGLGetQueryObjectuiv; |
- functions->fGetQueryiv = noOpGLGetQueryiv; |
- functions->fGetProgramInfoLog = noOpGLGetInfoLog; |
- functions->fGetProgramiv = noOpGLGetShaderOrProgramiv; |
- functions->fGetShaderInfoLog = noOpGLGetInfoLog; |
- functions->fGetShaderiv = noOpGLGetShaderOrProgramiv; |
- functions->fGetString = noOpGLGetString; |
- functions->fGetStringi = noOpGLGetStringi; |
- functions->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv; |
- functions->fGetUniformLocation = noOpGLGetUniformLocation; |
- functions->fInsertEventMarker = noOpGLInsertEventMarker; |
- functions->fLoadIdentity = noOpGLLoadIdentity; |
- functions->fLoadMatrixf = noOpGLLoadMatrixf; |
- functions->fLineWidth = noOpGLLineWidth; |
- functions->fLinkProgram = noOpGLLinkProgram; |
- functions->fMatrixMode = noOpGLMatrixMode; |
- functions->fPixelStorei = nullGLPixelStorei; |
- functions->fPopGroupMarker = noOpGLPopGroupMarker; |
- functions->fPushGroupMarker = noOpGLPushGroupMarker; |
- functions->fQueryCounter = noOpGLQueryCounter; |
- functions->fReadBuffer = noOpGLReadBuffer; |
- functions->fReadPixels = nullGLReadPixels; |
- functions->fScissor = noOpGLScissor; |
- functions->fShaderSource = noOpGLShaderSource; |
- functions->fStencilFunc = noOpGLStencilFunc; |
- functions->fStencilFuncSeparate = noOpGLStencilFuncSeparate; |
- functions->fStencilMask = noOpGLStencilMask; |
- functions->fStencilMaskSeparate = noOpGLStencilMaskSeparate; |
- functions->fStencilOp = noOpGLStencilOp; |
- functions->fStencilOpSeparate = noOpGLStencilOpSeparate; |
- functions->fTexGenfv = noOpGLTexGenfv; |
- functions->fTexGeni = noOpGLTexGeni; |
- functions->fTexImage2D = noOpGLTexImage2D; |
- functions->fTexParameteri = noOpGLTexParameteri; |
- functions->fTexParameteriv = noOpGLTexParameteriv; |
- functions->fTexSubImage2D = noOpGLTexSubImage2D; |
- functions->fTexStorage2D = noOpGLTexStorage2D; |
- functions->fDiscardFramebuffer = noOpGLDiscardFramebuffer; |
- functions->fUniform1f = noOpGLUniform1f; |
- functions->fUniform1i = noOpGLUniform1i; |
- functions->fUniform1fv = noOpGLUniform1fv; |
- functions->fUniform1iv = noOpGLUniform1iv; |
- functions->fUniform2f = noOpGLUniform2f; |
- functions->fUniform2i = noOpGLUniform2i; |
- functions->fUniform2fv = noOpGLUniform2fv; |
- functions->fUniform2iv = noOpGLUniform2iv; |
- functions->fUniform3f = noOpGLUniform3f; |
- functions->fUniform3i = noOpGLUniform3i; |
- functions->fUniform3fv = noOpGLUniform3fv; |
- functions->fUniform3iv = noOpGLUniform3iv; |
- functions->fUniform4f = noOpGLUniform4f; |
- functions->fUniform4i = noOpGLUniform4i; |
- functions->fUniform4fv = noOpGLUniform4fv; |
- functions->fUniform4iv = noOpGLUniform4iv; |
- functions->fUniformMatrix2fv = noOpGLUniformMatrix2fv; |
- functions->fUniformMatrix3fv = noOpGLUniformMatrix3fv; |
- functions->fUniformMatrix4fv = noOpGLUniformMatrix4fv; |
- functions->fUseProgram = nullGLUseProgram; |
- functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv; |
- functions->fVertexAttribPointer = noOpGLVertexAttribPointer; |
- functions->fViewport = nullGLViewport; |
- functions->fBindFramebuffer = nullGLBindFramebuffer; |
- functions->fBindRenderbuffer = nullGLBindRenderbuffer; |
- functions->fCheckFramebufferStatus = noOpGLCheckFramebufferStatus; |
- functions->fDeleteFramebuffers = nullGLDeleteFramebuffers; |
- functions->fDeleteRenderbuffers = nullGLDeleteRenderbuffers; |
- functions->fFramebufferRenderbuffer = nullGLFramebufferRenderbuffer; |
- functions->fFramebufferTexture2D = nullGLFramebufferTexture2D; |
- functions->fGenFramebuffers = noOpGLGenIds; |
- functions->fGenRenderbuffers = noOpGLGenIds; |
- functions->fGetFramebufferAttachmentParameteriv = noOpGLGetFramebufferAttachmentParameteriv; |
- functions->fGetRenderbufferParameteriv = noOpGLGetRenderbufferParameteriv; |
- functions->fRenderbufferStorage = noOpGLRenderbufferStorage; |
- functions->fRenderbufferStorageMultisample = noOpGLRenderbufferStorageMultisample; |
- functions->fBlitFramebuffer = noOpGLBlitFramebuffer; |
- functions->fResolveMultisampleFramebuffer = noOpGLResolveMultisampleFramebuffer; |
- functions->fMapBuffer = nullGLMapBuffer; |
- functions->fUnmapBuffer = nullGLUnmapBuffer; |
- functions->fBindFragDataLocationIndexed = noOpGLBindFragDataLocationIndexed; |
- } |
- glInterface.get()->ref(); |
- return glInterface.get(); |
+ GrGLInterface* interface = SkNEW(GrGLInterface); |
+ |
+ interface->fStandard = kGL_GrGLStandard; |
+ |
+ GrGLInterface::Functions* functions = &interface->fFunctions; |
+ functions->fActiveTexture = nullGLActiveTexture; |
+ functions->fAttachShader = nullGLAttachShader; |
+ functions->fBeginQuery = nullGLBeginQuery; |
+ functions->fBindAttribLocation = nullGLBindAttribLocation; |
+ functions->fBindBuffer = nullGLBindBuffer; |
+ functions->fBindFragDataLocation = noOpGLBindFragDataLocation; |
+ functions->fBindTexture = nullGLBindTexture; |
+ functions->fBindVertexArray = nullGLBindVertexArray; |
+ functions->fBlendColor = noOpGLBlendColor; |
+ functions->fBlendFunc = noOpGLBlendFunc; |
+ functions->fBufferData = nullGLBufferData; |
+ functions->fBufferSubData = noOpGLBufferSubData; |
+ functions->fClear = noOpGLClear; |
+ functions->fClearColor = noOpGLClearColor; |
+ functions->fClearStencil = noOpGLClearStencil; |
+ functions->fColorMask = noOpGLColorMask; |
+ functions->fCompileShader = noOpGLCompileShader; |
+ functions->fCompressedTexImage2D = noOpGLCompressedTexImage2D; |
+ functions->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D; |
+ functions->fCreateProgram = nullGLCreateProgram; |
+ functions->fCreateShader = nullGLCreateShader; |
+ functions->fCullFace = noOpGLCullFace; |
+ functions->fDeleteBuffers = nullGLDeleteBuffers; |
+ functions->fDeleteProgram = nullGLDelete; |
+ functions->fDeleteQueries = noOpGLDeleteIds; |
+ functions->fDeleteShader = nullGLDelete; |
+ functions->fDeleteTextures = noOpGLDeleteIds; |
+ functions->fDeleteVertexArrays = noOpGLDeleteIds; |
+ functions->fDepthMask = noOpGLDepthMask; |
+ functions->fDisable = noOpGLDisable; |
+ functions->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray; |
+ functions->fDrawArrays = noOpGLDrawArrays; |
+ functions->fDrawBuffer = noOpGLDrawBuffer; |
+ functions->fDrawBuffers = noOpGLDrawBuffers; |
+ functions->fDrawElements = noOpGLDrawElements; |
+ functions->fEnable = noOpGLEnable; |
+ functions->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray; |
+ functions->fEndQuery = noOpGLEndQuery; |
+ functions->fFinish = noOpGLFinish; |
+ functions->fFlush = noOpGLFlush; |
+ functions->fFrontFace = noOpGLFrontFace; |
+ functions->fGenBuffers = nullGLGenBuffers; |
+ functions->fGenerateMipmap = nullGLGenerateMipmap; |
+ functions->fGenQueries = noOpGLGenIds; |
+ functions->fGenTextures = noOpGLGenIds; |
+ functions->fGenVertexArrays = noOpGLGenIds; |
+ functions->fGetBufferParameteriv = nullGLGetBufferParameteriv; |
+ functions->fGetError = noOpGLGetError; |
+ functions->fGetIntegerv = noOpGLGetIntegerv; |
+ functions->fGetQueryObjecti64v = noOpGLGetQueryObjecti64v; |
+ functions->fGetQueryObjectiv = noOpGLGetQueryObjectiv; |
+ functions->fGetQueryObjectui64v = noOpGLGetQueryObjectui64v; |
+ functions->fGetQueryObjectuiv = noOpGLGetQueryObjectuiv; |
+ functions->fGetQueryiv = noOpGLGetQueryiv; |
+ functions->fGetProgramInfoLog = noOpGLGetInfoLog; |
+ functions->fGetProgramiv = noOpGLGetShaderOrProgramiv; |
+ functions->fGetShaderInfoLog = noOpGLGetInfoLog; |
+ functions->fGetShaderiv = noOpGLGetShaderOrProgramiv; |
+ functions->fGetString = noOpGLGetString; |
+ functions->fGetStringi = noOpGLGetStringi; |
+ functions->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv; |
+ functions->fGetUniformLocation = noOpGLGetUniformLocation; |
+ functions->fInsertEventMarker = noOpGLInsertEventMarker; |
+ functions->fLoadIdentity = noOpGLLoadIdentity; |
+ functions->fLoadMatrixf = noOpGLLoadMatrixf; |
+ functions->fLineWidth = noOpGLLineWidth; |
+ functions->fLinkProgram = noOpGLLinkProgram; |
+ functions->fMatrixMode = noOpGLMatrixMode; |
+ functions->fPixelStorei = nullGLPixelStorei; |
+ functions->fPopGroupMarker = noOpGLPopGroupMarker; |
+ functions->fPushGroupMarker = noOpGLPushGroupMarker; |
+ functions->fQueryCounter = noOpGLQueryCounter; |
+ functions->fReadBuffer = noOpGLReadBuffer; |
+ functions->fReadPixels = nullGLReadPixels; |
+ functions->fScissor = noOpGLScissor; |
+ functions->fShaderSource = noOpGLShaderSource; |
+ functions->fStencilFunc = noOpGLStencilFunc; |
+ functions->fStencilFuncSeparate = noOpGLStencilFuncSeparate; |
+ functions->fStencilMask = noOpGLStencilMask; |
+ functions->fStencilMaskSeparate = noOpGLStencilMaskSeparate; |
+ functions->fStencilOp = noOpGLStencilOp; |
+ functions->fStencilOpSeparate = noOpGLStencilOpSeparate; |
+ functions->fTexGenfv = noOpGLTexGenfv; |
+ functions->fTexGeni = noOpGLTexGeni; |
+ functions->fTexImage2D = noOpGLTexImage2D; |
+ functions->fTexParameteri = noOpGLTexParameteri; |
+ functions->fTexParameteriv = noOpGLTexParameteriv; |
+ functions->fTexSubImage2D = noOpGLTexSubImage2D; |
+ functions->fTexStorage2D = noOpGLTexStorage2D; |
+ functions->fDiscardFramebuffer = noOpGLDiscardFramebuffer; |
+ functions->fUniform1f = noOpGLUniform1f; |
+ functions->fUniform1i = noOpGLUniform1i; |
+ functions->fUniform1fv = noOpGLUniform1fv; |
+ functions->fUniform1iv = noOpGLUniform1iv; |
+ functions->fUniform2f = noOpGLUniform2f; |
+ functions->fUniform2i = noOpGLUniform2i; |
+ functions->fUniform2fv = noOpGLUniform2fv; |
+ functions->fUniform2iv = noOpGLUniform2iv; |
+ functions->fUniform3f = noOpGLUniform3f; |
+ functions->fUniform3i = noOpGLUniform3i; |
+ functions->fUniform3fv = noOpGLUniform3fv; |
+ functions->fUniform3iv = noOpGLUniform3iv; |
+ functions->fUniform4f = noOpGLUniform4f; |
+ functions->fUniform4i = noOpGLUniform4i; |
+ functions->fUniform4fv = noOpGLUniform4fv; |
+ functions->fUniform4iv = noOpGLUniform4iv; |
+ functions->fUniformMatrix2fv = noOpGLUniformMatrix2fv; |
+ functions->fUniformMatrix3fv = noOpGLUniformMatrix3fv; |
+ functions->fUniformMatrix4fv = noOpGLUniformMatrix4fv; |
+ functions->fUseProgram = nullGLUseProgram; |
+ functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv; |
+ functions->fVertexAttribPointer = noOpGLVertexAttribPointer; |
+ functions->fViewport = nullGLViewport; |
+ functions->fBindFramebuffer = nullGLBindFramebuffer; |
+ functions->fBindRenderbuffer = nullGLBindRenderbuffer; |
+ functions->fCheckFramebufferStatus = noOpGLCheckFramebufferStatus; |
+ functions->fDeleteFramebuffers = nullGLDeleteFramebuffers; |
+ functions->fDeleteRenderbuffers = nullGLDeleteRenderbuffers; |
+ functions->fFramebufferRenderbuffer = nullGLFramebufferRenderbuffer; |
+ functions->fFramebufferTexture2D = nullGLFramebufferTexture2D; |
+ functions->fGenFramebuffers = noOpGLGenIds; |
+ functions->fGenRenderbuffers = noOpGLGenIds; |
+ functions->fGetFramebufferAttachmentParameteriv = noOpGLGetFramebufferAttachmentParameteriv; |
+ functions->fGetRenderbufferParameteriv = noOpGLGetRenderbufferParameteriv; |
+ functions->fRenderbufferStorage = noOpGLRenderbufferStorage; |
+ functions->fRenderbufferStorageMultisample = noOpGLRenderbufferStorageMultisample; |
+ functions->fBlitFramebuffer = noOpGLBlitFramebuffer; |
+ functions->fResolveMultisampleFramebuffer = noOpGLResolveMultisampleFramebuffer; |
+ functions->fMapBuffer = nullGLMapBuffer; |
+ functions->fUnmapBuffer = nullGLUnmapBuffer; |
+ functions->fBindFragDataLocationIndexed = noOpGLBindFragDataLocationIndexed; |
+ |
+ interface->fExtensions.init(kGL_GrGLStandard, functions->fGetString, functions->fGetStringi, |
+ functions->fGetIntegerv); |
+ return interface; |
} |