M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions

160
base/opengl/libs/Android.mk Normal file
View File

@ -0,0 +1,160 @@
LOCAL_PATH:= $(call my-dir)
###############################################################################
# Build META EGL library
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
EGL/egl.cpp \
EGL/getProcAddress.cpp.arm \
EGL/hooks.cpp \
EGL/Loader.cpp \
#
LOCAL_SHARED_LIBRARIES += libcutils libutils
LOCAL_LDLIBS := -lpthread -ldl
LOCAL_MODULE:= libEGL
# needed on sim build because of weird logging issues
ifeq ($(TARGET_SIMULATOR),true)
else
LOCAL_SHARED_LIBRARIES += libdl
# Bionic's private TLS header relies on the ARCH_ARM_HAVE_TLS_REGISTER to
# select the appropriate TLS codepath
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
endif
# we need to access the private Bionic header <bionic_tls.h>
LOCAL_C_INCLUDES += bionic/libc/private
endif
LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
LOCAL_CFLAGS += -fvisibility=hidden
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
endif
include $(BUILD_SHARED_LIBRARY)
installed_libEGL := $(LOCAL_INSTALLED_MODULE)
# OpenGL drivers config file
ifneq ($(BOARD_EGL_CFG),)
include $(CLEAR_VARS)
LOCAL_MODULE := egl.cfg
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/egl
LOCAL_SRC_FILES := ../../../../$(BOARD_EGL_CFG)
include $(BUILD_PREBUILT)
# make sure we depend on egl.cfg, so it gets installed
$(installed_libEGL): | egl.cfg
endif
###############################################################################
# Build the wrapper OpenGL ES 1.x library
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
GLES_CM/gl.cpp.arm \
#
LOCAL_SHARED_LIBRARIES += libcutils libEGL
LOCAL_LDLIBS := -lpthread -ldl
LOCAL_MODULE:= libGLESv1_CM
# needed on sim build because of weird logging issues
ifeq ($(TARGET_SIMULATOR),true)
else
LOCAL_SHARED_LIBRARIES += libdl
# we need to access the private Bionic header <bionic_tls.h>
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
endif
LOCAL_C_INCLUDES += bionic/libc/private
endif
LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv1\"
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
LOCAL_CFLAGS += -fvisibility=hidden
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
endif
include $(BUILD_SHARED_LIBRARY)
###############################################################################
# Build the wrapper OpenGL ES 2.x library
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
GLES2/gl2.cpp.arm \
#
LOCAL_SHARED_LIBRARIES += libcutils libEGL
LOCAL_LDLIBS := -lpthread -ldl
LOCAL_MODULE:= libGLESv2
# needed on sim build because of weird logging issues
ifeq ($(TARGET_SIMULATOR),true)
else
LOCAL_SHARED_LIBRARIES += libdl
# we need to access the private Bionic header <bionic_tls.h>
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
endif
LOCAL_C_INCLUDES += bionic/libc/private
endif
LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv2\"
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
LOCAL_CFLAGS += -fvisibility=hidden
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
endif
include $(BUILD_SHARED_LIBRARY)
###############################################################################
# Build the ETC1 host static library
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
ETC1/etc1.cpp \
#
LOCAL_LDLIBS := -lpthread -ldl
LOCAL_MODULE:= libETC1
include $(BUILD_HOST_STATIC_LIBRARY)
###############################################################################
# Build the ETC1 device library
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
ETC1/etc1.cpp \
#
LOCAL_LDLIBS := -lpthread -ldl
LOCAL_MODULE:= libETC1
include $(BUILD_SHARED_LIBRARY)

View File

@ -0,0 +1,289 @@
/*
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <dlfcn.h>
#include <limits.h>
#include <cutils/log.h>
#include <EGL/egl.h>
#include "hooks.h"
#include "egl_impl.h"
#include "Loader.h"
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
/*
* EGL drivers are called
*
* /system/lib/egl/lib{[EGL|GLESv1_CM|GLESv2] | GLES}_$TAG.so
*
*/
ANDROID_SINGLETON_STATIC_INSTANCE( Loader )
// ----------------------------------------------------------------------------
Loader::driver_t::driver_t(void* gles)
{
dso[0] = gles;
for (size_t i=1 ; i<NELEM(dso) ; i++)
dso[i] = 0;
}
Loader::driver_t::~driver_t()
{
for (size_t i=0 ; i<NELEM(dso) ; i++) {
if (dso[i]) {
dlclose(dso[i]);
dso[i] = 0;
}
}
}
status_t Loader::driver_t::set(void* hnd, int32_t api)
{
switch (api) {
case EGL:
dso[0] = hnd;
break;
case GLESv1_CM:
dso[1] = hnd;
break;
case GLESv2:
dso[2] = hnd;
break;
default:
return BAD_INDEX;
}
return NO_ERROR;
}
// ----------------------------------------------------------------------------
Loader::entry_t::entry_t(int dpy, int impl, const char* tag)
: dpy(dpy), impl(impl), tag(tag) {
}
// ----------------------------------------------------------------------------
Loader::Loader()
{
char line[256];
char tag[256];
FILE* cfg = fopen("/system/lib/egl/egl.cfg", "r");
if (cfg == NULL) {
// default config
LOGD("egl.cfg not found, using default config");
gConfig.add( entry_t(0, 0, "android") );
} else {
while (fgets(line, 256, cfg)) {
int dpy;
int impl;
if (sscanf(line, "%u %u %s", &dpy, &impl, tag) == 3) {
//LOGD(">>> %u %u %s", dpy, impl, tag);
gConfig.add( entry_t(dpy, impl, tag) );
}
}
fclose(cfg);
}
}
Loader::~Loader()
{
}
const char* Loader::getTag(int dpy, int impl)
{
const Vector<entry_t>& cfgs(gConfig);
const size_t c = cfgs.size();
for (size_t i=0 ; i<c ; i++) {
if (dpy == cfgs[i].dpy)
if (impl == cfgs[i].impl)
return cfgs[i].tag.string();
}
return 0;
}
void* Loader::open(EGLNativeDisplayType display, int impl, egl_connection_t* cnx)
{
/*
* TODO: if we don't find display/0, then use 0/0
* (0/0 should always work)
*/
void* dso;
int index = int(display);
driver_t* hnd = 0;
char const* tag = getTag(index, impl);
if (tag) {
dso = load_driver("GLES", tag, cnx, EGL | GLESv1_CM | GLESv2);
if (dso) {
hnd = new driver_t(dso);
} else {
// Always load EGL first
dso = load_driver("EGL", tag, cnx, EGL);
if (dso) {
hnd = new driver_t(dso);
// TODO: make this more automated
hnd->set( load_driver("GLESv1_CM", tag, cnx, GLESv1_CM), GLESv1_CM );
hnd->set( load_driver("GLESv2", tag, cnx, GLESv2), GLESv2 );
}
}
}
LOG_FATAL_IF(!index && !impl && !hnd,
"couldn't find the default OpenGL ES implementation "
"for default display");
return (void*)hnd;
}
status_t Loader::close(void* driver)
{
driver_t* hnd = (driver_t*)driver;
delete hnd;
return NO_ERROR;
}
void Loader::init_api(void* dso,
char const * const * api,
__eglMustCastToProperFunctionPointerType* curr,
getProcAddressType getProcAddress)
{
char scrap[256];
while (*api) {
char const * name = *api;
__eglMustCastToProperFunctionPointerType f =
(__eglMustCastToProperFunctionPointerType)dlsym(dso, name);
if (f == NULL) {
// couldn't find the entry-point, use eglGetProcAddress()
f = getProcAddress(name);
}
if (f == NULL) {
// Try without the OES postfix
ssize_t index = ssize_t(strlen(name)) - 3;
if ((index>0 && (index<255)) && (!strcmp(name+index, "OES"))) {
strncpy(scrap, name, index);
scrap[index] = 0;
f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, scrap);
//LOGD_IF(f, "found <%s> instead", scrap);
}
}
if (f == NULL) {
// Try with the OES postfix
ssize_t index = ssize_t(strlen(name)) - 3;
if ((index>0 && (index<252)) && (strcmp(name+index, "OES"))) {
strncpy(scrap, name, index);
scrap[index] = 0;
strcat(scrap, "OES");
f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, scrap);
//LOGD_IF(f, "found <%s> instead", scrap);
}
}
if (f == NULL) {
//LOGD("%s", name);
f = (__eglMustCastToProperFunctionPointerType)gl_unimplemented;
}
*curr++ = f;
api++;
}
}
void *Loader::load_driver(const char* kind, const char *tag,
egl_connection_t* cnx, uint32_t mask)
{
char driver_absolute_path[PATH_MAX];
const char* const search1 = "/vendor/lib/egl/lib%s_%s.so";
const char* const search2 = "/system/lib/egl/lib%s_%s.so";
snprintf(driver_absolute_path, PATH_MAX, search1, kind, tag);
if (access(driver_absolute_path, R_OK)) {
snprintf(driver_absolute_path, PATH_MAX, search2, kind, tag);
if (access(driver_absolute_path, R_OK)) {
// this happens often, we don't want to log an error
return 0;
}
}
void* dso = dlopen(driver_absolute_path, RTLD_NOW | RTLD_LOCAL);
if (dso == 0) {
const char* err = dlerror();
LOGE("load_driver(%s): %s", driver_absolute_path, err?err:"unknown");
return 0;
}
LOGD("loaded %s", driver_absolute_path);
if (mask & EGL) {
getProcAddress = (getProcAddressType)dlsym(dso, "eglGetProcAddress");
LOGE_IF(!getProcAddress,
"can't find eglGetProcAddress() in %s", driver_absolute_path);
egl_t* egl = &cnx->egl;
__eglMustCastToProperFunctionPointerType* curr =
(__eglMustCastToProperFunctionPointerType*)egl;
char const * const * api = egl_names;
while (*api) {
char const * name = *api;
__eglMustCastToProperFunctionPointerType f =
(__eglMustCastToProperFunctionPointerType)dlsym(dso, name);
if (f == NULL) {
// couldn't find the entry-point, use eglGetProcAddress()
f = getProcAddress(name);
if (f == NULL) {
f = (__eglMustCastToProperFunctionPointerType)0;
}
}
*curr++ = f;
api++;
}
}
if (mask & GLESv1_CM) {
init_api(dso, gl_names,
(__eglMustCastToProperFunctionPointerType*)
&cnx->hooks[GLESv1_INDEX]->gl,
getProcAddress);
}
if (mask & GLESv2) {
init_api(dso, gl_names,
(__eglMustCastToProperFunctionPointerType*)
&cnx->hooks[GLESv2_INDEX]->gl,
getProcAddress);
}
return dso;
}
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------

View File

@ -0,0 +1,90 @@
/*
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#ifndef ANDROID_EGL_LOADER_H
#define ANDROID_EGL_LOADER_H
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <utils/Errors.h>
#include <utils/Singleton.h>
#include <utils/String8.h>
#include <utils/Vector.h>
#include <EGL/egl.h>
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
struct egl_connection_t;
class Loader : public Singleton<Loader>
{
friend class Singleton<Loader>;
typedef __eglMustCastToProperFunctionPointerType (*getProcAddressType)(
const char*);
enum {
EGL = 0x01,
GLESv1_CM = 0x02,
GLESv2 = 0x04
};
struct driver_t {
driver_t(void* gles);
~driver_t();
status_t set(void* hnd, int32_t api);
void* dso[3];
};
struct entry_t {
entry_t() { }
entry_t(int dpy, int impl, const char* tag);
int dpy;
int impl;
String8 tag;
};
Vector<entry_t> gConfig;
getProcAddressType getProcAddress;
const char* getTag(int dpy, int impl);
public:
~Loader();
void* open(EGLNativeDisplayType display, int impl, egl_connection_t* cnx);
status_t close(void* driver);
private:
Loader();
void *load_driver(const char* kind, const char *tag, egl_connection_t* cnx, uint32_t mask);
static __attribute__((noinline))
void init_api(void* dso,
char const * const * api,
__eglMustCastToProperFunctionPointerType* curr,
getProcAddressType getProcAddress);
};
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------
#endif /* ANDROID_EGL_LOADER_H */

1865
base/opengl/libs/EGL/egl.cpp Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,57 @@
EGL_ENTRY(EGLDisplay, eglGetDisplay, NativeDisplayType)
EGL_ENTRY(EGLBoolean, eglInitialize, EGLDisplay, EGLint*, EGLint*)
EGL_ENTRY(EGLBoolean, eglTerminate, EGLDisplay)
EGL_ENTRY(EGLBoolean, eglGetConfigs, EGLDisplay, EGLConfig*, EGLint, EGLint*)
EGL_ENTRY(EGLBoolean, eglChooseConfig, EGLDisplay, const EGLint *, EGLConfig *, EGLint, EGLint *)
EGL_ENTRY(EGLBoolean, eglGetConfigAttrib, EGLDisplay, EGLConfig, EGLint, EGLint *)
EGL_ENTRY(EGLSurface, eglCreateWindowSurface, EGLDisplay, EGLConfig, NativeWindowType, const EGLint *)
EGL_ENTRY(EGLSurface, eglCreatePixmapSurface, EGLDisplay, EGLConfig, NativePixmapType, const EGLint *)
EGL_ENTRY(EGLSurface, eglCreatePbufferSurface, EGLDisplay, EGLConfig, const EGLint *)
EGL_ENTRY(EGLBoolean, eglDestroySurface, EGLDisplay, EGLSurface)
EGL_ENTRY(EGLBoolean, eglQuerySurface, EGLDisplay, EGLSurface, EGLint, EGLint *)
EGL_ENTRY(EGLContext, eglCreateContext, EGLDisplay, EGLConfig, EGLContext, const EGLint *)
EGL_ENTRY(EGLBoolean, eglDestroyContext, EGLDisplay, EGLContext)
EGL_ENTRY(EGLBoolean, eglMakeCurrent, EGLDisplay, EGLSurface, EGLSurface, EGLContext)
EGL_ENTRY(EGLContext, eglGetCurrentContext, void)
EGL_ENTRY(EGLSurface, eglGetCurrentSurface, EGLint)
EGL_ENTRY(EGLDisplay, eglGetCurrentDisplay, void)
EGL_ENTRY(EGLBoolean, eglQueryContext, EGLDisplay, EGLContext, EGLint, EGLint *)
EGL_ENTRY(EGLBoolean, eglWaitGL, void)
EGL_ENTRY(EGLBoolean, eglWaitNative, EGLint)
EGL_ENTRY(EGLBoolean, eglSwapBuffers, EGLDisplay, EGLSurface)
EGL_ENTRY(EGLBoolean, eglCopyBuffers, EGLDisplay, EGLSurface, NativePixmapType)
EGL_ENTRY(EGLint, eglGetError, void)
EGL_ENTRY(const char*, eglQueryString, EGLDisplay, EGLint)
EGL_ENTRY(__eglMustCastToProperFunctionPointerType, eglGetProcAddress, const char *)
/* EGL 1.1 */
EGL_ENTRY(EGLBoolean, eglSurfaceAttrib, EGLDisplay, EGLSurface, EGLint, EGLint)
EGL_ENTRY(EGLBoolean, eglBindTexImage, EGLDisplay, EGLSurface, EGLint)
EGL_ENTRY(EGLBoolean, eglReleaseTexImage, EGLDisplay, EGLSurface, EGLint)
EGL_ENTRY(EGLBoolean, eglSwapInterval, EGLDisplay, EGLint)
/* EGL 1.2 */
EGL_ENTRY(EGLBoolean, eglBindAPI, EGLenum)
EGL_ENTRY(EGLenum, eglQueryAPI, void)
EGL_ENTRY(EGLBoolean, eglWaitClient, void)
EGL_ENTRY(EGLBoolean, eglReleaseThread, void)
EGL_ENTRY(EGLSurface, eglCreatePbufferFromClientBuffer, EGLDisplay, EGLenum, EGLClientBuffer, EGLConfig, const EGLint *)
/* EGL 1.3 */
/* EGL 1.4 */
/* EGL_EGLEXT_VERSION 3 */
EGL_ENTRY(EGLBoolean, eglLockSurfaceKHR, EGLDisplay, EGLSurface, const EGLint *)
EGL_ENTRY(EGLBoolean, eglUnlockSurfaceKHR, EGLDisplay, EGLSurface)
EGL_ENTRY(EGLImageKHR, eglCreateImageKHR, EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, const EGLint *)
EGL_ENTRY(EGLBoolean, eglDestroyImageKHR, EGLDisplay, EGLImageKHR)
/* ANDROID extensions */
EGL_ENTRY(EGLBoolean, eglSetSwapRectangleANDROID, EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint)
EGL_ENTRY(EGLClientBuffer, eglGetRenderBufferANDROID, EGLDisplay, EGLSurface)

View File

