2 * Copyright 2011 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _GL2_DECODER_H_
18 #define _GL2_DECODER_H_
20 #include "gles2_dec.h"
21 #include "GLDecoderContextData.h"
22 #include "emugl/common/shared_library.h"
24 class GLESv2Decoder : public gles2_decoder_context_t
27 typedef void *(*get_proc_func_t)(const char *name, void *userData);
30 int initGL(get_proc_func_t getProcFunc, void *getProcFuncData);
31 void setContextData(GLDecoderContextData *contextData) { m_contextData = contextData; }
33 GLDecoderContextData *m_contextData;
34 emugl::SharedLibrary* m_GL2library;
36 static void *s_getProc(const char *name, void *userData);
37 static void gles2_APIENTRY s_glGetCompressedTextureFormats(void *self, int count, GLint *formats);
38 static void gles2_APIENTRY s_glVertexAttribPointerData(void *self, GLuint indx, GLint size, GLenum type,
39 GLboolean normalized, GLsizei stride, void * data, GLuint datalen);
40 static void gles2_APIENTRY s_glVertexAttribPointerOffset(void *self, GLuint indx, GLint size, GLenum type,
41 GLboolean normalized, GLsizei stride, GLuint offset);
43 static void gles2_APIENTRY s_glDrawElementsOffset(void *self, GLenum mode, GLsizei count, GLenum type, GLuint offset);
44 static void gles2_APIENTRY s_glDrawElementsData(void *self, GLenum mode, GLsizei count, GLenum type, void * data, GLuint datalen);
45 static void gles2_APIENTRY s_glShaderString(void *self, GLuint shader, const GLchar* string, GLsizei len);
46 static int gles2_APIENTRY s_glFinishRoundTrip(void *self);