Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp

Issue 137753005: Make GrGLInterface be context-specific on all platforms (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/gl/GrGLInterface.h ('k') | src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
diff --git a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
index 19aee2bae33df93f8117767395157f3cb7ea89b6..e509b92822acdc8336b00bd2e93b5817fc344c83 100644
--- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
+++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
@@ -22,7 +22,6 @@
const GrGLInterface* GrGLCreateANGLEInterface() {
- static SkAutoTUnref<GrGLInterface> glInterface;
static HMODULE ghANGLELib = NULL;
if (NULL == ghANGLELib) {
@@ -34,126 +33,122 @@ const GrGLInterface* GrGLCreateANGLEInterface() {
return NULL;
}
- if (!glInterface.get()) {
- GrGLInterface* interface = new GrGLInterface;
- glInterface.reset(interface);
- interface->fBindingsExported = kES_GrGLBinding;
-
- GET_PROC(ActiveTexture);
- GET_PROC(AttachShader);
- GET_PROC(BindAttribLocation);
- GET_PROC(BindBuffer);
- GET_PROC(BindTexture);
- interface->fBindVertexArray =
- (GrGLBindVertexArrayProc) eglGetProcAddress("glBindVertexArrayOES");
- 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");
- 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(GenerateMipmap);
- GET_PROC(GenTextures);
- interface->fGenVertexArrays =
- (GrGLGenVertexArraysProc) eglGetProcAddress("glGenVertexArraysOES");
- 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);
+ GrGLInterface* interface = SkNEW(GrGLInterface);
+ interface->fBindingsExported = kES_GrGLBinding;
+
+ GET_PROC(ActiveTexture);
+ GET_PROC(AttachShader);
+ GET_PROC(BindAttribLocation);
+ GET_PROC(BindBuffer);
+ GET_PROC(BindTexture);
+ interface->fBindVertexArray =
+ (GrGLBindVertexArrayProc) eglGetProcAddress("glBindVertexArrayOES");
+ 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");
+ 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(GenerateMipmap);
+ GET_PROC(GenTextures);
+ interface->fGenVertexArrays =
+ (GrGLGenVertexArraysProc) eglGetProcAddress("glGenVertexArraysOES");
+ 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
- GET_PROC(TexStorage2D);
+ GET_PROC(TexStorage2D);
#elif GL_EXT_texture_storage
- interface->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2DEXT");
+ interface->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2DEXT");
#endif
- GET_PROC(Uniform1f);
- GET_PROC(Uniform1i);
- GET_PROC(Uniform1fv);
- GET_PROC(Uniform1iv);
-
- GET_PROC(Uniform2f);
- GET_PROC(Uniform2i);
- GET_PROC(Uniform2fv);
- GET_PROC(Uniform2iv);
-
- GET_PROC(Uniform3f);
- GET_PROC(Uniform3i);
- GET_PROC(Uniform3fv);
- GET_PROC(Uniform3iv);
-
- GET_PROC(Uniform4f);
- GET_PROC(Uniform4i);
- GET_PROC(Uniform4fv);
- GET_PROC(Uniform4iv);
-
- 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");
- }
- glInterface.get()->ref();
- return glInterface.get();
+ GET_PROC(Uniform1f);
+ GET_PROC(Uniform1i);
+ GET_PROC(Uniform1fv);
+ GET_PROC(Uniform1iv);
+
+ GET_PROC(Uniform2f);
+ GET_PROC(Uniform2i);
+ GET_PROC(Uniform2fv);
+ GET_PROC(Uniform2iv);
+
+ GET_PROC(Uniform3f);
+ GET_PROC(Uniform3i);
+ GET_PROC(Uniform3fv);
+ GET_PROC(Uniform3iv);
+
+ GET_PROC(Uniform4f);
+ GET_PROC(Uniform4i);
+ GET_PROC(Uniform4fv);
+ GET_PROC(Uniform4iv);
+
+ 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");
+ return interface;
}
« no previous file with comments | « include/gpu/gl/GrGLInterface.h ('k') | src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698