@ -0,0 +1,122 @@
/*
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#include <ctype.h>
#include <stdlib.h>
#include <errno.h>
#include <cutils/log.h>
#include "hooks.h"
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
#undef API_ENTRY
#undef CALL_GL_EXTENSION_API
#undef GL_EXTENSION
#undef GL_EXTENSION_NAME
#undef GL_EXTENSION_ARRAY
#undef GL_EXTENSION_LIST
#undef GET_TLS
#if defined(__arm__)
#ifdef HAVE_ARM_TLS_REGISTER
#define GET_TLS(reg) \
"mrc p15, 0, " #reg ", c13, c0, 3 \n"
#else
#define GET_TLS(reg) \
"mov " #reg ", #0xFFFF0FFF \n" \
"ldr " #reg ", [" #reg ", #-15] \n"
#endif
#define API_ENTRY(_api) __attribute__((naked)) _api
#define CALL_GL_EXTENSION_API(_api) \
asm volatile( \
GET_TLS(r12) \
"ldr r12, [r12, %[tls]] \n" \
"cmp r12, #0 \n" \
"ldrne r12, [r12, %[api]] \n" \
"cmpne r12, #0 \n" \
"bxne r12 \n" \
"bx lr \n" \
: \
: [tls] "J"(TLS_SLOT_OPENGL_API*4), \
[api] "J"(__builtin_offsetof(gl_hooks_t, \
ext.extensions[_api])) \
: \
);
#define GL_EXTENSION_NAME(_n) __glExtFwd##_n
#define GL_EXTENSION(_n) \
void API_ENTRY(GL_EXTENSION_NAME(_n))() { \
CALL_GL_EXTENSION_API(_n); \
}
#else
#define GL_EXTENSION_NAME(_n) NULL
#define GL_EXTENSION(_n)
#warning "eglGetProcAddress() partially supported on this architecture"
#endif
#define GL_EXTENSION_LIST(name) \
name(0) name(1) name(2) name(3) \
name(4) name(5) name(6) name(7) \
name(8) name(9) name(10) name(11) \
name(12) name(13) name(14) name(15) \
name(16) name(17) name(18) name(19) \
name(20) name(21) name(22) name(23) \
name(24) name(25) name(26) name(27) \
name(28) name(29) name(30) name(31) \
name(32) name(33) name(34) name(35) \
name(36) name(37) name(38) name(39) \
name(40) name(41) name(42) name(43) \
name(44) name(45) name(46) name(47) \
name(48) name(49) name(50) name(51) \
name(52) name(53) name(54) name(55) \
name(56) name(57) name(58) name(59) \
name(60) name(61) name(62) name(63)
GL_EXTENSION_LIST( GL_EXTENSION )
#define GL_EXTENSION_ARRAY(_n) GL_EXTENSION_NAME(_n),
extern const __eglMustCastToProperFunctionPointerType gExtensionForwarders[MAX_NUMBER_OF_GL_EXTENSIONS] = {
GL_EXTENSION_LIST( GL_EXTENSION_ARRAY )
};
#undef GET_TLS
#undef GL_EXTENSION_LIST
#undef GL_EXTENSION_ARRAY
#undef GL_EXTENSION_NAME
#undef GL_EXTENSION
#undef API_ENTRY
#undef CALL_GL_EXTENSION_API
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------

View File

@ -0,0 +1,60 @@
/*
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#include <ctype.h>
#include <stdlib.h>
#include <errno.h>
#include <cutils/log.h>
#include "hooks.h"
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
void gl_unimplemented() {
LOGE("called unimplemented OpenGL ES API");
}
// ----------------------------------------------------------------------------
// GL / EGL hooks
// ----------------------------------------------------------------------------
#undef GL_ENTRY
#undef EGL_ENTRY
#define GL_ENTRY(_r, _api, ...) #_api,
#define EGL_ENTRY(_r, _api, ...) #_api,
char const * const gl_names[] = {
#include "entries.in"
NULL
};
char const * const egl_names[] = {
#include "egl_entries.in"
NULL
};
#undef GL_ENTRY
#undef EGL_ENTRY
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------

View File

@ -0,0 +1,670 @@
// Copyright 2009 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <ETC1/etc1.h>
#include <string.h>
/* From http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt
The number of bits that represent a 4x4 texel block is 64 bits if
<internalformat> is given by ETC1_RGB8_OES.
The data for a block is a number of bytes,
{q0, q1, q2, q3, q4, q5, q6, q7}
where byte q0 is located at the lowest memory address and q7 at
the highest. The 64 bits specifying the block is then represented
by the following 64 bit integer:
int64bit = 256*(256*(256*(256*(256*(256*(256*q0+q1)+q2)+q3)+q4)+q5)+q6)+q7;
ETC1_RGB8_OES:
a) bit layout in bits 63 through 32 if diffbit = 0
63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48
-----------------------------------------------
| base col1 | base col2 | base col1 | base col2 |
| R1 (4bits)| R2 (4bits)| G1 (4bits)| G2 (4bits)|
-----------------------------------------------
47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
---------------------------------------------------
| base col1 | base col2 | table | table |diff|flip|
| B1 (4bits)| B2 (4bits)| cw 1 | cw 2 |bit |bit |
---------------------------------------------------
b) bit layout in bits 63 through 32 if diffbit = 1
63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48
-----------------------------------------------
| base col1 | dcol 2 | base col1 | dcol 2 |
| R1' (5 bits) | dR2 | G1' (5 bits) | dG2 |
-----------------------------------------------
47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
---------------------------------------------------
| base col 1 | dcol 2 | table | table |diff|flip|
| B1' (5 bits) | dB2 | cw 1 | cw 2 |bit |bit |
---------------------------------------------------
c) bit layout in bits 31 through 0 (in both cases)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
-----------------------------------------------
| most significant pixel index bits |
| p| o| n| m| l| k| j| i| h| g| f| e| d| c| b| a|
-----------------------------------------------
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
--------------------------------------------------
| least significant pixel index bits |
| p| o| n| m| l| k| j| i| h| g| f| e| d| c | b | a |
--------------------------------------------------
Add table 3.17.2: Intensity modifier sets for ETC1 compressed textures:
table codeword modifier table
------------------ ----------------------
0 -8 -2 2 8
1 -17 -5 5 17
2 -29 -9 9 29
3 -42 -13 13 42
4 -60 -18 18 60
5 -80 -24 24 80
6 -106 -33 33 106
7 -183 -47 47 183
Add table 3.17.3 Mapping from pixel index values to modifier values for
ETC1 compressed textures:
pixel index value
---------------
msb lsb resulting modifier value
----- ----- -------------------------
1 1 -b (large negative value)
1 0 -a (small negative value)
0 0 a (small positive value)
0 1 b (large positive value)
*/
static const int kModifierTable[] = {
/* 0 */2, 8, -2, -8,
/* 1 */5, 17, -5, -17,
/* 2 */9, 29, -9, -29,
/* 3 */13, 42, -13, -42,
/* 4 */18, 60, -18, -60,
/* 5 */24, 80, -24, -80,
/* 6 */33, 106, -33, -106,
/* 7 */47, 183, -47, -183 };
static const int kLookup[8] = { 0, 1, 2, 3, -4, -3, -2, -1 };
static inline etc1_byte clamp(int x) {
return (etc1_byte) (x >= 0 ? (x < 255 ? x : 255) : 0);
}
static
inline int convert4To8(int b) {
int c = b & 0xf;
return (c << 4) | c;
}
static
inline int convert5To8(int b) {
int c = b & 0x1f;
return (c << 3) | (c >> 2);
}
static
inline int convert6To8(int b) {
int c = b & 0x3f;
return (c << 2) | (c >> 4);
}
static
inline int divideBy255(int d) {
return (d + 128 + (d >> 8)) >> 8;
}
static
inline int convert8To4(int b) {
int c = b & 0xff;
return divideBy255(b * 15);
}
static
inline int convert8To5(int b) {
int c = b & 0xff;
return divideBy255(b * 31);
}
static
inline int convertDiff(int base, int diff) {
return convert5To8((0x1f & base) + kLookup[0x7 & diff]);
}
static
void decode_subblock(etc1_byte* pOut, int r, int g, int b, const int* table,
etc1_uint32 low, bool second, bool flipped) {
int baseX = 0;
int baseY = 0;
if (second) {
if (flipped) {
baseY = 2;
} else {
baseX = 2;
}
}
for (int i = 0; i < 8; i++) {
int x, y;
if (flipped) {
x = baseX + (i >> 1);
y = baseY + (i & 1);
} else {
x = baseX + (i >> 2);
y = baseY + (i & 3);
}
int k = y + (x * 4);
int offset = ((low >> k) & 1) | ((low >> (k + 15)) & 2);
int delta = table[offset];
etc1_byte* q = pOut + 3 * (x + 4 * y);
*q++ = clamp(r + delta);
*q++ = clamp(g + delta);
*q++ = clamp(b + delta);
}
}
// Input is an ETC1 compressed version of the data.
// Output is a 4 x 4 square of 3-byte pixels in form R, G, B
void etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut) {
etc1_uint32 high = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
etc1_uint32 low = (pIn[4] << 24) | (pIn[5] << 16) | (pIn[6] << 8) | pIn[7];
int r1, r2, g1, g2, b1, b2;
if (high & 2) {
// differential
int rBase = high >> 27;
int gBase = high >> 19;
int bBase = high >> 11;
r1 = convert5To8(rBase);
r2 = convertDiff(rBase, high >> 24);
g1 = convert5To8(gBase);
g2 = convertDiff(gBase, high >> 16);
b1 = convert5To8(bBase);
b2 = convertDiff(bBase, high >> 8);
} else {
// not differential
r1 = convert4To8(high >> 28);
r2 = convert4To8(high >> 24);
g1 = convert4To8(high >> 20);
g2 = convert4To8(high >> 16);
b1 = convert4To8(high >> 12);
b2 = convert4To8(high >> 8);
}
int tableIndexA = 7 & (high >> 5);
int tableIndexB = 7 & (high >> 2);
const int* tableA = kModifierTable + tableIndexA * 4;
const int* tableB = kModifierTable + tableIndexB * 4;
bool flipped = (high & 1) != 0;
decode_subblock(pOut, r1, g1, b1, tableA, low, false, flipped);
decode_subblock(pOut, r2, g2, b2, tableB, low, true, flipped);
}
typedef struct {
etc1_uint32 high;
etc1_uint32 low;
etc1_uint32 score; // Lower is more accurate
} etc_compressed;
static
inline void take_best(etc_compressed* a, const etc_compressed* b) {
if (a->score > b->score) {
*a = *b;
}
}
static
void etc_average_colors_subblock(const etc1_byte* pIn, etc1_uint32 inMask,
etc1_byte* pColors, bool flipped, bool second) {
int r = 0;
int g = 0;
int b = 0;
if (flipped) {
int by = 0;
if (second) {
by = 2;
}
for (int y = 0; y < 2; y++) {
int yy = by + y;
for (int x = 0; x < 4; x++) {
int i = x + 4 * yy;
if (inMask & (1 << i)) {
const etc1_byte* p = pIn + i * 3;
r += *(p++);
g += *(p++);
b += *(p++);
}
}
}
} else {
int bx = 0;
if (second) {
bx = 2;
}
for (int y = 0; y < 4; y++) {
for (int x = 0; x < 2; x++) {
int xx = bx + x;
int i = xx + 4 * y;
if (inMask & (1 << i)) {
const etc1_byte* p = pIn + i * 3;
r += *(p++);
g += *(p++);
b += *(p++);
}
}
}
}
pColors[0] = (etc1_byte)((r + 4) >> 3);
pColors[1] = (etc1_byte)((g + 4) >> 3);
pColors[2] = (etc1_byte)((b + 4) >> 3);
}
static
inline int square(int x) {
return x * x;
}
static etc1_uint32 chooseModifier(const etc1_byte* pBaseColors,
const etc1_byte* pIn, etc1_uint32 *pLow, int bitIndex,
const int* pModifierTable) {
etc1_uint32 bestScore = ~0;
int bestIndex = 0;
int pixelR = pIn[0];
int pixelG = pIn[1];
int pixelB = pIn[2];
int r = pBaseColors[0];
int g = pBaseColors[1];
int b = pBaseColors[2];
for (int i = 0; i < 4; i++) {
int modifier = pModifierTable[i];
int decodedG = clamp(g + modifier);
etc1_uint32 score = (etc1_uint32) (6 * square(decodedG - pixelG));
if (score >= bestScore) {
continue;
}
int decodedR = clamp(r + modifier);
score += (etc1_uint32) (3 * square(decodedR - pixelR));
if (score >= bestScore) {
continue;
}
int decodedB = clamp(b + modifier);
score += (etc1_uint32) square(decodedB - pixelB);
if (score < bestScore) {
bestScore = score;
bestIndex = i;
}
}
etc1_uint32 lowMask = (((bestIndex >> 1) << 16) | (bestIndex & 1))
<< bitIndex;
*pLow |= lowMask;
return bestScore;
}
static
void etc_encode_subblock_helper(const etc1_byte* pIn, etc1_uint32 inMask,
etc_compressed* pCompressed, bool flipped, bool second,
const etc1_byte* pBaseColors, const int* pModifierTable) {
int score = pCompressed->score;
if (flipped) {
int by = 0;
if (second) {
by = 2;
}
for (int y = 0; y < 2; y++) {
int yy = by + y;
for (int x = 0; x < 4; x++) {
int i = x + 4 * yy;
if (inMask & (1 << i)) {
score += chooseModifier(pBaseColors, pIn + i * 3,
&pCompressed->low, yy + x * 4, pModifierTable);
}
}
}
} else {
int bx = 0;
if (second) {
bx = 2;
}
for (int y = 0; y < 4; y++) {
for (int x = 0; x < 2; x++) {
int xx = bx + x;
int i = xx + 4 * y;
if (inMask & (1 << i)) {
score += chooseModifier(pBaseColors, pIn + i * 3,
&pCompressed->low, y + xx * 4, pModifierTable);
}
}
}
}
pCompressed->score = score;
}
static bool inRange4bitSigned(int color) {
return color >= -4 && color <= 3;
}
static void etc_encodeBaseColors(etc1_byte* pBaseColors,
const etc1_byte* pColors, etc_compressed* pCompressed) {
int r1, g1, b1, r2, g2, b2; // 8 bit base colors for sub-blocks
bool differential;
{
int r51 = convert8To5(pColors[0]);
int g51 = convert8To5(pColors[1]);
int b51 = convert8To5(pColors[2]);
int r52 = convert8To5(pColors[3]);
int g52 = convert8To5(pColors[4]);
int b52 = convert8To5(pColors[5]);
r1 = convert5To8(r51);
g1 = convert5To8(g51);
b1 = convert5To8(b51);
int dr = r52 - r51;
int dg = g52 - g51;
int db = b52 - b51;
differential = inRange4bitSigned(dr) && inRange4bitSigned(dg)
&& inRange4bitSigned(db);
if (differential) {
r2 = convert5To8(r51 + dr);
g2 = convert5To8(g51 + dg);
b2 = convert5To8(b51 + db);
pCompressed->high |= (r51 << 27) | ((7 & dr) << 24) | (g51 << 19)
| ((7 & dg) << 16) | (b51 << 11) | ((7 & db) << 8) | 2;
}
}
if (!differential) {
int r41 = convert8To4(pColors[0]);
int g41 = convert8To4(pColors[1]);
int b41 = convert8To4(pColors[2]);
int r42 = convert8To4(pColors[3]);
int g42 = convert8To4(pColors[4]);
int b42 = convert8To4(pColors[5]);
r1 = convert4To8(r41);
g1 = convert4To8(g41);
b1 = convert4To8(b41);
r2 = convert4To8(r42);
g2 = convert4To8(g42);
b2 = convert4To8(b42);
pCompressed->high |= (r41 << 28) | (r42 << 24) | (g41 << 20) | (g42
<< 16) | (b41 << 12) | (b42 << 8);
}
pBaseColors[0] = r1;
pBaseColors[1] = g1;
pBaseColors[2] = b1;
pBaseColors[3] = r2;
pBaseColors[4] = g2;
pBaseColors[5] = b2;
}
static
void etc_encode_block_helper(const etc1_byte* pIn, etc1_uint32 inMask,
const etc1_byte* pColors, etc_compressed* pCompressed, bool flipped) {
pCompressed->score = ~0;
pCompressed->high = (flipped ? 1 : 0);
pCompressed->low = 0;
etc1_byte pBaseColors[6];
etc_encodeBaseColors(pBaseColors, pColors, pCompressed);
int originalHigh = pCompressed->high;
const int* pModifierTable = kModifierTable;
for (int i = 0; i < 8; i++, pModifierTable += 4) {
etc_compressed temp;
temp.score = 0;
temp.high = originalHigh | (i << 5);
temp.low = 0;
etc_encode_subblock_helper(pIn, inMask, &temp, flipped, false,
pBaseColors, pModifierTable);
take_best(pCompressed, &temp);
}
pModifierTable = kModifierTable;
etc_compressed firstHalf = *pCompressed;
for (int i = 0; i < 8; i++, pModifierTable += 4) {
etc_compressed temp;
temp.score = firstHalf.score;
temp.high = firstHalf.high | (i << 2);
temp.low = firstHalf.low;
etc_encode_subblock_helper(pIn, inMask, &temp, flipped, true,
pBaseColors + 3, pModifierTable);
if (i == 0) {
*pCompressed = temp;
} else {
take_best(pCompressed, &temp);
}
}
}
static void writeBigEndian(etc1_byte* pOut, etc1_uint32 d) {
pOut[0] = (etc1_byte)(d >> 24);
pOut[1] = (etc1_byte)(d >> 16);
pOut[2] = (etc1_byte)(d >> 8);
pOut[3] = (etc1_byte) d;
}
// Input is a 4 x 4 square of 3-byte pixels in form R, G, B
// inmask is a 16-bit mask where bit (1 << (x + y * 4)) tells whether the corresponding (x,y)
// pixel is valid or not. Invalid pixel color values are ignored when compressing.
// Output is an ETC1 compressed version of the data.
void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 inMask,
etc1_byte* pOut) {
etc1_byte colors[6];
etc1_byte flippedColors[6];
etc_average_colors_subblock(pIn, inMask, colors, false, false);
etc_average_colors_subblock(pIn, inMask, colors + 3, false, true);
etc_average_colors_subblock(pIn, inMask, flippedColors, true, false);
etc_average_colors_subblock(pIn, inMask, flippedColors + 3, true, true);
etc_compressed a, b;
etc_encode_block_helper(pIn, inMask, colors, &a, false);
etc_encode_block_helper(pIn, inMask, flippedColors, &b, true);
take_best(&a, &b);
writeBigEndian(pOut, a.high);
writeBigEndian(pOut + 4, a.low);
}
// Return the size of the encoded image data (does not include size of PKM header).
etc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height) {
return (((width + 3) & ~3) * ((height + 3) & ~3)) >> 1;
}
// Encode an entire image.
// pIn - pointer to the image data. Formatted such that the Red component of
// pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset;
// pOut - pointer to encoded data. Must be large enough to store entire encoded image.
int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height,
etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut) {
if (pixelSize < 2 || pixelSize > 3) {
return -1;
}
static const unsigned short kYMask[] = { 0x0, 0xf, 0xff, 0xfff, 0xffff };
static const unsigned short kXMask[] = { 0x0, 0x1111, 0x3333, 0x7777,
0xffff };
etc1_byte block[ETC1_DECODED_BLOCK_SIZE];
etc1_byte encoded[ETC1_ENCODED_BLOCK_SIZE];
etc1_uint32 encodedWidth = (width + 3) & ~3;
etc1_uint32 encodedHeight = (height + 3) & ~3;
for (etc1_uint32 y = 0; y < encodedHeight; y += 4) {
etc1_uint32 yEnd = height - y;
if (yEnd > 4) {
yEnd = 4;
}
int ymask = kYMask[yEnd];
for (etc1_uint32 x = 0; x < encodedWidth; x += 4) {
etc1_uint32 xEnd = width - x;
if (xEnd > 4) {
xEnd = 4;
}
int mask = ymask & kXMask[xEnd];
for (etc1_uint32 cy = 0; cy < yEnd; cy++) {
etc1_byte* q = block + (cy * 4) * 3;
const etc1_byte* p = pIn + pixelSize * x + stride * (y + cy);
if (pixelSize == 3) {
memcpy(q, p, xEnd * 3);
} else {
for (etc1_uint32 cx = 0; cx < xEnd; cx++) {
int pixel = (p[1] << 8) | p[0];
*q++ = convert5To8(pixel >> 11);
*q++ = convert6To8(pixel >> 5);
*q++ = convert5To8(pixel);
p += pixelSize;
}
}
}
etc1_encode_block(block, mask, encoded);
memcpy(pOut, encoded, sizeof(encoded));
pOut += sizeof(encoded);
}
}
return 0;
}
// Decode an entire image.
// pIn - pointer to encoded data.
// pOut - pointer to the image data. Will be written such that the Red component of
// pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset. Must be
// large enough to store entire image.
int etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut,
etc1_uint32 width, etc1_uint32 height,
etc1_uint32 pixelSize, etc1_uint32 stride) {
if (pixelSize < 2 || pixelSize > 3) {
return -1;
}
etc1_byte block[ETC1_DECODED_BLOCK_SIZE];
etc1_uint32 encodedWidth = (width + 3) & ~3;
etc1_uint32 encodedHeight = (height + 3) & ~3;
for (etc1_uint32 y = 0; y < encodedHeight; y += 4) {
etc1_uint32 yEnd = height - y;
if (yEnd > 4) {
yEnd = 4;
}
for (etc1_uint32 x = 0; x < encodedWidth; x += 4) {
etc1_uint32 xEnd = width - x;
if (xEnd > 4) {
xEnd = 4;
}
etc1_decode_block(pIn, block);
pIn += ETC1_ENCODED_BLOCK_SIZE;
for (etc1_uint32 cy = 0; cy < yEnd; cy++) {
const etc1_byte* q = block + (cy * 4) * 3;
etc1_byte* p = pOut + pixelSize * x + stride * (y + cy);
if (pixelSize == 3) {
memcpy(p, q, xEnd * 3);
} else {
for (etc1_uint32 cx = 0; cx < xEnd; cx++) {
etc1_byte r = *q++;
etc1_byte g = *q++;
etc1_byte b = *q++;
etc1_uint32 pixel = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
*p++ = (etc1_byte) pixel;
*p++ = (etc1_byte) (pixel >> 8);
}
}
}
}
}
return 0;
}
static const char kMagic[] = { 'P', 'K', 'M', ' ', '1', '0' };
static const etc1_uint32 ETC1_PKM_FORMAT_OFFSET = 6;
static const etc1_uint32 ETC1_PKM_ENCODED_WIDTH_OFFSET = 8;
static const etc1_uint32 ETC1_PKM_ENCODED_HEIGHT_OFFSET = 10;
static const etc1_uint32 ETC1_PKM_WIDTH_OFFSET = 12;
static const etc1_uint32 ETC1_PKM_HEIGHT_OFFSET = 14;
static const etc1_uint32 ETC1_RGB_NO_MIPMAPS = 0;
static void writeBEUint16(etc1_byte* pOut, etc1_uint32 data) {
pOut[0] = (etc1_byte) (data >> 8);
pOut[1] = (etc1_byte) data;
}
static etc1_uint32 readBEUint16(const etc1_byte* pIn) {
return (pIn[0] << 8) | pIn[1];
}
// Format a PKM header
void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height) {
memcpy(pHeader, kMagic, sizeof(kMagic));
etc1_uint32 encodedWidth = (width + 3) & ~3;
etc1_uint32 encodedHeight = (height + 3) & ~3;
writeBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET, ETC1_RGB_NO_MIPMAPS);
writeBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET, encodedWidth);
writeBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET, encodedHeight);
writeBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET, width);
writeBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET, height);
}
// Check if a PKM header is correctly formatted.
etc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader) {
if (memcmp(pHeader, kMagic, sizeof(kMagic))) {
return false;
}
etc1_uint32 format = readBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET);
etc1_uint32 encodedWidth = readBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET);
etc1_uint32 encodedHeight = readBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET);
etc1_uint32 width = readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET);
etc1_uint32 height = readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET);
return format == ETC1_RGB_NO_MIPMAPS &&
encodedWidth >= width && encodedWidth - width < 4 &&
encodedHeight >= height && encodedHeight - height < 4;
}
// Read the image width from a PKM header
etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader) {
return readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET);
}
// Read the image height from a PKM header
etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader){
return readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET);
}

