| Index: gpu/pgl/egl_proc_address.c
|
| ===================================================================
|
| --- gpu/pgl/egl_proc_address.c (revision 45618)
|
| +++ gpu/pgl/egl_proc_address.c (working copy)
|
| @@ -1,312 +0,0 @@
|
| -// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -// This file contains the implementation of eglGetProcAddress
|
| -
|
| -#include <stdlib.h>
|
| -#include <GLES2/gl2.h>
|
| -
|
| -typedef void (*EGLFunctionPointer)(void);
|
| -struct EGLFunctionInfo {
|
| - EGLFunctionPointer func;
|
| - char const * const name;
|
| -};
|
| -
|
| -void (* eglGetProcAddress(char const * procname))() {
|
| - static const struct EGLFunctionInfo gl_functions[] = {
|
| - { (EGLFUNCTIONPOINTER)(&glActiveTexture),
|
| - "glActiveTexture", },
|
| - { (EGLFUNCTIONPOINTER)(&glAttachShader),
|
| - "glAttachShader", },
|
| - { (EGLFUNCTIONPOINTER)(&glBindAttribLocation),
|
| - "glBindAttribLocation", },
|
| - { (EGLFUNCTIONPOINTER)(&glBindBuffer),
|
| - "glBindBuffer", },
|
| - { (EGLFUNCTIONPOINTER)(&glBindFramebuffer),
|
| - "glBindFramebuffer", },
|
| - { (EGLFUNCTIONPOINTER)(&glBindRenderbuffer),
|
| - "glBindRenderbuffer", },
|
| - { (EGLFUNCTIONPOINTER)(&glBindTexture),
|
| - "glBindTexture", },
|
| - { (EGLFUNCTIONPOINTER)(&glBlendColor),
|
| - "glBlendColor", },
|
| - { (EGLFUNCTIONPOINTER)(&glBlendEquation),
|
| - "glBlendEquation", },
|
| - { (EGLFUNCTIONPOINTER)(&glBlendEquationSeparate),
|
| - "glBlendEquationSeparate", },
|
| - { (EGLFUNCTIONPOINTER)(&glBlendFunc),
|
| - "glBlendFunc", },
|
| - { (EGLFUNCTIONPOINTER)(&glBlendFuncSeparate),
|
| - "glBlendFuncSeparate", },
|
| - { (EGLFUNCTIONPOINTER)(&glBufferData),
|
| - "glBufferData", },
|
| - { (EGLFUNCTIONPOINTER)(&glBufferSubData),
|
| - "glBufferSubData", },
|
| - { (EGLFUNCTIONPOINTER)(&glCheckFramebufferStatus),
|
| - "glCheckFramebufferStatus", },
|
| - { (EGLFUNCTIONPOINTER)(&glClear),
|
| - "glClear", },
|
| - { (EGLFUNCTIONPOINTER)(&glClearColor),
|
| - "glClearColor", },
|
| - { (EGLFUNCTIONPOINTER)(&glClearDepthf),
|
| - "glClearDepthf", },
|
| - { (EGLFUNCTIONPOINTER)(&glClearStencil),
|
| - "glClearStencil", },
|
| - { (EGLFUNCTIONPOINTER)(&glColorMask),
|
| - "glColorMask", },
|
| - { (EGLFUNCTIONPOINTER)(&glCompileShader),
|
| - "glCompileShader", },
|
| - { (EGLFUNCTIONPOINTER)(&glCompressedTexImage2D),
|
| - "glCompressedTexImage2D", },
|
| - { (EGLFUNCTIONPOINTER)(&glCompressedTexSubImage2D),
|
| - "glCompressedTexSubImage2D", },
|
| - { (EGLFUNCTIONPOINTER)(&glCopyTexImage2D),
|
| - "glCopyTexImage2D", },
|
| - { (EGLFUNCTIONPOINTER)(&glCopyTexSubImage2D),
|
| - "glCopyTexSubImage2D", },
|
| - { (EGLFUNCTIONPOINTER)(&glCreateProgram),
|
| - "glCreateProgram", },
|
| - { (EGLFUNCTIONPOINTER)(&glCreateShader),
|
| - "glCreateShader", },
|
| - { (EGLFUNCTIONPOINTER)(&glCullFace),
|
| - "glCullFace", },
|
| - { (EGLFUNCTIONPOINTER)(&glDeleteBuffers),
|
| - "glDeleteBuffers", },
|
| - { (EGLFUNCTIONPOINTER)(&glDeleteFramebuffers),
|
| - "glDeleteFramebuffers", },
|
| - { (EGLFUNCTIONPOINTER)(&glDeleteProgram),
|
| - "glDeleteProgram", },
|
| - { (EGLFUNCTIONPOINTER)(&glDeleteRenderbuffers),
|
| - "glDeleteRenderbuffers", },
|
| - { (EGLFUNCTIONPOINTER)(&glDeleteShader),
|
| - "glDeleteShader", },
|
| - { (EGLFUNCTIONPOINTER)(&glDeleteTextures),
|
| - "glDeleteTextures", },
|
| - { (EGLFUNCTIONPOINTER)(&glDepthFunc),
|
| - "glDepthFunc", },
|
| - { (EGLFUNCTIONPOINTER)(&glDepthMask),
|
| - "glDepthMask", },
|
| - { (EGLFUNCTIONPOINTER)(&glDepthRangef),
|
| - "glDepthRangef", },
|
| - { (EGLFUNCTIONPOINTER)(&glDetachShader),
|
| - "glDetachShader", },
|
| - { (EGLFUNCTIONPOINTER)(&glDisable),
|
| - "glDisable", },
|
| - { (EGLFUNCTIONPOINTER)(&glDisableVertexAttribArray),
|
| - "glDisableVertexAttribArray", },
|
| - { (EGLFUNCTIONPOINTER)(&glDrawArrays),
|
| - "glDrawArrays", },
|
| - { (EGLFUNCTIONPOINTER)(&glDrawElements),
|
| - "glDrawElements", },
|
| - { (EGLFUNCTIONPOINTER)(&glEnable),
|
| - "glEnable", },
|
| - { (EGLFUNCTIONPOINTER)(&glEnableVertexAttribArray),
|
| - "glEnableVertexAttribArray", },
|
| - { (EGLFUNCTIONPOINTER)(&glFinish),
|
| - "glFinish", },
|
| - { (EGLFUNCTIONPOINTER)(&glFlush),
|
| - "glFlush", },
|
| - { (EGLFUNCTIONPOINTER)(&glFramebufferRenderbuffer),
|
| - "glFramebufferRenderbuffer", },
|
| - { (EGLFUNCTIONPOINTER)(&glFramebufferTexture2D),
|
| - "glFramebufferTexture2D", },
|
| - { (EGLFUNCTIONPOINTER)(&glFrontFace),
|
| - "glFrontFace", },
|
| - { (EGLFUNCTIONPOINTER)(&glGenBuffers),
|
| - "glGenBuffers", },
|
| - { (EGLFUNCTIONPOINTER)(&glGenerateMipmap),
|
| - "glGenerateMipmap", },
|
| - { (EGLFUNCTIONPOINTER)(&glGenFramebuffers),
|
| - "glGenFramebuffers", },
|
| - { (EGLFUNCTIONPOINTER)(&glGenRenderbuffers),
|
| - "glGenRenderbuffers", },
|
| - { (EGLFUNCTIONPOINTER)(&glGenTextures),
|
| - "glGenTextures", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetActiveAttrib),
|
| - "glGetActiveAttrib", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetActiveUniform),
|
| - "glGetActiveUniform", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetAttachedShaders),
|
| - "glGetAttachedShaders", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetAttribLocation),
|
| - "glGetAttribLocation", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetBooleanv),
|
| - "glGetBooleanv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetBufferParameteriv),
|
| - "glGetBufferParameteriv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetError),
|
| - "glGetError", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetFloatv),
|
| - "glGetFloatv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetFramebufferAttachmentParameteriv),
|
| - "glGetFramebufferAttachmentParameteriv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetIntegerv),
|
| - "glGetIntegerv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetProgramiv),
|
| - "glGetProgramiv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetProgramInfoLog),
|
| - "glGetProgramInfoLog", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetRenderbufferParameteriv),
|
| - "glGetRenderbufferParameteriv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetShaderiv),
|
| - "glGetShaderiv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetShaderInfoLog),
|
| - "glGetShaderInfoLog", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetShaderPrecisionFormat),
|
| - "glGetShaderPrecisionFormat", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetShaderSource),
|
| - "glGetShaderSource", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetString),
|
| - "glGetString", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetTexParameterfv),
|
| - "glGetTexParameterfv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetTexParameteriv),
|
| - "glGetTexParameteriv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetUniformfv),
|
| - "glGetUniformfv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetUniformiv),
|
| - "glGetUniformiv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetUniformLocation),
|
| - "glGetUniformLocation", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetVertexAttribfv),
|
| - "glGetVertexAttribfv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetVertexAttribiv),
|
| - "glGetVertexAttribiv", },
|
| - { (EGLFUNCTIONPOINTER)(&glGetVertexAttribPointerv),
|
| - "glGetVertexAttribPointerv", },
|
| - { (EGLFUNCTIONPOINTER)(&glHint),
|
| - "glHint", },
|
| - { (EGLFUNCTIONPOINTER)(&glIsBuffer),
|
| - "glIsBuffer", },
|
| - { (EGLFUNCTIONPOINTER)(&glIsEnabled),
|
| - "glIsEnabled", },
|
| - { (EGLFUNCTIONPOINTER)(&glIsFramebuffer),
|
| - "glIsFramebuffer", },
|
| - { (EGLFUNCTIONPOINTER)(&glIsProgram),
|
| - "glIsProgram", },
|
| - { (EGLFUNCTIONPOINTER)(&glIsRenderbuffer),
|
| - "glIsRenderbuffer", },
|
| - { (EGLFUNCTIONPOINTER)(&glIsShader),
|
| - "glIsShader", },
|
| - { (EGLFUNCTIONPOINTER)(&glIsTexture),
|
| - "glIsTexture", },
|
| - { (EGLFUNCTIONPOINTER)(&glLineWidth),
|
| - "glLineWidth", },
|
| - { (EGLFUNCTIONPOINTER)(&glLinkProgram),
|
| - "glLinkProgram", },
|
| - { (EGLFUNCTIONPOINTER)(&glPixelStorei),
|
| - "glPixelStorei", },
|
| - { (EGLFUNCTIONPOINTER)(&glPolygonOffset),
|
| - "glPolygonOffset", },
|
| - { (EGLFUNCTIONPOINTER)(&glReadPixels),
|
| - "glReadPixels", },
|
| - { (EGLFUNCTIONPOINTER)(&glReleaseShaderCompiler),
|
| - "glReleaseShaderCompiler", },
|
| - { (EGLFUNCTIONPOINTER)(&glRenderbufferStorage),
|
| - "glRenderbufferStorage", },
|
| - { (EGLFUNCTIONPOINTER)(&glSampleCoverage),
|
| - "glSampleCoverage", },
|
| - { (EGLFUNCTIONPOINTER)(&glScissor),
|
| - "glScissor", },
|
| - { (EGLFUNCTIONPOINTER)(&glShaderBinary),
|
| - "glShaderBinary", },
|
| - { (EGLFUNCTIONPOINTER)(&glShaderSource),
|
| - "glShaderSource", },
|
| - { (EGLFUNCTIONPOINTER)(&glStencilFunc),
|
| - "glStencilFunc", },
|
| - { (EGLFUNCTIONPOINTER)(&glStencilFuncSeparate),
|
| - "glStencilFuncSeparate", },
|
| - { (EGLFUNCTIONPOINTER)(&glStencilMask),
|
| - "glStencilMask", },
|
| - { (EGLFUNCTIONPOINTER)(&glStencilMaskSeparate),
|
| - "glStencilMaskSeparate", },
|
| - { (EGLFUNCTIONPOINTER)(&glStencilOp),
|
| - "glStencilOp", },
|
| - { (EGLFUNCTIONPOINTER)(&glStencilOpSeparate),
|
| - "glStencilOpSeparate", },
|
| - { (EGLFUNCTIONPOINTER)(&glTexImage2D),
|
| - "glTexImage2D", },
|
| - { (EGLFUNCTIONPOINTER)(&glTexParameterf),
|
| - "glTexParameterf", },
|
| - { (EGLFUNCTIONPOINTER)(&glTexParameterfv),
|
| - "glTexParameterfv", },
|
| - { (EGLFUNCTIONPOINTER)(&glTexParameteri),
|
| - "glTexParameteri", },
|
| - { (EGLFUNCTIONPOINTER)(&glTexParameteriv),
|
| - "glTexParameteriv", },
|
| - { (EGLFUNCTIONPOINTER)(&glTexSubImage2D),
|
| - "glTexSubImage2D", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform1f),
|
| - "glUniform1f", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform1fv),
|
| - "glUniform1fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform1i),
|
| - "glUniform1i", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform1iv),
|
| - "glUniform1iv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform2f),
|
| - "glUniform2f", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform2fv),
|
| - "glUniform2fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform2i),
|
| - "glUniform2i", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform2iv),
|
| - "glUniform2iv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform3f),
|
| - "glUniform3f", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform3fv),
|
| - "glUniform3fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform3i),
|
| - "glUniform3i", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform3iv),
|
| - "glUniform3iv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform4f),
|
| - "glUniform4f", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform4fv),
|
| - "glUniform4fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform4i),
|
| - "glUniform4i", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniform4iv),
|
| - "glUniform4iv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniformMatrix2fv),
|
| - "glUniformMatrix2fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniformMatrix3fv),
|
| - "glUniformMatrix3fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUniformMatrix4fv),
|
| - "glUniformMatrix4fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glUseProgram),
|
| - "glUseProgram", },
|
| - { (EGLFUNCTIONPOINTER)(&glValidateProgram),
|
| - "glValidateProgram", },
|
| - { (EGLFUNCTIONPOINTER)(&glVertexAttrib1f),
|
| - "glVertexAttrib1f", },
|
| - { (EGLFUNCTIONPOINTER)(&glVertexAttrib1fv),
|
| - "glVertexAttrib1fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glVertexAttrib2f),
|
| - "glVertexAttrib2f", },
|
| - { (EGLFUNCTIONPOINTER)(&glVertexAttrib2fv),
|
| - "glVertexAttrib2fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glVertexAttrib3f),
|
| - "glVertexAttrib3f", },
|
| - { (EGLFUNCTIONPOINTER)(&glVertexAttrib3fv),
|
| - "glVertexAttrib3fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glVertexAttrib4f),
|
| - "glVertexAttrib4f", },
|
| - { (EGLFUNCTIONPOINTER)(&glVertexAttrib4fv),
|
| - "glVertexAttrib4fv", },
|
| - { (EGLFUNCTIONPOINTER)(&glVertexAttribPointer),
|
| - "glVertexAttribPointer", },
|
| - { (EGLFUNCTIONPOINTER)(&glViewport),
|
| - "glViewport", },
|
| - };
|
| -
|
| - unsigned int num_functions = sizeof(gl_functions) / sizeof(gl_functions[0]);
|
| - unsigned int ii;
|
| - for (ii = 0; ii < num_functions; ++ii) {
|
| - if (strcmp(gl_functions[ii].name, procname) == 0) {
|
| - return gl_functions[ii].func;
|
| - }
|
| - }
|
| - return NULL;
|
| -}
|
|
|