View File

@ -0,0 +1,120 @@
/*
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <cutils/log.h>
#include <cutils/properties.h>
#include "hooks.h"
#include "egl_impl.h"
using namespace android;
// ----------------------------------------------------------------------------
// Actual GL entry-points
// ----------------------------------------------------------------------------
#undef API_ENTRY
#undef CALL_GL_API
#undef CALL_GL_API_RETURN
#if USE_FAST_TLS_KEY
#ifdef HAVE_ARM_TLS_REGISTER
#define GET_TLS(reg) \
"mrc p15, 0, " #reg ", c13, c0, 3 \n"
#else
#define GET_TLS(reg) \
"mov " #reg ", #0xFFFF0FFF \n" \
"ldr " #reg ", [" #reg ", #-15] \n"
#endif
#define API_ENTRY(_api) __attribute__((naked)) _api
#define CALL_GL_API(_api, ...) \
asm volatile( \
GET_TLS(r12) \
"ldr r12, [r12, %[tls]] \n" \
"cmp r12, #0 \n" \
"ldrne pc, [r12, %[api]] \n" \
"mov r0, #0 \n" \
"bx lr \n" \
: \
: [tls] "J"(TLS_SLOT_OPENGL_API*4), \
[api] "J"(__builtin_offsetof(gl_hooks_t, gl._api)) \
: \
);
#define CALL_GL_API_RETURN(_api, ...) \
CALL_GL_API(_api, __VA_ARGS__) \
return 0; // placate gcc's warnings. never reached.
#else
#define API_ENTRY(_api) _api
#define CALL_GL_API(_api, ...) \
gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
_c->_api(__VA_ARGS__)
#define CALL_GL_API_RETURN(_api, ...) \
gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
return _c->_api(__VA_ARGS__)
#endif
extern "C" {
#include "gl2_api.in"
#include "gl2ext_api.in"
}
#undef API_ENTRY
#undef CALL_GL_API
#undef CALL_GL_API_RETURN
/*
* These GL calls are special because they need to EGL to retrieve some
* informations before they can execute.
*/
extern "C" void __glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
extern "C" void __glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
{
GLeglImageOES implImage =
(GLeglImageOES)egl_get_image_for_current_context((EGLImageKHR)image);
__glEGLImageTargetTexture2DOES(target, implImage);
}
void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
{
GLeglImageOES implImage =
(GLeglImageOES)egl_get_image_for_current_context((EGLImageKHR)image);
__glEGLImageTargetRenderbufferStorageOES(target, implImage);
}

View File

@ -0,0 +1,426 @@
void API_ENTRY(glActiveTexture)(GLenum texture) {
CALL_GL_API(glActiveTexture, texture);
}
void API_ENTRY(glAttachShader)(GLuint program, GLuint shader) {
CALL_GL_API(glAttachShader, program, shader);
}
void API_ENTRY(glBindAttribLocation)(GLuint program, GLuint index, const GLchar* name) {
CALL_GL_API(glBindAttribLocation, program, index, name);
}
void API_ENTRY(glBindBuffer)(GLenum target, GLuint buffer) {
CALL_GL_API(glBindBuffer, target, buffer);
}
void API_ENTRY(glBindFramebuffer)(GLenum target, GLuint framebuffer) {
CALL_GL_API(glBindFramebuffer, target, framebuffer);
}
void API_ENTRY(glBindRenderbuffer)(GLenum target, GLuint renderbuffer) {
CALL_GL_API(glBindRenderbuffer, target, renderbuffer);
}
void API_ENTRY(glBindTexture)(GLenum target, GLuint texture) {
CALL_GL_API(glBindTexture, target, texture);
}
void API_ENTRY(glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
CALL_GL_API(glBlendColor, red, green, blue, alpha);
}
void API_ENTRY(glBlendEquation)( GLenum mode ) {
CALL_GL_API(glBlendEquation, mode);
}
void API_ENTRY(glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha) {
CALL_GL_API(glBlendEquationSeparate, modeRGB, modeAlpha);
}
void API_ENTRY(glBlendFunc)(GLenum sfactor, GLenum dfactor) {
CALL_GL_API(glBlendFunc, sfactor, dfactor);
}
void API_ENTRY(glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
CALL_GL_API(glBlendFuncSeparate, srcRGB, dstRGB, srcAlpha, dstAlpha);
}
void API_ENTRY(glBufferData)(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) {
CALL_GL_API(glBufferData, target, size, data, usage);
}
void API_ENTRY(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) {
CALL_GL_API(glBufferSubData, target, offset, size, data);
}
GLenum API_ENTRY(glCheckFramebufferStatus)(GLenum target) {
CALL_GL_API_RETURN(glCheckFramebufferStatus, target);
}
void API_ENTRY(glClear)(GLbitfield mask) {
CALL_GL_API(glClear, mask);
}
void API_ENTRY(glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
CALL_GL_API(glClearColor, red, green, blue, alpha);
}
void API_ENTRY(glClearDepthf)(GLclampf depth) {
CALL_GL_API(glClearDepthf, depth);
}
void API_ENTRY(glClearStencil)(GLint s) {
CALL_GL_API(glClearStencil, s);
}
void API_ENTRY(glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
CALL_GL_API(glColorMask, red, green, blue, alpha);
}
void API_ENTRY(glCompileShader)(GLuint shader) {
CALL_GL_API(glCompileShader, shader);
}
void API_ENTRY(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) {
CALL_GL_API(glCompressedTexImage2D, target, level, internalformat, width, height, border, imageSize, data);
}
void API_ENTRY(glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) {
CALL_GL_API(glCompressedTexSubImage2D, target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
void API_ENTRY(glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y, width, height, border);
}
void API_ENTRY(glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
CALL_GL_API(glCopyTexSubImage2D, target, level, xoffset, yoffset, x, y, width, height);
}
GLuint API_ENTRY(glCreateProgram)(void) {
CALL_GL_API_RETURN(glCreateProgram);
}
GLuint API_ENTRY(glCreateShader)(GLenum type) {
CALL_GL_API_RETURN(glCreateShader, type);
}
void API_ENTRY(glCullFace)(GLenum mode) {
CALL_GL_API(glCullFace, mode);
}
void API_ENTRY(glDeleteBuffers)(GLsizei n, const GLuint* buffers) {
CALL_GL_API(glDeleteBuffers, n, buffers);
}
void API_ENTRY(glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers) {
CALL_GL_API(glDeleteFramebuffers, n, framebuffers);
}
void API_ENTRY(glDeleteProgram)(GLuint program) {
CALL_GL_API(glDeleteProgram, program);
}
void API_ENTRY(glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers) {
CALL_GL_API(glDeleteRenderbuffers, n, renderbuffers);
}
void API_ENTRY(glDeleteShader)(GLuint shader) {
CALL_GL_API(glDeleteShader, shader);
}
void API_ENTRY(glDeleteTextures)(GLsizei n, const GLuint* textures) {
CALL_GL_API(glDeleteTextures, n, textures);
}
void API_ENTRY(glDepthFunc)(GLenum func) {
CALL_GL_API(glDepthFunc, func);
}
void API_ENTRY(glDepthMask)(GLboolean flag) {
CALL_GL_API(glDepthMask, flag);
}
void API_ENTRY(glDepthRangef)(GLclampf zNear, GLclampf zFar) {
CALL_GL_API(glDepthRangef, zNear, zFar);
}
void API_ENTRY(glDetachShader)(GLuint program, GLuint shader) {
CALL_GL_API(glDetachShader, program, shader);
}
void API_ENTRY(glDisable)(GLenum cap) {
CALL_GL_API(glDisable, cap);
}
void API_ENTRY(glDisableVertexAttribArray)(GLuint index) {
CALL_GL_API(glDisableVertexAttribArray, index);
}
void API_ENTRY(glDrawArrays)(GLenum mode, GLint first, GLsizei count) {
CALL_GL_API(glDrawArrays, mode, first, count);
}
void API_ENTRY(glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
CALL_GL_API(glDrawElements, mode, count, type, indices);
}
void API_ENTRY(glEnable)(GLenum cap) {
CALL_GL_API(glEnable, cap);
}
void API_ENTRY(glEnableVertexAttribArray)(GLuint index) {
CALL_GL_API(glEnableVertexAttribArray, index);
}
void API_ENTRY(glFinish)(void) {
CALL_GL_API(glFinish);
}
void API_ENTRY(glFlush)(void) {
CALL_GL_API(glFlush);
}
void API_ENTRY(glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
CALL_GL_API(glFramebufferRenderbuffer, target, attachment, renderbuffertarget, renderbuffer);
}
void API_ENTRY(glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
CALL_GL_API(glFramebufferTexture2D, target, attachment, textarget, texture, level);
}
void API_ENTRY(glFrontFace)(GLenum mode) {
CALL_GL_API(glFrontFace, mode);
}
void API_ENTRY(glGenBuffers)(GLsizei n, GLuint* buffers) {
CALL_GL_API(glGenBuffers, n, buffers);
}
void API_ENTRY(glGenerateMipmap)(GLenum target) {
CALL_GL_API(glGenerateMipmap, target);
}
void API_ENTRY(glGenFramebuffers)(GLsizei n, GLuint* framebuffers) {
CALL_GL_API(glGenFramebuffers, n, framebuffers);
}
void API_ENTRY(glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers) {
CALL_GL_API(glGenRenderbuffers, n, renderbuffers);
}
void API_ENTRY(glGenTextures)(GLsizei n, GLuint* textures) {
CALL_GL_API(glGenTextures, n, textures);
}
void API_ENTRY(glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
CALL_GL_API(glGetActiveAttrib, program, index, bufsize, length, size, type, name);
}
void API_ENTRY(glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
CALL_GL_API(glGetActiveUniform, program, index, bufsize, length, size, type, name);
}
void API_ENTRY(glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
CALL_GL_API(glGetAttachedShaders, program, maxcount, count, shaders);
}
int API_ENTRY(glGetAttribLocation)(GLuint program, const GLchar* name) {
CALL_GL_API_RETURN(glGetAttribLocation, program, name);
}
void API_ENTRY(glGetBooleanv)(GLenum pname, GLboolean* params) {
CALL_GL_API(glGetBooleanv, pname, params);
}
void API_ENTRY(glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params) {
CALL_GL_API(glGetBufferParameteriv, target, pname, params);
}
GLenum API_ENTRY(glGetError)(void) {
CALL_GL_API_RETURN(glGetError);
}
void API_ENTRY(glGetFloatv)(GLenum pname, GLfloat* params) {
CALL_GL_API(glGetFloatv, pname, params);
}
void API_ENTRY(glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
CALL_GL_API(glGetFramebufferAttachmentParameteriv, target, attachment, pname, params);
}
void API_ENTRY(glGetIntegerv)(GLenum pname, GLint* params) {
CALL_GL_API(glGetIntegerv, pname, params);
}
void API_ENTRY(glGetProgramiv)(GLuint program, GLenum pname, GLint* params) {
CALL_GL_API(glGetProgramiv, program, pname, params);
}
void API_ENTRY(glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) {
CALL_GL_API(glGetProgramInfoLog, program, bufsize, length, infolog);
}
void API_ENTRY(glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params) {
CALL_GL_API(glGetRenderbufferParameteriv, target, pname, params);
}
void API_ENTRY(glGetShaderiv)(GLuint shader, GLenum pname, GLint* params) {
CALL_GL_API(glGetShaderiv, shader, pname, params);
}
void API_ENTRY(glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) {
CALL_GL_API(glGetShaderInfoLog, shader, bufsize, length, infolog);
}
void API_ENTRY(glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
CALL_GL_API(glGetShaderPrecisionFormat, shadertype, precisiontype, range, precision);
}
void API_ENTRY(glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) {
CALL_GL_API(glGetShaderSource, shader, bufsize, length, source);
}
const GLubyte* API_ENTRY(glGetString)(GLenum name) {
CALL_GL_API_RETURN(glGetString, name);
}
void API_ENTRY(glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) {
CALL_GL_API(glGetTexParameterfv, target, pname, params);
}
void API_ENTRY(glGetTexParameteriv)(GLenum target, GLenum pname, GLint* params) {
CALL_GL_API(glGetTexParameteriv, target, pname, params);
}
void API_ENTRY(glGetUniformfv)(GLuint program, GLint location, GLfloat* params) {
CALL_GL_API(glGetUniformfv, program, location, params);
}
void API_ENTRY(glGetUniformiv)(GLuint program, GLint location, GLint* params) {
CALL_GL_API(glGetUniformiv, program, location, params);
}
int API_ENTRY(glGetUniformLocation)(GLuint program, const GLchar* name) {
CALL_GL_API_RETURN(glGetUniformLocation, program, name);
}
void API_ENTRY(glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) {
CALL_GL_API(glGetVertexAttribfv, index, pname, params);
}
void API_ENTRY(glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params) {
CALL_GL_API(glGetVertexAttribiv, index, pname, params);
}
void API_ENTRY(glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid** pointer) {
CALL_GL_API(glGetVertexAttribPointerv, index, pname, pointer);
}
void API_ENTRY(glHint)(GLenum target, GLenum mode) {
CALL_GL_API(glHint, target, mode);
}
GLboolean API_ENTRY(glIsBuffer)(GLuint buffer) {
CALL_GL_API_RETURN(glIsBuffer, buffer);
}
GLboolean API_ENTRY(glIsEnabled)(GLenum cap) {
CALL_GL_API_RETURN(glIsEnabled, cap);
}
GLboolean API_ENTRY(glIsFramebuffer)(GLuint framebuffer) {
CALL_GL_API_RETURN(glIsFramebuffer, framebuffer);
}
GLboolean API_ENTRY(glIsProgram)(GLuint program) {
CALL_GL_API_RETURN(glIsProgram, program);
}
GLboolean API_ENTRY(glIsRenderbuffer)(GLuint renderbuffer) {
CALL_GL_API_RETURN(glIsRenderbuffer, renderbuffer);
}
GLboolean API_ENTRY(glIsShader)(GLuint shader) {
CALL_GL_API_RETURN(glIsShader, shader);
}
GLboolean API_ENTRY(glIsTexture)(GLuint texture) {
CALL_GL_API_RETURN(glIsTexture, texture);
}
void API_ENTRY(glLineWidth)(GLfloat width) {
CALL_GL_API(glLineWidth, width);
}
void API_ENTRY(glLinkProgram)(GLuint program) {
CALL_GL_API(glLinkProgram, program);
}
void API_ENTRY(glPixelStorei)(GLenum pname, GLint param) {
CALL_GL_API(glPixelStorei, pname, param);
}
void API_ENTRY(glPolygonOffset)(GLfloat factor, GLfloat units) {
CALL_GL_API(glPolygonOffset, factor, units);
}
void API_ENTRY(glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) {
CALL_GL_API(glReadPixels, x, y, width, height, format, type, pixels);
}
void API_ENTRY(glReleaseShaderCompiler)(void) {
CALL_GL_API(glReleaseShaderCompiler);
}
void API_ENTRY(glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
CALL_GL_API(glRenderbufferStorage, target, internalformat, width, height);
}
void API_ENTRY(glSampleCoverage)(GLclampf value, GLboolean invert) {
CALL_GL_API(glSampleCoverage, value, invert);
}
void API_ENTRY(glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) {
CALL_GL_API(glScissor, x, y, width, height);
}
void API_ENTRY(glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) {
CALL_GL_API(glShaderBinary, n, shaders, binaryformat, binary, length);
}
void API_ENTRY(glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) {
CALL_GL_API(glShaderSource, shader, count, string, length);
}
void API_ENTRY(glStencilFunc)(GLenum func, GLint ref, GLuint mask) {
CALL_GL_API(glStencilFunc, func, ref, mask);
}
void API_ENTRY(glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) {
CALL_GL_API(glStencilFuncSeparate, face, func, ref, mask);
}
void API_ENTRY(glStencilMask)(GLuint mask) {
CALL_GL_API(glStencilMask, mask);
}
void API_ENTRY(glStencilMaskSeparate)(GLenum face, GLuint mask) {
CALL_GL_API(glStencilMaskSeparate, face, mask);
}
void API_ENTRY(glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) {
CALL_GL_API(glStencilOp, fail, zfail, zpass);
}
void API_ENTRY(glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
CALL_GL_API(glStencilOpSeparate, face, fail, zfail, zpass);
}
void API_ENTRY(glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
CALL_GL_API(glTexImage2D, target, level, internalformat, width, height, border, format, type, pixels);
}
void API_ENTRY(glTexParameterf)(GLenum target, GLenum pname, GLfloat param) {
CALL_GL_API(glTexParameterf, target, pname, param);
}
void API_ENTRY(glTexParameterfv)(GLenum target, GLenum pname, const GLfloat* params) {
CALL_GL_API(glTexParameterfv, target, pname, params);
}
void API_ENTRY(glTexParameteri)(GLenum target, GLenum pname, GLint param) {
CALL_GL_API(glTexParameteri, target, pname, param);
}
void API_ENTRY(glTexParameteriv)(GLenum target, GLenum pname, const GLint* params) {
CALL_GL_API(glTexParameteriv, target, pname, params);
}
void API_ENTRY(glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) {
CALL_GL_API(glTexSubImage2D, target, level, xoffset, yoffset, width, height, format, type, pixels);
}
void API_ENTRY(glUniform1f)(GLint location, GLfloat x) {
CALL_GL_API(glUniform1f, location, x);
}
void API_ENTRY(glUniform1fv)(GLint location, GLsizei count, const GLfloat* v) {
CALL_GL_API(glUniform1fv, location, count, v);
}
void API_ENTRY(glUniform1i)(GLint location, GLint x) {
CALL_GL_API(glUniform1i, location, x);
}
void API_ENTRY(glUniform1iv)(GLint location, GLsizei count, const GLint* v) {
CALL_GL_API(glUniform1iv, location, count, v);
}
void API_ENTRY(glUniform2f)(GLint location, GLfloat x, GLfloat y) {
CALL_GL_API(glUniform2f, location, x, y);
}
void API_ENTRY(glUniform2fv)(GLint location, GLsizei count, const GLfloat* v) {
CALL_GL_API(glUniform2fv, location, count, v);
}
void API_ENTRY(glUniform2i)(GLint location, GLint x, GLint y) {
CALL_GL_API(glUniform2i, location, x, y);
}
void API_ENTRY(glUniform2iv)(GLint location, GLsizei count, const GLint* v) {
CALL_GL_API(glUniform2iv, location, count, v);
}
void API_ENTRY(glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z) {
CALL_GL_API(glUniform3f, location, x, y, z);
}
void API_ENTRY(glUniform3fv)(GLint location, GLsizei count, const GLfloat* v) {
CALL_GL_API(glUniform3fv, location, count, v);
}
void API_ENTRY(glUniform3i)(GLint location, GLint x, GLint y, GLint z) {
CALL_GL_API(glUniform3i, location, x, y, z);
}
void API_ENTRY(glUniform3iv)(GLint location, GLsizei count, const GLint* v) {
CALL_GL_API(glUniform3iv, location, count, v);
}
void API_ENTRY(glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
CALL_GL_API(glUniform4f, location, x, y, z, w);
}
void API_ENTRY(glUniform4fv)(GLint location, GLsizei count, const GLfloat* v) {
CALL_GL_API(glUniform4fv, location, count, v);
}
void API_ENTRY(glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w) {
CALL_GL_API(glUniform4i, location, x, y, z, w);
}
void API_ENTRY(glUniform4iv)(GLint location, GLsizei count, const GLint* v) {
CALL_GL_API(glUniform4iv, location, count, v);
}
void API_ENTRY(glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
CALL_GL_API(glUniformMatrix2fv, location, count, transpose, value);
}
void API_ENTRY(glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
CALL_GL_API(glUniformMatrix3fv, location, count, transpose, value);
}
void API_ENTRY(glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
CALL_GL_API(glUniformMatrix4fv, location, count, transpose, value);
}
void API_ENTRY(glUseProgram)(GLuint program) {
CALL_GL_API(glUseProgram, program);
}
void API_ENTRY(glValidateProgram)(GLuint program) {
CALL_GL_API(glValidateProgram, program);
}
void API_ENTRY(glVertexAttrib1f)(GLuint indx, GLfloat x) {
CALL_GL_API(glVertexAttrib1f, indx, x);
}
void API_ENTRY(glVertexAttrib1fv)(GLuint indx, const GLfloat* values) {
CALL_GL_API(glVertexAttrib1fv, indx, values);
}
void API_ENTRY(glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y) {
CALL_GL_API(glVertexAttrib2f, indx, x, y);
}
void API_ENTRY(glVertexAttrib2fv)(GLuint indx, const GLfloat* values) {
CALL_GL_API(glVertexAttrib2fv, indx, values);
}
void API_ENTRY(glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
CALL_GL_API(glVertexAttrib3f, indx, x, y, z);
}
void API_ENTRY(glVertexAttrib3fv)(GLuint indx, const GLfloat* values) {
CALL_GL_API(glVertexAttrib3fv, indx, values);
}
void API_ENTRY(glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
CALL_GL_API(glVertexAttrib4f, indx, x, y, z, w);
}
void API_ENTRY(glVertexAttrib4fv)(GLuint indx, const GLfloat* values) {
CALL_GL_API(glVertexAttrib4fv, indx, values);
}
void API_ENTRY(glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) {
CALL_GL_API(glVertexAttribPointer, indx, size, type, normalized, stride, ptr);
}
void API_ENTRY(glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) {
CALL_GL_API(glViewport, x, y, width, height);
}

View File

@ -0,0 +1,180 @@
void API_ENTRY(__glEGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES image) {
CALL_GL_API(glEGLImageTargetTexture2DOES, target, image);
}
void API_ENTRY(__glEGLImageTargetRenderbufferStorageOES)(GLenum target, GLeglImageOES image) {
CALL_GL_API(glEGLImageTargetRenderbufferStorageOES, target, image);
}
void API_ENTRY(glGetProgramBinaryOES)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary) {
CALL_GL_API(glGetProgramBinaryOES, program, bufSize, length, binaryFormat, binary);
}
void API_ENTRY(glProgramBinaryOES)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length) {
CALL_GL_API(glProgramBinaryOES, program, binaryFormat, binary, length);
}
void* API_ENTRY(glMapBufferOES)(GLenum target, GLenum access) {
CALL_GL_API_RETURN(glMapBufferOES, target, access);
}
GLboolean API_ENTRY(glUnmapBufferOES)(GLenum target) {
CALL_GL_API_RETURN(glUnmapBufferOES, target);
}
void API_ENTRY(glGetBufferPointervOES)(GLenum target, GLenum pname, GLvoid** params) {
CALL_GL_API(glGetBufferPointervOES, target, pname, params);
}
void API_ENTRY(glTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
CALL_GL_API(glTexImage3DOES, target, level, internalformat, width, height, depth, border, format, type, pixels);
}
void API_ENTRY(glTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels) {
CALL_GL_API(glTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
}
void API_ENTRY(glCopyTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
CALL_GL_API(glCopyTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, x, y, width, height);
}
void API_ENTRY(glCompressedTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data) {
CALL_GL_API(glCompressedTexImage3DOES, target, level, internalformat, width, height, depth, border, imageSize, data);
}
void API_ENTRY(glCompressedTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data) {
CALL_GL_API(glCompressedTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
}
void API_ENTRY(glFramebufferTexture3DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {
CALL_GL_API(glFramebufferTexture3DOES, target, attachment, textarget, texture, level, zoffset);
}
void API_ENTRY(glBindVertexArrayOES)(GLuint array) {
CALL_GL_API(glBindVertexArrayOES, array);
}
void API_ENTRY(glDeleteVertexArraysOES)(GLsizei n, const GLuint *arrays) {
CALL_GL_API(glDeleteVertexArraysOES, n, arrays);
}
void API_ENTRY(glGenVertexArraysOES)(GLsizei n, GLuint *arrays) {
CALL_GL_API(glGenVertexArraysOES, n, arrays);
}
GLboolean API_ENTRY(glIsVertexArrayOES)(GLuint array) {
CALL_GL_API_RETURN(glIsVertexArrayOES, array);
}
void API_ENTRY(glGetPerfMonitorGroupsAMD)(GLint *numGroups, GLsizei groupsSize, GLuint *groups) {
CALL_GL_API(glGetPerfMonitorGroupsAMD, numGroups, groupsSize, groups);
}
void API_ENTRY(glGetPerfMonitorCountersAMD)(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters) {
CALL_GL_API(glGetPerfMonitorCountersAMD, group, numCounters, maxActiveCounters, counterSize, counters);
}
void API_ENTRY(glGetPerfMonitorGroupStringAMD)(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString) {
CALL_GL_API(glGetPerfMonitorGroupStringAMD, group, bufSize, length, groupString);
}
void API_ENTRY(glGetPerfMonitorCounterStringAMD)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString) {
CALL_GL_API(glGetPerfMonitorCounterStringAMD, group, counter, bufSize, length, counterString);
}
void API_ENTRY(glGetPerfMonitorCounterInfoAMD)(GLuint group, GLuint counter, GLenum pname, GLvoid *data) {
CALL_GL_API(glGetPerfMonitorCounterInfoAMD, group, counter, pname, data);
}
void API_ENTRY(glGenPerfMonitorsAMD)(GLsizei n, GLuint *monitors) {
CALL_GL_API(glGenPerfMonitorsAMD, n, monitors);
}
void API_ENTRY(glDeletePerfMonitorsAMD)(GLsizei n, GLuint *monitors) {
CALL_GL_API(glDeletePerfMonitorsAMD, n, monitors);
}
void API_ENTRY(glSelectPerfMonitorCountersAMD)(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList) {
CALL_GL_API(glSelectPerfMonitorCountersAMD, monitor, enable, group, numCounters, countersList);
}
void API_ENTRY(glBeginPerfMonitorAMD)(GLuint monitor) {
CALL_GL_API(glBeginPerfMonitorAMD, monitor);
}
void API_ENTRY(glEndPerfMonitorAMD)(GLuint monitor) {
CALL_GL_API(glEndPerfMonitorAMD, monitor);
}
void API_ENTRY(glGetPerfMonitorCounterDataAMD)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) {
CALL_GL_API(glGetPerfMonitorCounterDataAMD, monitor, pname, dataSize, data, bytesWritten);
}
void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments);
}
void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount);
}
void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount);
}
void API_ENTRY(glRenderbufferStorageMultisampleIMG)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
CALL_GL_API(glRenderbufferStorageMultisampleIMG, target, samples, internalformat, width, height);
}
void API_ENTRY(glFramebufferTexture2DMultisampleIMG)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
CALL_GL_API(glFramebufferTexture2DMultisampleIMG, target, attachment, textarget, texture, level, samples);
}
void API_ENTRY(glDeleteFencesNV)(GLsizei n, const GLuint *fences) {
CALL_GL_API(glDeleteFencesNV, n, fences);
}
void API_ENTRY(glGenFencesNV)(GLsizei n, GLuint *fences) {
CALL_GL_API(glGenFencesNV, n, fences);
}
GLboolean API_ENTRY(glIsFenceNV)(GLuint fence) {
CALL_GL_API_RETURN(glIsFenceNV, fence);
}
GLboolean API_ENTRY(glTestFenceNV)(GLuint fence) {
CALL_GL_API_RETURN(glTestFenceNV, fence);
}
void API_ENTRY(glGetFenceivNV)(GLuint fence, GLenum pname, GLint *params) {
CALL_GL_API(glGetFenceivNV, fence, pname, params);
}
void API_ENTRY(glFinishFenceNV)(GLuint fence) {
CALL_GL_API(glFinishFenceNV, fence);
}
void API_ENTRY(glSetFenceNV)(GLuint fence, GLenum condition) {
CALL_GL_API(glSetFenceNV, fence, condition);
}
void API_ENTRY(glCoverageMaskNV)(GLboolean mask) {
CALL_GL_API(glCoverageMaskNV, mask);
}
void API_ENTRY(glCoverageOperationNV)(GLenum operation) {
CALL_GL_API(glCoverageOperationNV, operation);
}
void API_ENTRY(glGetDriverControlsQCOM)(GLint *num, GLsizei size, GLuint *driverControls) {
CALL_GL_API(glGetDriverControlsQCOM, num, size, driverControls);
}
void API_ENTRY(glGetDriverControlStringQCOM)(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString) {
CALL_GL_API(glGetDriverControlStringQCOM, driverControl, bufSize, length, driverControlString);
}
void API_ENTRY(glEnableDriverControlQCOM)(GLuint driverControl) {
CALL_GL_API(glEnableDriverControlQCOM, driverControl);
}
void API_ENTRY(glDisableDriverControlQCOM)(GLuint driverControl) {
CALL_GL_API(glDisableDriverControlQCOM, driverControl);
}
void API_ENTRY(glExtGetTexturesQCOM)(GLuint *textures, GLint maxTextures, GLint *numTextures) {
CALL_GL_API(glExtGetTexturesQCOM, textures, maxTextures, numTextures);
}
void API_ENTRY(glExtGetBuffersQCOM)(GLuint *buffers, GLint maxBuffers, GLint *numBuffers) {
CALL_GL_API(glExtGetBuffersQCOM, buffers, maxBuffers, numBuffers);
}
void API_ENTRY(glExtGetRenderbuffersQCOM)(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers) {
CALL_GL_API(glExtGetRenderbuffersQCOM, renderbuffers, maxRenderbuffers, numRenderbuffers);
}
void API_ENTRY(glExtGetFramebuffersQCOM)(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers) {
CALL_GL_API(glExtGetFramebuffersQCOM, framebuffers, maxFramebuffers, numFramebuffers);
}
void API_ENTRY(glExtGetTexLevelParameterivQCOM)(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params) {
CALL_GL_API(glExtGetTexLevelParameterivQCOM, texture, face, level, pname, params);
}
void API_ENTRY(glExtTexObjectStateOverrideiQCOM)(GLenum target, GLenum pname, GLint param) {
CALL_GL_API(glExtTexObjectStateOverrideiQCOM, target, pname, param);
}
void API_ENTRY(glExtGetTexSubImageQCOM)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels) {
CALL_GL_API(glExtGetTexSubImageQCOM, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
}
void API_ENTRY(glExtGetBufferPointervQCOM)(GLenum target, GLvoid **params) {
CALL_GL_API(glExtGetBufferPointervQCOM, target, params);
}
void API_ENTRY(glExtGetShadersQCOM)(GLuint *shaders, GLint maxShaders, GLint *numShaders) {
CALL_GL_API(glExtGetShadersQCOM, shaders, maxShaders, numShaders);
}
void API_ENTRY(glExtGetProgramsQCOM)(GLuint *programs, GLint maxPrograms, GLint *numPrograms) {
CALL_GL_API(glExtGetProgramsQCOM, programs, maxPrograms, numPrograms);
}
GLboolean API_ENTRY(glExtIsProgramBinaryQCOM)(GLuint program) {
CALL_GL_API_RETURN(glExtIsProgramBinaryQCOM, program);
}
void API_ENTRY(glExtGetProgramBinarySourceQCOM)(GLuint program, GLenum shadertype, GLchar *source, GLint *length) {
CALL_GL_API(glExtGetProgramBinarySourceQCOM, program, shadertype, source, length);
}
void API_ENTRY(glStartTilingQCOM)(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) {
CALL_GL_API(glStartTilingQCOM, x, y, width, height, preserveMask);
}
void API_ENTRY(glEndTilingQCOM)(GLbitfield preserveMask) {
CALL_GL_API(glEndTilingQCOM, preserveMask);
}

View File

@ -0,0 +1,191 @@
/*
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <cutils/log.h>
#include <cutils/properties.h>
#include "hooks.h"
#include "egl_impl.h"
using namespace android;
// set this to 1 for crude GL debugging
#define CHECK_FOR_GL_ERRORS 0
// ----------------------------------------------------------------------------
// extensions for the framework
// ----------------------------------------------------------------------------
extern "C" {
GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr, GLsizei count);
GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
}
void glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr, GLsizei count) {
glColorPointer(size, type, stride, ptr);
}
void glNormalPointerBounds(GLenum type, GLsizei stride,
const GLvoid *pointer, GLsizei count) {
glNormalPointer(type, stride, pointer);
}
void glTexCoordPointerBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count) {
glTexCoordPointer(size, type, stride, pointer);
}
void glVertexPointerBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count) {
glVertexPointer(size, type, stride, pointer);
}
void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count) {
glPointSizePointerOES(type, stride, pointer);
}
GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count) {
glMatrixIndexPointerOES(size, type, stride, pointer);
}
GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count) {
glWeightPointerOES(size, type, stride, pointer);
}
// ----------------------------------------------------------------------------
// Actual GL entry-points
// ----------------------------------------------------------------------------
#undef API_ENTRY
#undef CALL_GL_API
#undef CALL_GL_API_RETURN
#if USE_FAST_TLS_KEY && !CHECK_FOR_GL_ERRORS
#ifdef HAVE_ARM_TLS_REGISTER
#define GET_TLS(reg) \
"mrc p15, 0, " #reg ", c13, c0, 3 \n"
#else
#define GET_TLS(reg) \
"mov " #reg ", #0xFFFF0FFF \n" \
"ldr " #reg ", [" #reg ", #-15] \n"
#endif
#define API_ENTRY(_api) __attribute__((naked)) _api
#define CALL_GL_API(_api, ...) \
asm volatile( \
GET_TLS(r12) \
"ldr r12, [r12, %[tls]] \n" \
"cmp r12, #0 \n" \
"ldrne pc, [r12, %[api]] \n" \
"mov r0, #0 \n" \
"bx lr \n" \
: \
: [tls] "J"(TLS_SLOT_OPENGL_API*4), \
[api] "J"(__builtin_offsetof(gl_hooks_t, gl._api)) \
: \
);
#define CALL_GL_API_RETURN(_api, ...) \
CALL_GL_API(_api, __VA_ARGS__) \
return 0; // placate gcc's warnings. never reached.
#else
#if CHECK_FOR_GL_ERRORS
#define CHECK_GL_ERRORS(_api) \
do { GLint err = glGetError(); \
LOGE_IF(err != GL_NO_ERROR, "%s failed (0x%04X)", #_api, err); \
} while(false);
#else
#define CHECK_GL_ERRORS(_api) do { } while(false);
#endif
#define API_ENTRY(_api) _api
#define CALL_GL_API(_api, ...) \
gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
_c->_api(__VA_ARGS__); \
CHECK_GL_ERRORS(_api)
#define CALL_GL_API_RETURN(_api, ...) \
gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
return _c->_api(__VA_ARGS__)
#endif
extern "C" {
#include "gl_api.in"
#include "glext_api.in"
}
#undef API_ENTRY
#undef CALL_GL_API
#undef CALL_GL_API_RETURN
/*
* These GL calls are special because they need to EGL to retrieve some
* informations before they can execute.
*/
extern "C" void __glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
extern "C" void __glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
{
GLeglImageOES implImage =
(GLeglImageOES)egl_get_image_for_current_context((EGLImageKHR)image);
__glEGLImageTargetTexture2DOES(target, implImage);
}
void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
{
GLeglImageOES implImage =
(GLeglImageOES)egl_get_image_for_current_context((EGLImageKHR)image);
__glEGLImageTargetRenderbufferStorageOES(target, implImage);
}

View File

@ -0,0 +1,435 @@
void API_ENTRY(glAlphaFunc)(GLenum func, GLclampf ref) {
CALL_GL_API(glAlphaFunc, func, ref);
}
void API_ENTRY(glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
CALL_GL_API(glClearColor, red, green, blue, alpha);
}
void API_ENTRY(glClearDepthf)(GLclampf depth) {
CALL_GL_API(glClearDepthf, depth);
}
void API_ENTRY(glClipPlanef)(GLenum plane, const GLfloat *equation) {
CALL_GL_API(glClipPlanef, plane, equation);
}
void API_ENTRY(glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
CALL_GL_API(glColor4f, red, green, blue, alpha);
}
void API_ENTRY(glDepthRangef)(GLclampf zNear, GLclampf zFar) {
CALL_GL_API(glDepthRangef, zNear, zFar);
}
void API_ENTRY(glFogf)(GLenum pname, GLfloat param) {
CALL_GL_API(glFogf, pname, param);
}
void API_ENTRY(glFogfv)(GLenum pname, const GLfloat *params) {
CALL_GL_API(glFogfv, pname, params);
}
void API_ENTRY(glFrustumf)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
CALL_GL_API(glFrustumf, left, right, bottom, top, zNear, zFar);
}
void API_ENTRY(glGetClipPlanef)(GLenum pname, GLfloat eqn[4]) {
CALL_GL_API(glGetClipPlanef, pname, eqn);
}
void API_ENTRY(glGetFloatv)(GLenum pname, GLfloat *params) {
CALL_GL_API(glGetFloatv, pname, params);
}
void API_ENTRY(glGetLightfv)(GLenum light, GLenum pname, GLfloat *params) {
CALL_GL_API(glGetLightfv, light, pname, params);
}
void API_ENTRY(glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params) {
CALL_GL_API(glGetMaterialfv, face, pname, params);
}
void API_ENTRY(glGetTexEnvfv)(GLenum env, GLenum pname, GLfloat *params) {
CALL_GL_API(glGetTexEnvfv, env, pname, params);
}
void API_ENTRY(glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params) {
CALL_GL_API(glGetTexParameterfv, target, pname, params);
}
void API_ENTRY(glLightModelf)(GLenum pname, GLfloat param) {
CALL_GL_API(glLightModelf, pname, param);
}
void API_ENTRY(glLightModelfv)(GLenum pname, const GLfloat *params) {
CALL_GL_API(glLightModelfv, pname, params);
}
void API_ENTRY(glLightf)(GLenum light, GLenum pname, GLfloat param) {
CALL_GL_API(glLightf, light, pname, param);
}
void API_ENTRY(glLightfv)(GLenum light, GLenum pname, const GLfloat *params) {
CALL_GL_API(glLightfv, light, pname, params);
}
void API_ENTRY(glLineWidth)(GLfloat width) {
CALL_GL_API(glLineWidth, width);
}
void API_ENTRY(glLoadMatrixf)(const GLfloat *m) {
CALL_GL_API(glLoadMatrixf, m);
}
void API_ENTRY(glMaterialf)(GLenum face, GLenum pname, GLfloat param) {
CALL_GL_API(glMaterialf, face, pname, param);
}
void API_ENTRY(glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params) {
CALL_GL_API(glMaterialfv, face, pname, params);
}
void API_ENTRY(glMultMatrixf)(const GLfloat *m) {
CALL_GL_API(glMultMatrixf, m);
}
void API_ENTRY(glMultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
CALL_GL_API(glMultiTexCoord4f, target, s, t, r, q);
}
void API_ENTRY(glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz) {
CALL_GL_API(glNormal3f, nx, ny, nz);
}
void API_ENTRY(glOrthof)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
CALL_GL_API(glOrthof, left, right, bottom, top, zNear, zFar);
}
void API_ENTRY(glPointParameterf)(GLenum pname, GLfloat param) {
CALL_GL_API(glPointParameterf, pname, param);
}
void API_ENTRY(glPointParameterfv)(GLenum pname, const GLfloat *params) {
CALL_GL_API(glPointParameterfv, pname, params);
}
void API_ENTRY(glPointSize)(GLfloat size) {
CALL_GL_API(glPointSize, size);
}
void API_ENTRY(glPolygonOffset)(GLfloat factor, GLfloat units) {
CALL_GL_API(glPolygonOffset, factor, units);
}
void API_ENTRY(glRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
CALL_GL_API(glRotatef, angle, x, y, z);
}
void API_ENTRY(glScalef)(GLfloat x, GLfloat y, GLfloat z) {
CALL_GL_API(glScalef, x, y, z);
}
void API_ENTRY(glTexEnvf)(GLenum target, GLenum pname, GLfloat param) {
CALL_GL_API(glTexEnvf, target, pname, param);
}
void API_ENTRY(glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params) {
CALL_GL_API(glTexEnvfv, target, pname, params);
}
void API_ENTRY(glTexParameterf)(GLenum target, GLenum pname, GLfloat param) {
CALL_GL_API(glTexParameterf, target, pname, param);
}
void API_ENTRY(glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params) {
CALL_GL_API(glTexParameterfv, target, pname, params);
}
void API_ENTRY(glTranslatef)(GLfloat x, GLfloat y, GLfloat z) {
CALL_GL_API(glTranslatef, x, y, z);
}
void API_ENTRY(glActiveTexture)(GLenum texture) {
CALL_GL_API(glActiveTexture, texture);
}
void API_ENTRY(glAlphaFuncx)(GLenum func, GLclampx ref) {
CALL_GL_API(glAlphaFuncx, func, ref);
}
void API_ENTRY(glBindBuffer)(GLenum target, GLuint buffer) {
CALL_GL_API(glBindBuffer, target, buffer);
}
void API_ENTRY(glBindTexture)(GLenum target, GLuint texture) {
CALL_GL_API(glBindTexture, target, texture);
}
void API_ENTRY(glBlendFunc)(GLenum sfactor, GLenum dfactor) {
CALL_GL_API(glBlendFunc, sfactor, dfactor);
}
void API_ENTRY(glBufferData)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) {
CALL_GL_API(glBufferData, target, size, data, usage);
}
void API_ENTRY(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) {
CALL_GL_API(glBufferSubData, target, offset, size, data);
}
void API_ENTRY(glClear)(GLbitfield mask) {
CALL_GL_API(glClear, mask);
}
void API_ENTRY(glClearColorx)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
CALL_GL_API(glClearColorx, red, green, blue, alpha);
}
void API_ENTRY(glClearDepthx)(GLclampx depth) {
CALL_GL_API(glClearDepthx, depth);
}
void API_ENTRY(glClearStencil)(GLint s) {
CALL_GL_API(glClearStencil, s);
}
void API_ENTRY(glClientActiveTexture)(GLenum texture) {
CALL_GL_API(glClientActiveTexture, texture);
}
void API_ENTRY(glClipPlanex)(GLenum plane, const GLfixed *equation) {
CALL_GL_API(glClipPlanex, plane, equation);
}
void API_ENTRY(glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) {
CALL_GL_API(glColor4ub, red, green, blue, alpha);
}
void API_ENTRY(glColor4x)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
CALL_GL_API(glColor4x, red, green, blue, alpha);
}
void API_ENTRY(glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
CALL_GL_API(glColorMask, red, green, blue, alpha);
}
void API_ENTRY(glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
CALL_GL_API(glColorPointer, size, type, stride, pointer);
}
void API_ENTRY(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) {
CALL_GL_API(glCompressedTexImage2D, target, level, internalformat, width, height, border, imageSize, data);
}
void API_ENTRY(glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {
CALL_GL_API(glCompressedTexSubImage2D, target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
void API_ENTRY(glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y, width, height, border);
}
void API_ENTRY(glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
CALL_GL_API(glCopyTexSubImage2D, target, level, xoffset, yoffset, x, y, width, height);
}
void API_ENTRY(glCullFace)(GLenum mode) {
CALL_GL_API(glCullFace, mode);
}
void API_ENTRY(glDeleteBuffers)(GLsizei n, const GLuint *buffers) {
CALL_GL_API(glDeleteBuffers, n, buffers);
}
void API_ENTRY(glDeleteTextures)(GLsizei n, const GLuint *textures) {
CALL_GL_API(glDeleteTextures, n, textures);
}
void API_ENTRY(glDepthFunc)(GLenum func) {
CALL_GL_API(glDepthFunc, func);
}
void API_ENTRY(glDepthMask)(GLboolean flag) {
CALL_GL_API(glDepthMask, flag);
}
void API_ENTRY(glDepthRangex)(GLclampx zNear, GLclampx zFar) {
CALL_GL_API(glDepthRangex, zNear, zFar);
}
void API_ENTRY(glDisable)(GLenum cap) {
CALL_GL_API(glDisable, cap);
}
void API_ENTRY(glDisableClientState)(GLenum array) {
CALL_GL_API(glDisableClientState, array);
}
void API_ENTRY(glDrawArrays)(GLenum mode, GLint first, GLsizei count) {
CALL_GL_API(glDrawArrays, mode, first, count);
}
void API_ENTRY(glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) {
CALL_GL_API(glDrawElements, mode, count, type, indices);
}
void API_ENTRY(glEnable)(GLenum cap) {
CALL_GL_API(glEnable, cap);
}
void API_ENTRY(glEnableClientState)(GLenum array) {
CALL_GL_API(glEnableClientState, array);
}
void API_ENTRY(glFinish)(void) {
CALL_GL_API(glFinish);
}
void API_ENTRY(glFlush)(void) {
CALL_GL_API(glFlush);
}
void API_ENTRY(glFogx)(GLenum pname, GLfixed param) {
CALL_GL_API(glFogx, pname, param);
}
void API_ENTRY(glFogxv)(GLenum pname, const GLfixed *params) {
CALL_GL_API(glFogxv, pname, params);
}
void API_ENTRY(glFrontFace)(GLenum mode) {
CALL_GL_API(glFrontFace, mode);
}
void API_ENTRY(glFrustumx)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
CALL_GL_API(glFrustumx, left, right, bottom, top, zNear, zFar);
}
void API_ENTRY(glGetBooleanv)(GLenum pname, GLboolean *params) {
CALL_GL_API(glGetBooleanv, pname, params);
}
void API_ENTRY(glGetBufferParameteriv)(GLenum target, GLenum pname, GLint *params) {
CALL_GL_API(glGetBufferParameteriv, target, pname, params);
}
void API_ENTRY(glGetClipPlanex)(GLenum pname, GLfixed eqn[4]) {
CALL_GL_API(glGetClipPlanex, pname, eqn);
}
void API_ENTRY(glGenBuffers)(GLsizei n, GLuint *buffers) {
CALL_GL_API(glGenBuffers, n, buffers);
}
void API_ENTRY(glGenTextures)(GLsizei n, GLuint *textures) {
CALL_GL_API(glGenTextures, n, textures);
}
GLenum API_ENTRY(glGetError)(void) {
CALL_GL_API_RETURN(glGetError);
}
void API_ENTRY(glGetFixedv)(GLenum pname, GLfixed *params) {
CALL_GL_API(glGetFixedv, pname, params);
}
void API_ENTRY(glGetIntegerv)(GLenum pname, GLint *params) {
CALL_GL_API(glGetIntegerv, pname, params);
}
void API_ENTRY(glGetLightxv)(GLenum light, GLenum pname, GLfixed *params) {
CALL_GL_API(glGetLightxv, light, pname, params);
}
void API_ENTRY(glGetMaterialxv)(GLenum face, GLenum pname, GLfixed *params) {
CALL_GL_API(glGetMaterialxv, face, pname, params);
}
void API_ENTRY(glGetPointerv)(GLenum pname, GLvoid **params) {
CALL_GL_API(glGetPointerv, pname, params);
}
const GLubyte * API_ENTRY(glGetString)(GLenum name) {
CALL_GL_API_RETURN(glGetString, name);
}
void API_ENTRY(glGetTexEnviv)(GLenum env, GLenum pname, GLint *params) {
CALL_GL_API(glGetTexEnviv, env, pname, params);
}
void API_ENTRY(glGetTexEnvxv)(GLenum env, GLenum pname, GLfixed *params) {
CALL_GL_API(glGetTexEnvxv, env, pname, params);
}
void API_ENTRY(glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params) {
CALL_GL_API(glGetTexParameteriv, target, pname, params);
}
void API_ENTRY(glGetTexParameterxv)(GLenum target, GLenum pname, GLfixed *params) {
CALL_GL_API(glGetTexParameterxv, target, pname, params);
}
void API_ENTRY(glHint)(GLenum target, GLenum mode) {
CALL_GL_API(glHint, target, mode);
}
GLboolean API_ENTRY(glIsBuffer)(GLuint buffer) {
CALL_GL_API_RETURN(glIsBuffer, buffer);
}
GLboolean API_ENTRY(glIsEnabled)(GLenum cap) {
CALL_GL_API_RETURN(glIsEnabled, cap);
}
GLboolean API_ENTRY(glIsTexture)(GLuint texture) {
CALL_GL_API_RETURN(glIsTexture, texture);
}
void API_ENTRY(glLightModelx)(GLenum pname, GLfixed param) {
CALL_GL_API(glLightModelx, pname, param);
}
void API_ENTRY(glLightModelxv)(GLenum pname, const GLfixed *params) {
CALL_GL_API(glLightModelxv, pname, params);
}
void API_ENTRY(glLightx)(GLenum light, GLenum pname, GLfixed param) {
CALL_GL_API(glLightx, light, pname, param);
}
void API_ENTRY(glLightxv)(GLenum light, GLenum pname, const GLfixed *params) {
CALL_GL_API(glLightxv, light, pname, params);
}
void API_ENTRY(glLineWidthx)(GLfixed width) {
CALL_GL_API(glLineWidthx, width);
}
void API_ENTRY(glLoadIdentity)(void) {
CALL_GL_API(glLoadIdentity);
}
void API_ENTRY(glLoadMatrixx)(const GLfixed *m) {
CALL_GL_API(glLoadMatrixx, m);
}
void API_ENTRY(glLogicOp)(GLenum opcode) {
CALL_GL_API(glLogicOp, opcode);
}
void API_ENTRY(glMaterialx)(GLenum face, GLenum pname, GLfixed param) {
CALL_GL_API(glMaterialx, face, pname, param);
}
void API_ENTRY(glMaterialxv)(GLenum face, GLenum pname, const GLfixed *params) {
CALL_GL_API(glMaterialxv, face, pname, params);
}
void API_ENTRY(glMatrixMode)(GLenum mode) {
CALL_GL_API(glMatrixMode, mode);
}
void API_ENTRY(glMultMatrixx)(const GLfixed *m) {
CALL_GL_API(glMultMatrixx, m);
}
void API_ENTRY(glMultiTexCoord4x)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
CALL_GL_API(glMultiTexCoord4x, target, s, t, r, q);
}
void API_ENTRY(glNormal3x)(GLfixed nx, GLfixed ny, GLfixed nz) {
CALL_GL_API(glNormal3x, nx, ny, nz);
}
void API_ENTRY(glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer) {
CALL_GL_API(glNormalPointer, type, stride, pointer);
}
void API_ENTRY(glOrthox)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
CALL_GL_API(glOrthox, left, right, bottom, top, zNear, zFar);
}
void API_ENTRY(glPixelStorei)(GLenum pname, GLint param) {
CALL_GL_API(glPixelStorei, pname, param);
}
void API_ENTRY(glPointParameterx)(GLenum pname, GLfixed param) {
CALL_GL_API(glPointParameterx, pname, param);
}
void API_ENTRY(glPointParameterxv)(GLenum pname, const GLfixed *params) {
CALL_GL_API(glPointParameterxv, pname, params);
}
void API_ENTRY(glPointSizex)(GLfixed size) {
CALL_GL_API(glPointSizex, size);
}
void API_ENTRY(glPolygonOffsetx)(GLfixed factor, GLfixed units) {
CALL_GL_API(glPolygonOffsetx, factor, units);
}
void API_ENTRY(glPopMatrix)(void) {
CALL_GL_API(glPopMatrix);
}
void API_ENTRY(glPushMatrix)(void) {
CALL_GL_API(glPushMatrix);
}
void API_ENTRY(glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) {
CALL_GL_API(glReadPixels, x, y, width, height, format, type, pixels);
}
void API_ENTRY(glRotatex)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
CALL_GL_API(glRotatex, angle, x, y, z);
}
void API_ENTRY(glSampleCoverage)(GLclampf value, GLboolean invert) {
CALL_GL_API(glSampleCoverage, value, invert);
}
void API_ENTRY(glSampleCoveragex)(GLclampx value, GLboolean invert) {
CALL_GL_API(glSampleCoveragex, value, invert);
}
void API_ENTRY(glScalex)(GLfixed x, GLfixed y, GLfixed z) {
CALL_GL_API(glScalex, x, y, z);
}
void API_ENTRY(glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) {
CALL_GL_API(glScissor, x, y, width, height);
}
void API_ENTRY(glShadeModel)(GLenum mode) {
CALL_GL_API(glShadeModel, mode);
}
void API_ENTRY(glStencilFunc)(GLenum func, GLint ref, GLuint mask) {
CALL_GL_API(glStencilFunc, func, ref, mask);
}
void API_ENTRY(glStencilMask)(GLuint mask) {
CALL_GL_API(glStencilMask, mask);
}
void API_ENTRY(glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) {
CALL_GL_API(glStencilOp, fail, zfail, zpass);
}
void API_ENTRY(glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
CALL_GL_API(glTexCoordPointer, size, type, stride, pointer);
}
void API_ENTRY(glTexEnvi)(GLenum target, GLenum pname, GLint param) {
CALL_GL_API(glTexEnvi, target, pname, param);
}
void API_ENTRY(glTexEnvx)(GLenum target, GLenum pname, GLfixed param) {
CALL_GL_API(glTexEnvx, target, pname, param);
}
void API_ENTRY(glTexEnviv)(GLenum target, GLenum pname, const GLint *params) {
CALL_GL_API(glTexEnviv, target, pname, params);
}
void API_ENTRY(glTexEnvxv)(GLenum target, GLenum pname, const GLfixed *params) {
CALL_GL_API(glTexEnvxv, target, pname, params);
}
void API_ENTRY(glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
CALL_GL_API(glTexImage2D, target, level, internalformat, width, height, border, format, type, pixels);
}
void API_ENTRY(glTexParameteri)(GLenum target, GLenum pname, GLint param) {
CALL_GL_API(glTexParameteri, target, pname, param);
}
void API_ENTRY(glTexParameterx)(GLenum target, GLenum pname, GLfixed param) {
CALL_GL_API(glTexParameterx, target, pname, param);
}
void API_ENTRY(glTexParameteriv)(GLenum target, GLenum pname, const GLint *params) {
CALL_GL_API(glTexParameteriv, target, pname, params);
}
void API_ENTRY(glTexParameterxv)(GLenum target, GLenum pname, const GLfixed *params) {
CALL_GL_API(glTexParameterxv, target, pname, params);
}
void API_ENTRY(glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) {
CALL_GL_API(glTexSubImage2D, target, level, xoffset, yoffset, width, height, format, type, pixels);
}
void API_ENTRY(glTranslatex)(GLfixed x, GLfixed y, GLfixed z) {
CALL_GL_API(glTranslatex, x, y, z);
}
void API_ENTRY(glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
CALL_GL_API(glVertexPointer, size, type, stride, pointer);
}
void API_ENTRY(glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) {
CALL_GL_API(glViewport, x, y, width, height);
}
void API_ENTRY(glPointSizePointerOES)(GLenum type, GLsizei stride, const GLvoid *pointer) {
CALL_GL_API(glPointSizePointerOES, type, stride, pointer);
}

View File

@ -0,0 +1,378 @@
void API_ENTRY(glBlendEquationSeparateOES)(GLenum modeRGB, GLenum modeAlpha) {
CALL_GL_API(glBlendEquationSeparateOES, modeRGB, modeAlpha);
}
void API_ENTRY(glBlendFuncSeparateOES)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
CALL_GL_API(glBlendFuncSeparateOES, srcRGB, dstRGB, srcAlpha, dstAlpha);
}
void API_ENTRY(glBlendEquationOES)(GLenum mode) {
CALL_GL_API(glBlendEquationOES, mode);
}
void API_ENTRY(glDrawTexsOES)(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) {
CALL_GL_API(glDrawTexsOES, x, y, z, width, height);
}
void API_ENTRY(glDrawTexiOES)(GLint x, GLint y, GLint z, GLint width, GLint height) {
CALL_GL_API(glDrawTexiOES, x, y, z, width, height);
}
void API_ENTRY(glDrawTexxOES)(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) {
CALL_GL_API(glDrawTexxOES, x, y, z, width, height);
}
void API_ENTRY(glDrawTexsvOES)(const GLshort *coords) {
CALL_GL_API(glDrawTexsvOES, coords);
}
void API_ENTRY(glDrawTexivOES)(const GLint *coords) {
CALL_GL_API(glDrawTexivOES, coords);
}
void API_ENTRY(glDrawTexxvOES)(const GLfixed *coords) {
CALL_GL_API(glDrawTexxvOES, coords);
}
void API_ENTRY(glDrawTexfOES)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) {
CALL_GL_API(glDrawTexfOES, x, y, z, width, height);
}
void API_ENTRY(glDrawTexfvOES)(const GLfloat *coords) {
CALL_GL_API(glDrawTexfvOES, coords);
}
void API_ENTRY(__glEGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES image) {
CALL_GL_API(glEGLImageTargetTexture2DOES, target, image);
}
void API_ENTRY(__glEGLImageTargetRenderbufferStorageOES)(GLenum target, GLeglImageOES image) {
CALL_GL_API(glEGLImageTargetRenderbufferStorageOES, target, image);
}
void API_ENTRY(glAlphaFuncxOES)(GLenum func, GLclampx ref) {
CALL_GL_API(glAlphaFuncxOES, func, ref);
}
void API_ENTRY(glClearColorxOES)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
CALL_GL_API(glClearColorxOES, red, green, blue, alpha);
}
void API_ENTRY(glClearDepthxOES)(GLclampx depth) {
CALL_GL_API(glClearDepthxOES, depth);
}
void API_ENTRY(glClipPlanexOES)(GLenum plane, const GLfixed *equation) {
CALL_GL_API(glClipPlanexOES, plane, equation);
}
void API_ENTRY(glColor4xOES)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
CALL_GL_API(glColor4xOES, red, green, blue, alpha);
}
void API_ENTRY(glDepthRangexOES)(GLclampx zNear, GLclampx zFar) {
CALL_GL_API(glDepthRangexOES, zNear, zFar);
}
void API_ENTRY(glFogxOES)(GLenum pname, GLfixed param) {
CALL_GL_API(glFogxOES, pname, param);
}
void API_ENTRY(glFogxvOES)(GLenum pname, const GLfixed *params) {
CALL_GL_API(glFogxvOES, pname, params);
}
void API_ENTRY(glFrustumxOES)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
CALL_GL_API(glFrustumxOES, left, right, bottom, top, zNear, zFar);
}
void API_ENTRY(glGetClipPlanexOES)(GLenum pname, GLfixed eqn[4]) {
CALL_GL_API(glGetClipPlanexOES, pname, eqn);
}
void API_ENTRY(glGetFixedvOES)(GLenum pname, GLfixed *params) {
CALL_GL_API(glGetFixedvOES, pname, params);
}
void API_ENTRY(glGetLightxvOES)(GLenum light, GLenum pname, GLfixed *params) {
CALL_GL_API(glGetLightxvOES, light, pname, params);
}
void API_ENTRY(glGetMaterialxvOES)(GLenum face, GLenum pname, GLfixed *params) {
CALL_GL_API(glGetMaterialxvOES, face, pname, params);
}
void API_ENTRY(glGetTexEnvxvOES)(GLenum env, GLenum pname, GLfixed *params) {
CALL_GL_API(glGetTexEnvxvOES, env, pname, params);
}
void API_ENTRY(glGetTexParameterxvOES)(GLenum target, GLenum pname, GLfixed *params) {
CALL_GL_API(glGetTexParameterxvOES, target, pname, params);
}
void API_ENTRY(glLightModelxOES)(GLenum pname, GLfixed param) {
CALL_GL_API(glLightModelxOES, pname, param);
}
void API_ENTRY(glLightModelxvOES)(GLenum pname, const GLfixed *params) {
CALL_GL_API(glLightModelxvOES, pname, params);
}
void API_ENTRY(glLightxOES)(GLenum light, GLenum pname, GLfixed param) {
CALL_GL_API(glLightxOES, light, pname, param);
}
void API_ENTRY(glLightxvOES)(GLenum light, GLenum pname, const GLfixed *params) {
CALL_GL_API(glLightxvOES, light, pname, params);
}
void API_ENTRY(glLineWidthxOES)(GLfixed width) {
CALL_GL_API(glLineWidthxOES, width);
}
void API_ENTRY(glLoadMatrixxOES)(const GLfixed *m) {
CALL_GL_API(glLoadMatrixxOES, m);
}
void API_ENTRY(glMaterialxOES)(GLenum face, GLenum pname, GLfixed param) {
CALL_GL_API(glMaterialxOES, face, pname, param);
}
void API_ENTRY(glMaterialxvOES)(GLenum face, GLenum pname, const GLfixed *params) {
CALL_GL_API(glMaterialxvOES, face, pname, params);
}
void API_ENTRY(glMultMatrixxOES)(const GLfixed *m) {
CALL_GL_API(glMultMatrixxOES, m);
}
void API_ENTRY(glMultiTexCoord4xOES)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
CALL_GL_API(glMultiTexCoord4xOES, target, s, t, r, q);
}
void API_ENTRY(glNormal3xOES)(GLfixed nx, GLfixed ny, GLfixed nz) {
CALL_GL_API(glNormal3xOES, nx, ny, nz);
}
void API_ENTRY(glOrthoxOES)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
CALL_GL_API(glOrthoxOES, left, right, bottom, top, zNear, zFar);
}
void API_ENTRY(glPointParameterxOES)(GLenum pname, GLfixed param) {
CALL_GL_API(glPointParameterxOES, pname, param);
}
void API_ENTRY(glPointParameterxvOES)(GLenum pname, const GLfixed *params) {
CALL_GL_API(glPointParameterxvOES, pname, params);
}
void API_ENTRY(glPointSizexOES)(GLfixed size) {
CALL_GL_API(glPointSizexOES, size);
}
void API_ENTRY(glPolygonOffsetxOES)(GLfixed factor, GLfixed units) {
CALL_GL_API(glPolygonOffsetxOES, factor, units);
}
void API_ENTRY(glRotatexOES)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
CALL_GL_API(glRotatexOES, angle, x, y, z);
}
void API_ENTRY(glSampleCoveragexOES)(GLclampx value, GLboolean invert) {
CALL_GL_API(glSampleCoveragexOES, value, invert);
}
void API_ENTRY(glScalexOES)(GLfixed x, GLfixed y, GLfixed z) {
CALL_GL_API(glScalexOES, x, y, z);
}
void API_ENTRY(glTexEnvxOES)(GLenum target, GLenum pname, GLfixed param) {
CALL_GL_API(glTexEnvxOES, target, pname, param);
}
void API_ENTRY(glTexEnvxvOES)(GLenum target, GLenum pname, const GLfixed *params) {
CALL_GL_API(glTexEnvxvOES, target, pname, params);
}
void API_ENTRY(glTexParameterxOES)(GLenum target, GLenum pname, GLfixed param) {
CALL_GL_API(glTexParameterxOES, target, pname, param);
}
void API_ENTRY(glTexParameterxvOES)(GLenum target, GLenum pname, const GLfixed *params) {
CALL_GL_API(glTexParameterxvOES, target, pname, params);
}
void API_ENTRY(glTranslatexOES)(GLfixed x, GLfixed y, GLfixed z) {
CALL_GL_API(glTranslatexOES, x, y, z);
}
GLboolean API_ENTRY(glIsRenderbufferOES)(GLuint renderbuffer) {
CALL_GL_API_RETURN(glIsRenderbufferOES, renderbuffer);
}
void API_ENTRY(glBindRenderbufferOES)(GLenum target, GLuint renderbuffer) {
CALL_GL_API(glBindRenderbufferOES, target, renderbuffer);
}
void API_ENTRY(glDeleteRenderbuffersOES)(GLsizei n, const GLuint* renderbuffers) {
CALL_GL_API(glDeleteRenderbuffersOES, n, renderbuffers);
}
void API_ENTRY(glGenRenderbuffersOES)(GLsizei n, GLuint* renderbuffers) {
CALL_GL_API(glGenRenderbuffersOES, n, renderbuffers);
}
void API_ENTRY(glRenderbufferStorageOES)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
CALL_GL_API(glRenderbufferStorageOES, target, internalformat, width, height);
}
void API_ENTRY(glGetRenderbufferParameterivOES)(GLenum target, GLenum pname, GLint* params) {
CALL_GL_API(glGetRenderbufferParameterivOES, target, pname, params);
}
GLboolean API_ENTRY(glIsFramebufferOES)(GLuint framebuffer) {
CALL_GL_API_RETURN(glIsFramebufferOES, framebuffer);
}
void API_ENTRY(glBindFramebufferOES)(GLenum target, GLuint framebuffer) {
CALL_GL_API(glBindFramebufferOES, target, framebuffer);
}
void API_ENTRY(glDeleteFramebuffersOES)(GLsizei n, const GLuint* framebuffers) {
CALL_GL_API(glDeleteFramebuffersOES, n, framebuffers);
}
void API_ENTRY(glGenFramebuffersOES)(GLsizei n, GLuint* framebuffers) {
CALL_GL_API(glGenFramebuffersOES, n, framebuffers);
}
GLenum API_ENTRY(glCheckFramebufferStatusOES)(GLenum target) {
CALL_GL_API_RETURN(glCheckFramebufferStatusOES, target);
}
void API_ENTRY(glFramebufferRenderbufferOES)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
CALL_GL_API(glFramebufferRenderbufferOES, target, attachment, renderbuffertarget, renderbuffer);
}
void API_ENTRY(glFramebufferTexture2DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
CALL_GL_API(glFramebufferTexture2DOES, target, attachment, textarget, texture, level);
}
void API_ENTRY(glGetFramebufferAttachmentParameterivOES)(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
CALL_GL_API(glGetFramebufferAttachmentParameterivOES, target, attachment, pname, params);
}
void API_ENTRY(glGenerateMipmapOES)(GLenum target) {
CALL_GL_API(glGenerateMipmapOES, target);
}
void* API_ENTRY(glMapBufferOES)(GLenum target, GLenum access) {
CALL_GL_API_RETURN(glMapBufferOES, target, access);
}
GLboolean API_ENTRY(glUnmapBufferOES)(GLenum target) {
CALL_GL_API_RETURN(glUnmapBufferOES, target);
}
void API_ENTRY(glGetBufferPointervOES)(GLenum target, GLenum pname, GLvoid ** params) {
CALL_GL_API(glGetBufferPointervOES, target, pname, params);
}
void API_ENTRY(glCurrentPaletteMatrixOES)(GLuint matrixpaletteindex) {
CALL_GL_API(glCurrentPaletteMatrixOES, matrixpaletteindex);
}
void API_ENTRY(glLoadPaletteFromModelViewMatrixOES)(void) {
CALL_GL_API(glLoadPaletteFromModelViewMatrixOES);
}
void API_ENTRY(glMatrixIndexPointerOES)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
CALL_GL_API(glMatrixIndexPointerOES, size, type, stride, pointer);
}
void API_ENTRY(glWeightPointerOES)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
CALL_GL_API(glWeightPointerOES, size, type, stride, pointer);
}
GLbitfield API_ENTRY(glQueryMatrixxOES)(GLfixed mantissa[16], GLint exponent[16]) {
CALL_GL_API_RETURN(glQueryMatrixxOES, mantissa, exponent);
}
void API_ENTRY(glDepthRangefOES)(GLclampf zNear, GLclampf zFar) {
CALL_GL_API(glDepthRangefOES, zNear, zFar);
}
void API_ENTRY(glFrustumfOES)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
CALL_GL_API(glFrustumfOES, left, right, bottom, top, zNear, zFar);
}
void API_ENTRY(glOrthofOES)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
CALL_GL_API(glOrthofOES, left, right, bottom, top, zNear, zFar);
}
void API_ENTRY(glClipPlanefOES)(GLenum plane, const GLfloat *equation) {
CALL_GL_API(glClipPlanefOES, plane, equation);
}
void API_ENTRY(glGetClipPlanefOES)(GLenum pname, GLfloat eqn[4]) {
CALL_GL_API(glGetClipPlanefOES, pname, eqn);
}
void API_ENTRY(glClearDepthfOES)(GLclampf depth) {
CALL_GL_API(glClearDepthfOES, depth);
}
void API_ENTRY(glTexGenfOES)(GLenum coord, GLenum pname, GLfloat param) {
CALL_GL_API(glTexGenfOES, coord, pname, param);
}
void API_ENTRY(glTexGenfvOES)(GLenum coord, GLenum pname, const GLfloat *params) {
CALL_GL_API(glTexGenfvOES, coord, pname, params);
}
void API_ENTRY(glTexGeniOES)(GLenum coord, GLenum pname, GLint param) {
CALL_GL_API(glTexGeniOES, coord, pname, param);
}
void API_ENTRY(glTexGenivOES)(GLenum coord, GLenum pname, const GLint *params) {
CALL_GL_API(glTexGenivOES, coord, pname, params);
}
void API_ENTRY(glTexGenxOES)(GLenum coord, GLenum pname, GLfixed param) {
CALL_GL_API(glTexGenxOES, coord, pname, param);
}
void API_ENTRY(glTexGenxvOES)(GLenum coord, GLenum pname, const GLfixed *params) {
CALL_GL_API(glTexGenxvOES, coord, pname, params);
}
void API_ENTRY(glGetTexGenfvOES)(GLenum coord, GLenum pname, GLfloat *params) {
CALL_GL_API(glGetTexGenfvOES, coord, pname, params);
}
void API_ENTRY(glGetTexGenivOES)(GLenum coord, GLenum pname, GLint *params) {
CALL_GL_API(glGetTexGenivOES, coord, pname, params);
}
void API_ENTRY(glGetTexGenxvOES)(GLenum coord, GLenum pname, GLfixed *params) {
CALL_GL_API(glGetTexGenxvOES, coord, pname, params);
}
void API_ENTRY(glBindVertexArrayOES)(GLuint array) {
CALL_GL_API(glBindVertexArrayOES, array);
}
void API_ENTRY(glDeleteVertexArraysOES)(GLsizei n, const GLuint *arrays) {
CALL_GL_API(glDeleteVertexArraysOES, n, arrays);
}
void API_ENTRY(glGenVertexArraysOES)(GLsizei n, GLuint *arrays) {
CALL_GL_API(glGenVertexArraysOES, n, arrays);
}
GLboolean API_ENTRY(glIsVertexArrayOES)(GLuint array) {
CALL_GL_API_RETURN(glIsVertexArrayOES, array);
}
void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments);
}
void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount);
}
void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount);
}
void API_ENTRY(glClipPlanefIMG)(GLenum p, const GLfloat *eqn) {
CALL_GL_API(glClipPlanefIMG, p, eqn);
}
void API_ENTRY(glClipPlanexIMG)(GLenum p, const GLfixed *eqn) {
CALL_GL_API(glClipPlanexIMG, p, eqn);
}
void API_ENTRY(glRenderbufferStorageMultisampleIMG)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
CALL_GL_API(glRenderbufferStorageMultisampleIMG, target, samples, internalformat, width, height);
}
void API_ENTRY(glFramebufferTexture2DMultisampleIMG)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
CALL_GL_API(glFramebufferTexture2DMultisampleIMG, target, attachment, textarget, texture, level, samples);
}
void API_ENTRY(glDeleteFencesNV)(GLsizei n, const GLuint *fences) {
CALL_GL_API(glDeleteFencesNV, n, fences);
}
void API_ENTRY(glGenFencesNV)(GLsizei n, GLuint *fences) {
CALL_GL_API(glGenFencesNV, n, fences);
}
GLboolean API_ENTRY(glIsFenceNV)(GLuint fence) {
CALL_GL_API_RETURN(glIsFenceNV, fence);
}
GLboolean API_ENTRY(glTestFenceNV)(GLuint fence) {
CALL_GL_API_RETURN(glTestFenceNV, fence);
}
void API_ENTRY(glGetFenceivNV)(GLuint fence, GLenum pname, GLint *params) {
CALL_GL_API(glGetFenceivNV, fence, pname, params);
}
void API_ENTRY(glFinishFenceNV)(GLuint fence) {
CALL_GL_API(glFinishFenceNV, fence);
}
void API_ENTRY(glSetFenceNV)(GLuint fence, GLenum condition) {
CALL_GL_API(glSetFenceNV, fence, condition);
}
void API_ENTRY(glGetDriverControlsQCOM)(GLint *num, GLsizei size, GLuint *driverControls) {
CALL_GL_API(glGetDriverControlsQCOM, num, size, driverControls);
}
void API_ENTRY(glGetDriverControlStringQCOM)(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString) {
CALL_GL_API(glGetDriverControlStringQCOM, driverControl, bufSize, length, driverControlString);
}
void API_ENTRY(glEnableDriverControlQCOM)(GLuint driverControl) {
CALL_GL_API(glEnableDriverControlQCOM, driverControl);
}
void API_ENTRY(glDisableDriverControlQCOM)(GLuint driverControl) {
CALL_GL_API(glDisableDriverControlQCOM, driverControl);
}
void API_ENTRY(glExtGetTexturesQCOM)(GLuint *textures, GLint maxTextures, GLint *numTextures) {
CALL_GL_API(glExtGetTexturesQCOM, textures, maxTextures, numTextures);
}
void API_ENTRY(glExtGetBuffersQCOM)(GLuint *buffers, GLint maxBuffers, GLint *numBuffers) {
CALL_GL_API(glExtGetBuffersQCOM, buffers, maxBuffers, numBuffers);
}
void API_ENTRY(glExtGetRenderbuffersQCOM)(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers) {
CALL_GL_API(glExtGetRenderbuffersQCOM, renderbuffers, maxRenderbuffers, numRenderbuffers);
}
void API_ENTRY(glExtGetFramebuffersQCOM)(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers) {
CALL_GL_API(glExtGetFramebuffersQCOM, framebuffers, maxFramebuffers, numFramebuffers);
}
void API_ENTRY(glExtGetTexLevelParameterivQCOM)(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params) {
CALL_GL_API(glExtGetTexLevelParameterivQCOM, texture, face, level, pname, params);
}
void API_ENTRY(glExtTexObjectStateOverrideiQCOM)(GLenum target, GLenum pname, GLint param) {
CALL_GL_API(glExtTexObjectStateOverrideiQCOM, target, pname, param);
}
void API_ENTRY(glExtGetTexSubImageQCOM)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels) {
CALL_GL_API(glExtGetTexSubImageQCOM, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
}
void API_ENTRY(glExtGetBufferPointervQCOM)(GLenum target, GLvoid **params) {
CALL_GL_API(glExtGetBufferPointervQCOM, target, params);
}
void API_ENTRY(glExtGetShadersQCOM)(GLuint *shaders, GLint maxShaders, GLint *numShaders) {
CALL_GL_API(glExtGetShadersQCOM, shaders, maxShaders, numShaders);
}
void API_ENTRY(glExtGetProgramsQCOM)(GLuint *programs, GLint maxPrograms, GLint *numPrograms) {
CALL_GL_API(glExtGetProgramsQCOM, programs, maxPrograms, numPrograms);
}
GLboolean API_ENTRY(glExtIsProgramBinaryQCOM)(GLuint program) {
CALL_GL_API_RETURN(glExtIsProgramBinaryQCOM, program);
}
void API_ENTRY(glExtGetProgramBinarySourceQCOM)(GLuint program, GLenum shadertype, GLchar *source, GLint *length) {
CALL_GL_API(glExtGetProgramBinarySourceQCOM, program, shadertype, source, length);
}
void API_ENTRY(glStartTilingQCOM)(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) {
CALL_GL_API(glStartTilingQCOM, x, y, width, height, preserveMask);
}
void API_ENTRY(glEndTilingQCOM)(GLbitfield preserveMask) {
CALL_GL_API(glEndTilingQCOM, preserveMask);
}

View File

@ -0,0 +1,48 @@
/*
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#ifndef ANDROID_EGL_IMPL_H
#define ANDROID_EGL_IMPL_H
#include <ctype.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <EGL/eglplatform.h>
#include "hooks.h"
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
struct egl_connection_t
{
inline egl_connection_t() : dso(0) { }
void * dso;
gl_hooks_t * hooks[2];
EGLint major;
EGLint minor;
egl_t egl;
};
EGLAPI EGLImageKHR egl_get_image_for_current_context(EGLImageKHR image);
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------
#endif /* ANDROID_EGL_IMPL_H */

376
base/opengl/libs/entries.in Normal file
View File

@ -0,0 +1,376 @@
GL_ENTRY(void, glActiveTexture, GLenum texture)
GL_ENTRY(void, glAlphaFunc, GLenum func, GLclampf ref)
GL_ENTRY(void, glAlphaFuncx, GLenum func, GLclampx ref)
GL_ENTRY(void, glAlphaFuncxOES, GLenum func, GLclampx ref)
GL_ENTRY(void, glAttachShader, GLuint program, GLuint shader)
GL_ENTRY(void, glBeginPerfMonitorAMD, GLuint monitor)
GL_ENTRY(void, glBindAttribLocation, GLuint program, GLuint index, const GLchar* name)
GL_ENTRY(void, glBindBuffer, GLenum target, GLuint buffer)
GL_ENTRY(void, glBindFramebuffer, GLenum target, GLuint framebuffer)
GL_ENTRY(void, glBindFramebufferOES, GLenum target, GLuint framebuffer)
GL_ENTRY(void, glBindRenderbuffer, GLenum target, GLuint renderbuffer)
GL_ENTRY(void, glBindRenderbufferOES, GLenum target, GLuint renderbuffer)
GL_ENTRY(void, glBindTexture, GLenum target, GLuint texture)
GL_ENTRY(void, glBindVertexArrayOES, GLuint array)
GL_ENTRY(void, glBlendColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
GL_ENTRY(void, glBlendEquation, GLenum mode )
GL_ENTRY(void, glBlendEquationOES, GLenum mode)
GL_ENTRY(void, glBlendEquationSeparate, GLenum modeRGB, GLenum modeAlpha)
GL_ENTRY(void, glBlendEquationSeparateOES, GLenum modeRGB, GLenum modeAlpha)
GL_ENTRY(void, glBlendFunc, GLenum sfactor, GLenum dfactor)
GL_ENTRY(void, glBlendFuncSeparate, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
GL_ENTRY(void, glBlendFuncSeparateOES, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
GL_ENTRY(void, glBufferData, GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
GL_ENTRY(void, glBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
GL_ENTRY(GLenum, glCheckFramebufferStatus, GLenum target)
GL_ENTRY(GLenum, glCheckFramebufferStatusOES, GLenum target)
GL_ENTRY(void, glClear, GLbitfield mask)
GL_ENTRY(void, glClearColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
GL_ENTRY(void, glClearColorx, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
GL_ENTRY(void, glClearColorxOES, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
GL_ENTRY(void, glClearDepthf, GLclampf depth)
GL_ENTRY(void, glClearDepthfOES, GLclampf depth)
GL_ENTRY(void, glClearDepthx, GLclampx depth)
GL_ENTRY(void, glClearDepthxOES, GLclampx depth)
GL_ENTRY(void, glClearStencil, GLint s)
GL_ENTRY(void, glClientActiveTexture, GLenum texture)
GL_ENTRY(void, glClipPlanef, GLenum plane, const GLfloat *equation)
GL_ENTRY(void, glClipPlanefIMG, GLenum p, const GLfloat *eqn)
GL_ENTRY(void, glClipPlanefOES, GLenum plane, const GLfloat *equation)
GL_ENTRY(void, glClipPlanex, GLenum plane, const GLfixed *equation)
GL_ENTRY(void, glClipPlanexIMG, GLenum p, const GLfixed *eqn)
GL_ENTRY(void, glClipPlanexOES, GLenum plane, const GLfixed *equation)
GL_ENTRY(void, glColor4f, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
GL_ENTRY(void, glColor4ub, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
GL_ENTRY(void, glColor4x, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
GL_ENTRY(void, glColor4xOES, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
GL_ENTRY(void, glColorMask, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
GL_ENTRY(void, glColorPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
GL_ENTRY(void, glCompileShader, GLuint shader)
GL_ENTRY(void, glCompressedTexImage2D, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
GL_ENTRY(void, glCompressedTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
GL_ENTRY(void, glCompressedTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
GL_ENTRY(void, glCompressedTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
GL_ENTRY(void, glCopyTexImage2D, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
GL_ENTRY(void, glCopyTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
GL_ENTRY(void, glCopyTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
GL_ENTRY(void, glCoverageMaskNV, GLboolean mask)
GL_ENTRY(void, glCoverageOperationNV, GLenum operation)
GL_ENTRY(GLuint, glCreateProgram, void)
GL_ENTRY(GLuint, glCreateShader, GLenum type)
GL_ENTRY(void, glCullFace, GLenum mode)
GL_ENTRY(void, glCurrentPaletteMatrixOES, GLuint matrixpaletteindex)
GL_ENTRY(void, glDeleteBuffers, GLsizei n, const GLuint *buffers)
GL_ENTRY(void, glDeleteFencesNV, GLsizei n, const GLuint *fences)
GL_ENTRY(void, glDeleteFramebuffers, GLsizei n, const GLuint* framebuffers)
GL_ENTRY(void, glDeleteFramebuffersOES, GLsizei n, const GLuint* framebuffers)
GL_ENTRY(void, glDeletePerfMonitorsAMD, GLsizei n, GLuint *monitors)
GL_ENTRY(void, glDeleteProgram, GLuint program)
GL_ENTRY(void, glDeleteRenderbuffers, GLsizei n, const GLuint* renderbuffers)
GL_ENTRY(void, glDeleteRenderbuffersOES, GLsizei n, const GLuint* renderbuffers)
GL_ENTRY(void, glDeleteShader, GLuint shader)
GL_ENTRY(void, glDeleteTextures, GLsizei n, const GLuint *textures)
GL_ENTRY(void, glDeleteVertexArraysOES, GLsizei n, const GLuint *arrays)
GL_ENTRY(void, glDepthFunc, GLenum func)
GL_ENTRY(void, glDepthMask, GLboolean flag)
GL_ENTRY(void, glDepthRangef, GLclampf zNear, GLclampf zFar)
GL_ENTRY(void, glDepthRangefOES, GLclampf zNear, GLclampf zFar)
GL_ENTRY(void, glDepthRangex, GLclampx zNear, GLclampx zFar)
GL_ENTRY(void, glDepthRangexOES, GLclampx zNear, GLclampx zFar)
GL_ENTRY(void, glDetachShader, GLuint program, GLuint shader)
GL_ENTRY(void, glDisable, GLenum cap)
GL_ENTRY(void, glDisableClientState, GLenum array)
GL_ENTRY(void, glDisableDriverControlQCOM, GLuint driverControl)
GL_ENTRY(void, glDisableVertexAttribArray, GLuint index)
GL_ENTRY(void, glDiscardFramebufferEXT, GLenum target, GLsizei numAttachments, const GLenum *attachments)
GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count)
GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
GL_ENTRY(void, glDrawTexfOES, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
GL_ENTRY(void, glDrawTexfvOES, const GLfloat *coords)
GL_ENTRY(void, glDrawTexiOES, GLint x, GLint y, GLint z, GLint width, GLint height)
GL_ENTRY(void, glDrawTexivOES, const GLint *coords)
GL_ENTRY(void, glDrawTexsOES, GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
GL_ENTRY(void, glDrawTexsvOES, const GLshort *coords)
GL_ENTRY(void, glDrawTexxOES, GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
GL_ENTRY(void, glDrawTexxvOES, const GLfixed *coords)
GL_ENTRY(void, glEGLImageTargetRenderbufferStorageOES, GLenum target, GLeglImageOES image)
GL_ENTRY(void, glEGLImageTargetTexture2DOES, GLenum target, GLeglImageOES image)
GL_ENTRY(void, glEnable, GLenum cap)
GL_ENTRY(void, glEnableClientState, GLenum array)
GL_ENTRY(void, glEnableDriverControlQCOM, GLuint driverControl)
GL_ENTRY(void, glEnableVertexAttribArray, GLuint index)
GL_ENTRY(void, glEndPerfMonitorAMD, GLuint monitor)
GL_ENTRY(void, glEndTilingQCOM, GLbitfield preserveMask)
GL_ENTRY(void, glExtGetBufferPointervQCOM, GLenum target, GLvoid **params)
GL_ENTRY(void, glExtGetBuffersQCOM, GLuint *buffers, GLint maxBuffers, GLint *numBuffers)
GL_ENTRY(void, glExtGetFramebuffersQCOM, GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers)
GL_ENTRY(void, glExtGetProgramBinarySourceQCOM, GLuint program, GLenum shadertype, GLchar *source, GLint *length)
GL_ENTRY(void, glExtGetProgramsQCOM, GLuint *programs, GLint maxPrograms, GLint *numPrograms)
GL_ENTRY(void, glExtGetRenderbuffersQCOM, GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers)
GL_ENTRY(void, glExtGetShadersQCOM, GLuint *shaders, GLint maxShaders, GLint *numShaders)
GL_ENTRY(void, glExtGetTexLevelParameterivQCOM, GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params)
GL_ENTRY(void, glExtGetTexSubImageQCOM, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels)
GL_ENTRY(void, glExtGetTexturesQCOM, GLuint *textures, GLint maxTextures, GLint *numTextures)
GL_ENTRY(GLboolean, glExtIsProgramBinaryQCOM, GLuint program)
GL_ENTRY(void, glExtTexObjectStateOverrideiQCOM, GLenum target, GLenum pname, GLint param)
GL_ENTRY(void, glFinish, void)
GL_ENTRY(void, glFinishFenceNV, GLuint fence)
GL_ENTRY(void, glFlush, void)
GL_ENTRY(void, glFogf, GLenum pname, GLfloat param)
GL_ENTRY(void, glFogfv, GLenum pname, const GLfloat *params)
GL_ENTRY(void, glFogx, GLenum pname, GLfixed param)
GL_ENTRY(void, glFogxOES, GLenum pname, GLfixed param)
GL_ENTRY(void, glFogxv, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glFogxvOES, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glFramebufferRenderbuffer, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
GL_ENTRY(void, glFramebufferRenderbufferOES, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
GL_ENTRY(void, glFramebufferTexture2D, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
GL_ENTRY(void, glFramebufferTexture2DMultisampleIMG, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
GL_ENTRY(void, glFramebufferTexture2DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
GL_ENTRY(void, glFramebufferTexture3DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
GL_ENTRY(void, glFrontFace, GLenum mode)
GL_ENTRY(void, glFrustumf, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
GL_ENTRY(void, glFrustumfOES, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
GL_ENTRY(void, glFrustumx, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
GL_ENTRY(void, glFrustumxOES, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
GL_ENTRY(void, glGenBuffers, GLsizei n, GLuint *buffers)
GL_ENTRY(void, glGenFencesNV, GLsizei n, GLuint *fences)
GL_ENTRY(void, glGenFramebuffers, GLsizei n, GLuint* framebuffers)
GL_ENTRY(void, glGenFramebuffersOES, GLsizei n, GLuint* framebuffers)
GL_ENTRY(void, glGenPerfMonitorsAMD, GLsizei n, GLuint *monitors)
GL_ENTRY(void, glGenRenderbuffers, GLsizei n, GLuint* renderbuffers)
GL_ENTRY(void, glGenRenderbuffersOES, GLsizei n, GLuint* renderbuffers)
GL_ENTRY(void, glGenTextures, GLsizei n, GLuint *textures)
GL_ENTRY(void, glGenVertexArraysOES, GLsizei n, GLuint *arrays)
GL_ENTRY(void, glGenerateMipmap, GLenum target)
GL_ENTRY(void, glGenerateMipmapOES, GLenum target)
GL_ENTRY(void, glGetActiveAttrib, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
GL_ENTRY(void, glGetActiveUniform, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
GL_ENTRY(void, glGetAttachedShaders, GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
GL_ENTRY(int, glGetAttribLocation, GLuint program, const GLchar* name)
GL_ENTRY(void, glGetBooleanv, GLenum pname, GLboolean *params)
GL_ENTRY(void, glGetBufferParameteriv, GLenum target, GLenum pname, GLint *params)
GL_ENTRY(void, glGetBufferPointervOES, GLenum target, GLenum pname, GLvoid ** params)
GL_ENTRY(void, glGetClipPlanef, GLenum pname, GLfloat eqn[4])
GL_ENTRY(void, glGetClipPlanefOES, GLenum pname, GLfloat eqn[4])
GL_ENTRY(void, glGetClipPlanex, GLenum pname, GLfixed eqn[4])
GL_ENTRY(void, glGetClipPlanexOES, GLenum pname, GLfixed eqn[4])
GL_ENTRY(void, glGetDriverControlStringQCOM, GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString)
GL_ENTRY(void, glGetDriverControlsQCOM, GLint *num, GLsizei size, GLuint *driverControls)
GL_ENTRY(GLenum, glGetError, void)
GL_ENTRY(void, glGetFenceivNV, GLuint fence, GLenum pname, GLint *params)
GL_ENTRY(void, glGetFixedv, GLenum pname, GLfixed *params)
GL_ENTRY(void, glGetFixedvOES, GLenum pname, GLfixed *params)
GL_ENTRY(void, glGetFloatv, GLenum pname, GLfloat *params)
GL_ENTRY(void, glGetFramebufferAttachmentParameteriv, GLenum target, GLenum attachment, GLenum pname, GLint* params)
GL_ENTRY(void, glGetFramebufferAttachmentParameterivOES, GLenum target, GLenum attachment, GLenum pname, GLint* params)
GL_ENTRY(void, glGetIntegerv, GLenum pname, GLint *params)
GL_ENTRY(void, glGetLightfv, GLenum light, GLenum pname, GLfloat *params)
GL_ENTRY(void, glGetLightxv, GLenum light, GLenum pname, GLfixed *params)
GL_ENTRY(void, glGetLightxvOES, GLenum light, GLenum pname, GLfixed *params)
GL_ENTRY(void, glGetMaterialfv, GLenum face, GLenum pname, GLfloat *params)
GL_ENTRY(void, glGetMaterialxv, GLenum face, GLenum pname, GLfixed *params)
GL_ENTRY(void, glGetMaterialxvOES, GLenum face, GLenum pname, GLfixed *params)
GL_ENTRY(void, glGetPerfMonitorCounterDataAMD, GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten)
GL_ENTRY(void, glGetPerfMonitorCounterInfoAMD, GLuint group, GLuint counter, GLenum pname, GLvoid *data)
GL_ENTRY(void, glGetPerfMonitorCounterStringAMD, GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString)
GL_ENTRY(void, glGetPerfMonitorCountersAMD, GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters)
GL_ENTRY(void, glGetPerfMonitorGroupStringAMD, GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString)
GL_ENTRY(void, glGetPerfMonitorGroupsAMD, GLint *numGroups, GLsizei groupsSize, GLuint *groups)
GL_ENTRY(void, glGetPointerv, GLenum pname, GLvoid **params)
GL_ENTRY(void, glGetProgramBinaryOES, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary)
GL_ENTRY(void, glGetProgramInfoLog, GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
GL_ENTRY(void, glGetProgramiv, GLuint program, GLenum pname, GLint* params)
GL_ENTRY(void, glGetRenderbufferParameteriv, GLenum target, GLenum pname, GLint* params)
GL_ENTRY(void, glGetRenderbufferParameterivOES, GLenum target, GLenum pname, GLint* params)
GL_ENTRY(void, glGetShaderInfoLog, GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
GL_ENTRY(void, glGetShaderPrecisionFormat, GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
GL_ENTRY(void, glGetShaderSource, GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
GL_ENTRY(void, glGetShaderiv, GLuint shader, GLenum pname, GLint* params)
GL_ENTRY(const GLubyte *, glGetString, GLenum name)
GL_ENTRY(void, glGetTexEnvfv, GLenum env, GLenum pname, GLfloat *params)
GL_ENTRY(void, glGetTexEnviv, GLenum env, GLenum pname, GLint *params)
GL_ENTRY(void, glGetTexEnvxv, GLenum env, GLenum pname, GLfixed *params)
GL_ENTRY(void, glGetTexEnvxvOES, GLenum env, GLenum pname, GLfixed *params)
GL_ENTRY(void, glGetTexGenfvOES, GLenum coord, GLenum pname, GLfloat *params)
GL_ENTRY(void, glGetTexGenivOES, GLenum coord, GLenum pname, GLint *params)
GL_ENTRY(void, glGetTexGenxvOES, GLenum coord, GLenum pname, GLfixed *params)
GL_ENTRY(void, glGetTexParameterfv, GLenum target, GLenum pname, GLfloat *params)
GL_ENTRY(void, glGetTexParameteriv, GLenum target, GLenum pname, GLint *params)
GL_ENTRY(void, glGetTexParameterxv, GLenum target, GLenum pname, GLfixed *params)
GL_ENTRY(void, glGetTexParameterxvOES, GLenum target, GLenum pname, GLfixed *params)
GL_ENTRY(int, glGetUniformLocation, GLuint program, const GLchar* name)
GL_ENTRY(void, glGetUniformfv, GLuint program, GLint location, GLfloat* params)
GL_ENTRY(void, glGetUniformiv, GLuint program, GLint location, GLint* params)
GL_ENTRY(void, glGetVertexAttribPointerv, GLuint index, GLenum pname, GLvoid** pointer)
GL_ENTRY(void, glGetVertexAttribfv, GLuint index, GLenum pname, GLfloat* params)
GL_ENTRY(void, glGetVertexAttribiv, GLuint index, GLenum pname, GLint* params)
GL_ENTRY(void, glHint, GLenum target, GLenum mode)
GL_ENTRY(GLboolean, glIsBuffer, GLuint buffer)
GL_ENTRY(GLboolean, glIsEnabled, GLenum cap)
GL_ENTRY(GLboolean, glIsFenceNV, GLuint fence)
GL_ENTRY(GLboolean, glIsFramebuffer, GLuint framebuffer)
GL_ENTRY(GLboolean, glIsFramebufferOES, GLuint framebuffer)
GL_ENTRY(GLboolean, glIsProgram, GLuint program)
GL_ENTRY(GLboolean, glIsRenderbuffer, GLuint renderbuffer)
GL_ENTRY(GLboolean, glIsRenderbufferOES, GLuint renderbuffer)
GL_ENTRY(GLboolean, glIsShader, GLuint shader)
GL_ENTRY(GLboolean, glIsTexture, GLuint texture)
GL_ENTRY(GLboolean, glIsVertexArrayOES, GLuint array)
GL_ENTRY(void, glLightModelf, GLenum pname, GLfloat param)
GL_ENTRY(void, glLightModelfv, GLenum pname, const GLfloat *params)
GL_ENTRY(void, glLightModelx, GLenum pname, GLfixed param)
GL_ENTRY(void, glLightModelxOES, GLenum pname, GLfixed param)
GL_ENTRY(void, glLightModelxv, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glLightModelxvOES, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glLightf, GLenum light, GLenum pname, GLfloat param)
GL_ENTRY(void, glLightfv, GLenum light, GLenum pname, const GLfloat *params)
GL_ENTRY(void, glLightx, GLenum light, GLenum pname, GLfixed param)
GL_ENTRY(void, glLightxOES, GLenum light, GLenum pname, GLfixed param)
GL_ENTRY(void, glLightxv, GLenum light, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glLightxvOES, GLenum light, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glLineWidth, GLfloat width)
GL_ENTRY(void, glLineWidthx, GLfixed width)
GL_ENTRY(void, glLineWidthxOES, GLfixed width)
GL_ENTRY(void, glLinkProgram, GLuint program)
GL_ENTRY(void, glLoadIdentity, void)
GL_ENTRY(void, glLoadMatrixf, const GLfloat *m)
GL_ENTRY(void, glLoadMatrixx, const GLfixed *m)
GL_ENTRY(void, glLoadMatrixxOES, const GLfixed *m)
GL_ENTRY(void, glLoadPaletteFromModelViewMatrixOES, void)
GL_ENTRY(void, glLogicOp, GLenum opcode)
GL_ENTRY(void*, glMapBufferOES, GLenum target, GLenum access)
GL_ENTRY(void, glMaterialf, GLenum face, GLenum pname, GLfloat param)
GL_ENTRY(void, glMaterialfv, GLenum face, GLenum pname, const GLfloat *params)
GL_ENTRY(void, glMaterialx, GLenum face, GLenum pname, GLfixed param)
GL_ENTRY(void, glMaterialxOES, GLenum face, GLenum pname, GLfixed param)
GL_ENTRY(void, glMaterialxv, GLenum face, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glMaterialxvOES, GLenum face, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glMatrixIndexPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
GL_ENTRY(void, glMatrixMode, GLenum mode)
GL_ENTRY(void, glMultMatrixf, const GLfloat *m)
GL_ENTRY(void, glMultMatrixx, const GLfixed *m)
GL_ENTRY(void, glMultMatrixxOES, const GLfixed *m)
GL_ENTRY(void, glMultiDrawArraysEXT, GLenum mode, GLint *first, GLsizei *count, GLsizei primcount)
GL_ENTRY(void, glMultiDrawElementsEXT, GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount)
GL_ENTRY(void, glMultiTexCoord4f, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
GL_ENTRY(void, glMultiTexCoord4x, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
GL_ENTRY(void, glMultiTexCoord4xOES, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
GL_ENTRY(void, glNormal3f, GLfloat nx, GLfloat ny, GLfloat nz)
GL_ENTRY(void, glNormal3x, GLfixed nx, GLfixed ny, GLfixed nz)
GL_ENTRY(void, glNormal3xOES, GLfixed nx, GLfixed ny, GLfixed nz)
GL_ENTRY(void, glNormalPointer, GLenum type, GLsizei stride, const GLvoid *pointer)
GL_ENTRY(void, glOrthof, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
GL_ENTRY(void, glOrthofOES, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
GL_ENTRY(void, glOrthox, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
GL_ENTRY(void, glOrthoxOES, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
GL_ENTRY(void, glPixelStorei, GLenum pname, GLint param)
GL_ENTRY(void, glPointParameterf, GLenum pname, GLfloat param)
GL_ENTRY(void, glPointParameterfv, GLenum pname, const GLfloat *params)
GL_ENTRY(void, glPointParameterx, GLenum pname, GLfixed param)
GL_ENTRY(void, glPointParameterxOES, GLenum pname, GLfixed param)
GL_ENTRY(void, glPointParameterxv, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glPointParameterxvOES, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glPointSize, GLfloat size)
GL_ENTRY(void, glPointSizePointerOES, GLenum type, GLsizei stride, const GLvoid *pointer)
GL_ENTRY(void, glPointSizex, GLfixed size)
GL_ENTRY(void, glPointSizexOES, GLfixed size)
GL_ENTRY(void, glPolygonOffset, GLfloat factor, GLfloat units)
GL_ENTRY(void, glPolygonOffsetx, GLfixed factor, GLfixed units)
GL_ENTRY(void, glPolygonOffsetxOES, GLfixed factor, GLfixed units)
GL_ENTRY(void, glPopMatrix, void)
GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length)
GL_ENTRY(void, glPushMatrix, void)
GL_ENTRY(GLbitfield, glQueryMatrixxOES, GLfixed mantissa[16], GLint exponent[16])
GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
GL_ENTRY(void, glReleaseShaderCompiler, void)
GL_ENTRY(void, glRenderbufferStorage, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
GL_ENTRY(void, glRenderbufferStorageMultisampleIMG, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
GL_ENTRY(void, glRenderbufferStorageOES, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
GL_ENTRY(void, glRotatef, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
GL_ENTRY(void, glRotatex, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
GL_ENTRY(void, glRotatexOES, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
GL_ENTRY(void, glSampleCoverage, GLclampf value, GLboolean invert)
GL_ENTRY(void, glSampleCoveragex, GLclampx value, GLboolean invert)
GL_ENTRY(void, glSampleCoveragexOES, GLclampx value, GLboolean invert)
GL_ENTRY(void, glScalef, GLfloat x, GLfloat y, GLfloat z)
GL_ENTRY(void, glScalex, GLfixed x, GLfixed y, GLfixed z)
GL_ENTRY(void, glScalexOES, GLfixed x, GLfixed y, GLfixed z)
GL_ENTRY(void, glScissor, GLint x, GLint y, GLsizei width, GLsizei height)
GL_ENTRY(void, glSelectPerfMonitorCountersAMD, GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList)
GL_ENTRY(void, glSetFenceNV, GLuint fence, GLenum condition)
GL_ENTRY(void, glShadeModel, GLenum mode)
GL_ENTRY(void, glShaderBinary, GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
GL_ENTRY(void, glShaderSource, GLuint shader, GLsizei count, const GLchar** string, const GLint* length)
GL_ENTRY(void, glStartTilingQCOM, GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
GL_ENTRY(void, glStencilFunc, GLenum func, GLint ref, GLuint mask)
GL_ENTRY(void, glStencilFuncSeparate, GLenum face, GLenum func, GLint ref, GLuint mask)
GL_ENTRY(void, glStencilMask, GLuint mask)
GL_ENTRY(void, glStencilMaskSeparate, GLenum face, GLuint mask)
GL_ENTRY(void, glStencilOp, GLenum fail, GLenum zfail, GLenum zpass)
GL_ENTRY(void, glStencilOpSeparate, GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
GL_ENTRY(GLboolean, glTestFenceNV, GLuint fence)
GL_ENTRY(void, glTexCoordPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
GL_ENTRY(void, glTexEnvf, GLenum target, GLenum pname, GLfloat param)
GL_ENTRY(void, glTexEnvfv, GLenum target, GLenum pname, const GLfloat *params)
GL_ENTRY(void, glTexEnvi, GLenum target, GLenum pname, GLint param)
GL_ENTRY(void, glTexEnviv, GLenum target, GLenum pname, const GLint *params)
GL_ENTRY(void, glTexEnvx, GLenum target, GLenum pname, GLfixed param)
GL_ENTRY(void, glTexEnvxOES, GLenum target, GLenum pname, GLfixed param)
GL_ENTRY(void, glTexEnvxv, GLenum target, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glTexEnvxvOES, GLenum target, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glTexGenfOES, GLenum coord, GLenum pname, GLfloat param)
GL_ENTRY(void, glTexGenfvOES, GLenum coord, GLenum pname, const GLfloat *params)
GL_ENTRY(void, glTexGeniOES, GLenum coord, GLenum pname, GLint param)
GL_ENTRY(void, glTexGenivOES, GLenum coord, GLenum pname, const GLint *params)
GL_ENTRY(void, glTexGenxOES, GLenum coord, GLenum pname, GLfixed param)
GL_ENTRY(void, glTexGenxvOES, GLenum coord, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glTexImage2D, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
GL_ENTRY(void, glTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
GL_ENTRY(void, glTexParameterf, GLenum target, GLenum pname, GLfloat param)
GL_ENTRY(void, glTexParameterfv, GLenum target, GLenum pname, const GLfloat *params)
GL_ENTRY(void, glTexParameteri, GLenum target, GLenum pname, GLint param)
GL_ENTRY(void, glTexParameteriv, GLenum target, GLenum pname, const GLint *params)
GL_ENTRY(void, glTexParameterx, GLenum target, GLenum pname, GLfixed param)
GL_ENTRY(void, glTexParameterxOES, GLenum target, GLenum pname, GLfixed param)
GL_ENTRY(void, glTexParameterxv, GLenum target, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glTexParameterxvOES, GLenum target, GLenum pname, const GLfixed *params)
GL_ENTRY(void, glTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
GL_ENTRY(void, glTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
GL_ENTRY(void, glTranslatef, GLfloat x, GLfloat y, GLfloat z)
GL_ENTRY(void, glTranslatex, GLfixed x, GLfixed y, GLfixed z)
GL_ENTRY(void, glTranslatexOES, GLfixed x, GLfixed y, GLfixed z)
GL_ENTRY(void, glUniform1f, GLint location, GLfloat x)
GL_ENTRY(void, glUniform1fv, GLint location, GLsizei count, const GLfloat* v)
GL_ENTRY(void, glUniform1i, GLint location, GLint x)
GL_ENTRY(void, glUniform1iv, GLint location, GLsizei count, const GLint* v)
GL_ENTRY(void, glUniform2f, GLint location, GLfloat x, GLfloat y)
GL_ENTRY(void, glUniform2fv, GLint location, GLsizei count, const GLfloat* v)
GL_ENTRY(void, glUniform2i, GLint location, GLint x, GLint y)
GL_ENTRY(void, glUniform2iv, GLint location, GLsizei count, const GLint* v)
GL_ENTRY(void, glUniform3f, GLint location, GLfloat x, GLfloat y, GLfloat z)
GL_ENTRY(void, glUniform3fv, GLint location, GLsizei count, const GLfloat* v)
GL_ENTRY(void, glUniform3i, GLint location, GLint x, GLint y, GLint z)
GL_ENTRY(void, glUniform3iv, GLint location, GLsizei count, const GLint* v)
GL_ENTRY(void, glUniform4f, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
GL_ENTRY(void, glUniform4fv, GLint location, GLsizei count, const GLfloat* v)
GL_ENTRY(void, glUniform4i, GLint location, GLint x, GLint y, GLint z, GLint w)
GL_ENTRY(void, glUniform4iv, GLint location, GLsizei count, const GLint* v)
GL_ENTRY(void, glUniformMatrix2fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
GL_ENTRY(void, glUniformMatrix3fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
GL_ENTRY(void, glUniformMatrix4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
GL_ENTRY(GLboolean, glUnmapBufferOES, GLenum target)
GL_ENTRY(void, glUseProgram, GLuint program)
GL_ENTRY(void, glValidateProgram, GLuint program)
GL_ENTRY(void, glVertexAttrib1f, GLuint indx, GLfloat x)
GL_ENTRY(void, glVertexAttrib1fv, GLuint indx, const GLfloat* values)
GL_ENTRY(void, glVertexAttrib2f, GLuint indx, GLfloat x, GLfloat y)
GL_ENTRY(void, glVertexAttrib2fv, GLuint indx, const GLfloat* values)
GL_ENTRY(void, glVertexAttrib3f, GLuint indx, GLfloat x, GLfloat y, GLfloat z)
GL_ENTRY(void, glVertexAttrib3fv, GLuint indx, const GLfloat* values)
GL_ENTRY(void, glVertexAttrib4f, GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
GL_ENTRY(void, glVertexAttrib4fv, GLuint indx, const GLfloat* values)
GL_ENTRY(void, glVertexAttribPointer, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
GL_ENTRY(void, glVertexPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
GL_ENTRY(void, glViewport, GLint x, GLint y, GLsizei width, GLsizei height)
GL_ENTRY(void, glWeightPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)

149
base/opengl/libs/hooks.h Normal file
View File

@ -0,0 +1,149 @@
/*
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#ifndef ANDROID_GLES_CM_HOOKS_H
#define ANDROID_GLES_CM_HOOKS_H
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <pthread.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#if !defined(__arm__)
#define USE_SLOW_BINDING 1
#else
#define USE_SLOW_BINDING 0
#endif
#undef NELEM
#define NELEM(x) (sizeof(x)/sizeof(*(x)))
#define MAX_NUMBER_OF_GL_EXTENSIONS 64
#if defined(HAVE_ANDROID_OS) && !USE_SLOW_BINDING && __OPTIMIZE__
#define USE_FAST_TLS_KEY 1
#else
#define USE_FAST_TLS_KEY 0
#endif
#if USE_FAST_TLS_KEY
# include <bionic_tls.h> /* special private C library header */
#endif
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
// EGLDisplay are global, not attached to a given thread
const unsigned int NUM_DISPLAYS = 1;
enum {
IMPL_HARDWARE = 0,
IMPL_SOFTWARE,
IMPL_NUM_IMPLEMENTATIONS
};
enum {
GLESv1_INDEX = 0,
GLESv2_INDEX = 1,
};
// ----------------------------------------------------------------------------
// GL / EGL hooks
#undef GL_ENTRY
#undef EGL_ENTRY
#define GL_ENTRY(_r, _api, ...) _r (*_api)(__VA_ARGS__);
#define EGL_ENTRY(_r, _api, ...) _r (*_api)(__VA_ARGS__);
struct egl_t {
#include "EGL/egl_entries.in"
};
struct gl_hooks_t {
struct gl_t {
#include "entries.in"
} gl;
struct gl_ext_t {
__eglMustCastToProperFunctionPointerType extensions[MAX_NUMBER_OF_GL_EXTENSIONS];
} ext;
};
#undef GL_ENTRY
#undef EGL_ENTRY
// ----------------------------------------------------------------------------
extern gl_hooks_t gHooks[2][IMPL_NUM_IMPLEMENTATIONS];
extern gl_hooks_t gHooksNoContext;
extern pthread_key_t gGLWrapperKey;
extern "C" void gl_unimplemented();
extern char const * const gl_names[];
extern char const * const egl_names[];
// ----------------------------------------------------------------------------
#if USE_FAST_TLS_KEY
// We have a dedicated TLS slot in bionic
static inline gl_hooks_t const * volatile * get_tls_hooks() {
volatile void *tls_base = __get_tls();
gl_hooks_t const * volatile * tls_hooks =
reinterpret_cast<gl_hooks_t const * volatile *>(tls_base);
return tls_hooks;
}
static inline void setGlThreadSpecific(gl_hooks_t const *value) {
gl_hooks_t const * volatile * tls_hooks = get_tls_hooks();
tls_hooks[TLS_SLOT_OPENGL_API] = value;
}
static gl_hooks_t const* getGlThreadSpecific() {
gl_hooks_t const * volatile * tls_hooks = get_tls_hooks();
gl_hooks_t const* hooks = tls_hooks[TLS_SLOT_OPENGL_API];
if (hooks) return hooks;
return &gHooksNoContext;
}
#else
static inline void setGlThreadSpecific(gl_hooks_t const *value) {
pthread_setspecific(gGLWrapperKey, value);
}
static gl_hooks_t const* getGlThreadSpecific() {
gl_hooks_t const* hooks = static_cast<gl_hooks_t*>(pthread_getspecific(gGLWrapperKey));
if (hooks) return hooks;
return &gHooksNoContext;
}
#endif
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------
#endif /* ANDROID_GLES_CM_HOOKS_H */

33
base/opengl/libs/tools/genfiles Executable file
View File

@ -0,0 +1,33 @@
#! /bin/sh
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
./glapigen ../../include/GLES/gl.h > ../GLES_CM/gl_api.in
./glapigen ../../include/GLES/glext.h > ../GLES_CM/glext_api.in
./glapigen ../../include/GLES2/gl2.h > ../GLES2/gl2_api.in
./glapigen ../../include/GLES2/gl2ext.h > ../GLES2/gl2ext_api.in
./glentrygen ../../include/GLES/gl.h > /tmp/gl_entries.in
./glentrygen ../../include/GLES/glext.h > /tmp/glext_entries.in
./glentrygen ../../include/GLES2/gl2.h > /tmp/gl2_entries.in
./glentrygen ../../include/GLES2/gl2ext.h > /tmp/gl2ext_entries.in
cat /tmp/gl_entries.in \
/tmp/glext_entries.in \
/tmp/gl2_entries.in \
/tmp/gl2ext_entries.in \
| sort -t, -k2 \
| awk -F, '!_[$2]++' \
> ../entries.in

79
base/opengl/libs/tools/glapigen Executable file
View File

@ -0,0 +1,79 @@
#! /usr/bin/perl
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
use strict;
sub rtrim($)
{
my $string = shift;
$string =~ s/\s+$//;
return $string;
}
while (my $line = <>) {
next if $line =~ /^\//;
next if $line =~ /^#/;
next if $line =~ /^\s*$/;
if ($line !~ /^GL_API(CALL)?\s+(.+)\s+GL_APIENTRY\s+([\w]+)\s*\(([^\)]+)\);/) {
next;
}
my $type = rtrim($2);
my $name = $3;
my $args = $4;
#printf("%s", $line);
my $prefix = "";
if ($name eq "glEGLImageTargetTexture2DOES") {
$prefix = "__";
}
if ($name eq "glEGLImageTargetRenderbufferStorageOES") {
$prefix = "__";
}
printf("%s API_ENTRY(%s%s)(%s)", $type, $prefix, $name, $args);
printf(" {\n");
if ($type eq "void") {
printf(" CALL_GL_API(%s", $name);
} else {
printf(" CALL_GL_API_RETURN(%s", $name);
}
my @args = split ',', $args;
my $len = scalar(@args);
for (my $num = 0; $num < $len; $num++) {
if ($args[$num] ne "void") {
print ", ";
#
# extract the name from the parameter
# type name
# const type *name
# type *name
# type name[4]
#
if ($args[$num] =~ /(\S+\s)+\**\s*([\w]+)/) {
printf("%s", $2);
}
}
}
printf(");\n");
printf("}\n");
}

View File

@ -0,0 +1,38 @@
#! /usr/bin/perl
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
use strict;
sub rtrim($)
{
my $string = shift;
$string =~ s/\s+$//;
return $string;
}
while (my $line = <>) {
next if $line =~ /^\//;
next if $line =~ /^#/;
next if $line =~ /^\s*$/;
if ($line !~ /^GL_API(CALL)?\s+(.+)\s+GL_APIENTRY\s+([\w]+)\s*\(([^\)]+)\);/) {
next;
}
my $type = rtrim($2);
my $name = $3;
my $args = $4;
printf("GL_ENTRY(%s, %s, %s)\n", $type, $name, $args);
}