emulator_camera_c_includes := external/jpeg \
frameworks/native/include/media/hardware \
- $(LOCAL_PATH)/../opengl/system/OpenglSystemCommon \
+ $(LOCAL_PATH)/../../goldfish-opengl/system/OpenglSystemCommon \
$(call include-path-for, camera)
emulator_camera_src := \
+++ /dev/null
-# This is the top-level build file for the Android HW OpenGL ES emulation
-# in Android.
-#
-# You must define BUILD_EMULATOR_OPENGL to 'true' in your environment to
-# build the following files.
-#
-# Also define BUILD_EMULATOR_OPENGL_DRIVER to 'true' to build the gralloc
-# stuff as well.
-#
-ifeq (true,$(BUILD_EMULATOR_OPENGL))
-
-# Top-level for all modules
-EMUGL_PATH := $(call my-dir)
-
-# Directory containing common headers used by several modules
-# This is always set to a module's LOCAL_C_INCLUDES
-# See the definition of emugl-begin-module in common.mk
-#
-EMUGL_COMMON_INCLUDES := $(EMUGL_PATH)/host/include/libOpenglRender
-
-# common cflags used by several modules
-# This is always set to a module's LOCAL_CFLAGS
-# See the definition of emugl-begin-module in common.mk
-#
-EMUGL_COMMON_CFLAGS := -DWITH_GLES2
-
-# Uncomment the following line if you want to enable debug traces
-# in the GLES emulation libraries.
-# EMUGL_COMMON_CFLAGS += -DEMUGL_DEBUG=1
-
-# Include common definitions used by all the modules included later
-# in this build file. This contains the definition of all useful
-# emugl-xxxx functions.
-#
-include $(EMUGL_PATH)/common.mk
-
-# IMPORTANT: ORDER IS CRUCIAL HERE
-#
-# For the import/export feature to work properly, you must include
-# modules below in correct order. That is, if module B depends on
-# module A, then it must be included after module A below.
-#
-# This ensures that anything exported by module A will be correctly
-# be imported by module B when it is declared.
-#
-# Note that the build system will complain if you try to import a
-# module that hasn't been declared yet anyway.
-#
-
-include $(EMUGL_PATH)/shared/OpenglCodecCommon/Android.mk
-
-# System static libraries
-include $(EMUGL_PATH)/system/GLESv1_enc/Android.mk
-include $(EMUGL_PATH)/system/GLESv2_enc/Android.mk
-include $(EMUGL_PATH)/system/renderControl_enc/Android.mk
-include $(EMUGL_PATH)/system/OpenglSystemCommon/Android.mk
-
-# System shared libraries
-include $(EMUGL_PATH)/system/GLESv1/Android.mk
-include $(EMUGL_PATH)/system/GLESv2/Android.mk
-
-include $(EMUGL_PATH)/system/gralloc/Android.mk
-include $(EMUGL_PATH)/system/egl/Android.mk
-
-endif # BUILD_EMULATOR_OPENGL == true
+++ /dev/null
-This directory contains Android-side modules related to hardware OpenGL ES
-emulation. The host-side modules and documentation are in
-$ANDROID_BUILD_TOP/sdk/emulator/opengl.
-
-Note that this directory contains encoder sources that are auto-generated
-with the 'emugen' host tool (see sdk/emulator/opengl/host/tools/emugen).
-
-To regenerate them, run external/qemu/distrib/update-emugl-sources.sh,
-after building the emulator from sources, this will populate the content
-here with the appropriate updated source files.
-
-You should do this whenever you update one of the *.types, *.in and *.attrib
-files located under one of:
-
- $AOSP/sdk/emulator/opengl/libs/GLESv1_dec/
- $AOSP/sdk/emulator/opengl/libs/GLESv2_dec/
- $AOSP/sdk/emulator/opengl/libs/renderControl_dec/
-
-or when the 'emugen' tool itself is modified.
+++ /dev/null
-# This top-level build file is included by all modules that implement
-# the hardware OpenGL ES emulation for Android.
-#
-# We use it to ensure that all sub-Makefiles are included in the right
-# order for various variable definitions and usage to happen in the correct
-# order.
-#
-
-# The following macros are used to start a new GLES emulation module.
-#
-# This will define LOCAL_MODULE as $1, plus a few other variables
-# needed by the build system (e.g. LOCAL_MODULE_TAGS, LOCAL_MODULE_CLASS...)
-#
-# NOTE: You still need to define LOCAL_PATH before this
-#
-# Usage example:
-#
-# $(call emugl-begin-static-library,<name>)
-# LOCAL_SRC_FILES := ....
-# LOCAL_C_INCLUDES += ....
-# $(call emugl-end-module)
-#
-emugl-begin-static-library = $(call emugl-begin-module,$1,STATIC_LIBRARY)
-emugl-begin-shared-library = $(call emugl-begin-module,$1,SHARED_LIBRARY)
-
-# Internal list of all declared modules (used for sanity checking)
-_emugl_modules :=
-_emugl_HOST_modules :=
-
-# do not use directly, see functions above instead
-emugl-begin-module = \
- $(eval include $(CLEAR_VARS)) \
- $(eval LOCAL_MODULE := $1) \
- $(eval LOCAL_MODULE_CLASS := $(patsubst HOST_%,%,$(patsubst %EXECUTABLE,%EXECUTABLES,$(patsubst %LIBRARY,%LIBRARIES,$2)))) \
- $(eval LOCAL_IS_HOST_MODULE := $(if $3,true,))\
- $(eval LOCAL_C_INCLUDES := $(EMUGL_COMMON_INCLUDES)) \
- $(eval LOCAL_CFLAGS := $(EMUGL_COMMON_CFLAGS)) \
- $(eval _EMUGL_INCLUDE_TYPE := $(BUILD_$2)) \
- $(call _emugl-init-module,$1,$2,$3)
-
-# Used to end a module definition, see function definitions above
-emugl-end-module = \
- $(eval include $(_EMUGL_INCLUDE_TYPE))\
- $(eval _EMUGL_INCLUDE_TYPE :=) \
- $(eval _emugl_$(_emugl_HOST)modules += $(_emugl_MODULE))\
- $(if $(EMUGL_DEBUG),$(call emugl-dump-module))
-
-# Managing module exports and imports.
-#
-# A module can 'import' another module, by calling emugl-import. This will
-# make the current LOCAL_MODULE inherit various definitions exported from
-# the imported module.
-#
-# Module exports are defined by calling emugl-export. Here is an example:
-#
-# $(call emugl-begin-static-library,foo)
-# LOCAL_SRC_FILES := foo.c
-# $(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
-# $(call emugl-export,SHARED_LIBRARIES,libcutils)
-# $(call emugl-end-module)
-#
-# $(call emugl-begin-shared-library,bar)
-# LOCAL_SRC_FILES := bar.cpp
-# $(call emugl-import,foo)
-# $(call emugl-end-module)
-#
-# Here, we define a static library named 'foo' which exports an include
-# path and a shared library requirement, and a shared library 'bar' which
-# imports it.
-#
-# What this means is that:
-#
-# - 'bar' will automatically inherit foo's LOCAL_PATH in its LOCAL_C_INCLUDES
-# - 'bar' will automatically inherit libcutils in its own LOCAL_SHARED_LIBRARIES
-#
-# Note that order of declaration matters. If 'foo' is defined after 'bar' in
-# the example above, nothing will work correctly because dependencies are
-# computed at import time.
-#
-#
-# IMPORTANT: Imports are transitive, i.e. when module A imports B,
-# it automatically imports anything imported by B too.
-
-# This is the list of recognized export types we support for now.
-EMUGL_EXPORT_TYPES := \
- CFLAGS \
- LDLIBS \
- LDFLAGS \
- C_INCLUDES \
- SHARED_LIBRARIES \
- STATIC_LIBRARIES \
- ADDITIONAL_DEPENDENCIES
-
-# Initialize a module in our database
-# $1: Module name
-# $2: Module type
-# $3: "HOST" for a host module, empty for a target one.
-_emugl-init-module = \
- $(eval _emugl_HOST := $(if $3,HOST_,))\
- $(eval _emugl_MODULE := $(_emugl_HOST)$1)\
- $(if $(filter $(_emugl_$(_emugl_HOST)modules),$(_emugl_MODULE)),\
- $(error There is already a $(if $3,host,) module named $1!)\
- )\
- $(eval _mod = $(_emugl_MODULE)) \
- $(eval _emugl.$(_mod).type := $(patsubst HOST_%,%,$2))\
- $(eval _emugl.$(_mod).imports :=) \
- $(eval _emugl,$(_mod).moved :=) \
- $(foreach _type,$(EMUGL_EXPORT_TYPES),\
- $(eval _emugl.$(_mod).export.$(_type) :=)\
- )
-
-# Called to indicate that a module exports a given local variable for its
-# users. This also adds this to LOCAL_$1
-# $1: Local variable type (e.g. CFLAGS, LDLIBS, etc...)
-# $2: Value(s) to append to the export
-emugl-export = \
- $(eval _emugl.$(_emugl_MODULE).export.$1 += $2)\
- $(eval LOCAL_$1 := $2 $(LOCAL_$1))
-
-emugl-export-outer = \
- $(eval _emugl.$(_emugl_MODULE).export.$1 += $2)
-
-# Called to indicate that a module imports the exports of another module
-# $1: list of modules to import
-#
-emugl-import = \
- $(foreach _imod,$1,\
- $(call _emugl-module-import,$(_emugl_HOST)$(_imod))\
- )
-
-_emugl-module-import = \
- $(eval _mod := $(_emugl_MODULE))\
- $(if $(filter-out $(_emugl_$(_emugl_HOST)modules),$1),\
- $(info Unknown imported emugles module: $1)\
- $(if $(_emugl_HOST),\
- $(eval _names := $(patsubst HOST_%,%,$(_emugl_HOST_modules))),\
- $(eval _names := $(_emugl_modules))\
- )\
- $(info Please one of the following names: $(_names))\
- $(error Aborting)\
- )\
- $(if $(filter-out $(_emugl.$(_mod).imports),$1),\
- $(eval _emugl.$(_mod).imports += $1)\
- $(foreach _sub,$(_emugl.$1.imports),\
- $(call _emugl-module-import,$(_sub))\
- )\
- $(foreach _type,$(EMUGL_EXPORT_TYPES),\
- $(eval LOCAL_$(_type) := $(_emugl.$1.export.$(_type)) $(LOCAL_$(_type)))\
- )\
- $(if $(filter EXECUTABLE SHARED_LIBRARY,$(_emugl.$(_emugl_MODULE).type)),\
- $(if $(filter STATIC_LIBRARY,$(_emugl.$1.type)),\
- $(eval LOCAL_STATIC_LIBRARIES := $(1:HOST_%=%) $(LOCAL_STATIC_LIBRARIES))\
- )\
- $(if $(filter SHARED_LIBRARY,$(_emugl.$1.type)),\
- $(if $(_emugl.$1.moved),,\
- $(eval LOCAL_SHARED_LIBRARIES := $(1:HOST_%=%) $(LOCAL_SHARED_LIBRARIES))\
- )\
- )\
- )\
- )
-
-_emugl-dump-list = \
- $(foreach _list_item,$(strip $1),$(info . $(_list_item)))
-
-emugl-dump-module = \
- $(info MODULE=$(_emugl_MODULE))\
- $(info . HOST=$(_emugl_HOST))\
- $(info . TYPE=$(_emugl.$(_emugl_MODULE).type))\
- $(info . IMPORTS=$(_emugl.$(_emugl_MODULE).imports))\
- $(foreach _type,$(EMUGL_EXPORT_TYPES),\
- $(if $(filter C_INCLUDES ADDITIONAL_DEPENDENCIES,$(_type)),\
- $(info . EXPORT.$(_type) :=)\
- $(call _emugl-dump-list,$(_emugl.$(_emugl_MODULE).export.$(_type)))\
- $(info . LOCAL_$(_type) :=)\
- $(call _emugl-dump-list,$(LOCAL_$(_type)))\
- ,\
- $(info . EXPORT.$(_type) := $(strip $(_emugl.$(_emugl_MODULE).export.$(_type))))\
- $(info . LOCAL_$(_type) := $(strip $(LOCAL_$(_type))))\
- )\
- )\
- $(info . LOCAL_SRC_FILES := $(LOCAL_SRC_FILES))\
-
-# This function can be called to generate the wrapper source files.
-# LOCAL_MODULE and LOCAL_MODULE_CLASS must be defined or the build will abort.
-# Source files will be stored in the local intermediates directory that will
-# be automatically added to your LOCAL_C_INCLUDES.
-# Usage:
-# $(call emugl-gen-wrapper,<input-dir>,<basename>)
-#
-emugl-gen-wrapper = \
- $(eval _emugl_out := $(call local-intermediates-dir)) \
- $(call emugl-gen-wrapper-generic,$(_emugl_out),$1,$2) \
- $(call emugl-export,C_INCLUDES,$(_emugl_out))
-
-# DO NOT CALL DIRECTLY, USE emugl-gen-wrapper instead.
-#
-# The following function can be called to generate GL library wrapper
-# Usage is:
-#
-# $(call emugl-gen-wrapper-generic,<dst-dir>,<src-dir>,<basename>)
-#
-# <dst-dir> is the destination directory where the generated sources are stored
-# <src-dir> is the source directory where to find <basename>.attrib, etc..
-# <basename> is the emugen basename (see host/tools/emugen/README)
-#
-emugl-gen-wrapper-generic = $(eval $(emugl-gen-wrapper-generic-ev))
-
-define emugl-gen-wrapper-generic-ev
-_emugl_wrap := $$1/$$3
-_emugl_src := $$2/$$3
-GEN := $$(_emugl_wrap)_wrapper_entry.cpp \
- $$(_emugl_wrap)_wrapper_context.cpp \
- $$(_emugl_wrap)_wrapper_context.h \
- $$(_emugl_wrap)_wrapper_proc.h
-
-$$(GEN): PRIVATE_PATH := $$(LOCAL_PATH)
-$$(GEN): PRIVATE_CUSTOM_TOOL := $$(EMUGL_EMUGEN) -W $$1 -i $$2 $$3
-$$(GEN): $$(EMUGL_EMUGEN) $$(_emugl_src).attrib $$(_emugl_src).in $$(_emugl_src).types
- $$(transform-generated-source)
-
-$$(call emugl-export,ADDITIONAL_DEPENDENCIES,$$(GEN))
-LOCAL_GENERATED_SOURCES += $$(GEN)
-LOCAL_C_INCLUDES += $$1
-
-#ifneq ($$(HOST_OS),windows)
-$$(call emugl-export,LDFLAGS,-ldl)
-#endif
-
-endef
-
-# Call this function when your shared library must be placed in a non-standard
-# library path (i.e. not under /system/lib
-# $1: library sub-path,relative to /system/lib
-# For example: $(call emugl-set-shared-library-subpath,egl)
-emugl-set-shared-library-subpath = \
- $(eval LOCAL_MODULE_RELATIVE_PATH := $1)\
- $(eval _emugl.$(LOCAL_MODULE).moved := true)
+++ /dev/null
-/*
-* Copyright (C) 2011 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 __IO_STREAM_H__
-#define __IO_STREAM_H__
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "ErrorLog.h"
-
-class IOStream {
-public:
-
- IOStream(size_t bufSize) {
- m_buf = NULL;
- m_bufsize = bufSize;
- m_free = 0;
- }
-
- virtual void *allocBuffer(size_t minSize) = 0;
- virtual int commitBuffer(size_t size) = 0;
- virtual const unsigned char *readFully( void *buf, size_t len) = 0;
- virtual const unsigned char *read( void *buf, size_t *inout_len) = 0;
- virtual int writeFully(const void* buf, size_t len) = 0;
-
- virtual ~IOStream() {
-
- // NOTE: m_buf is 'owned' by the child class thus we expect it to be released by it
- }
-
- unsigned char *alloc(size_t len) {
-
- if (m_buf && len > m_free) {
- if (flush() < 0) {
- ERR("Failed to flush in alloc\n");
- return NULL; // we failed to flush so something is wrong
- }
- }
-
- if (!m_buf || len > m_bufsize) {
- int allocLen = m_bufsize < len ? len : m_bufsize;
- m_buf = (unsigned char *)allocBuffer(allocLen);
- if (!m_buf) {
- ERR("Alloc (%u bytes) failed\n", allocLen);
- return NULL;
- }
- m_bufsize = m_free = allocLen;
- }
-
- unsigned char *ptr;
-
- ptr = m_buf + (m_bufsize - m_free);
- m_free -= len;
-
- return ptr;
- }
-
- int flush() {
-
- if (!m_buf || m_free == m_bufsize) return 0;
-
- int stat = commitBuffer(m_bufsize - m_free);
- m_buf = NULL;
- m_free = 0;
- return stat;
- }
-
- const unsigned char *readback(void *buf, size_t len) {
- flush();
- return readFully(buf, len);
- }
-
-
-private:
- unsigned char *m_buf;
- size_t m_bufsize;
- size_t m_free;
-};
-
-//
-// When a client opens a connection to the renderer, it should
-// send unsigned int value indicating the "clientFlags".
-// The following are the bitmask of the clientFlags.
-// currently only one bit is used which flags the server
-// it should exit.
-//
-#define IOSTREAM_CLIENT_EXIT_SERVER 1
-
-#endif
+++ /dev/null
-# This build script corresponds to a library containing many definitions
-# common to both the guest and the host. They relate to
-#
-LOCAL_PATH := $(call my-dir)
-
-commonSources := \
- GLClientState.cpp \
- ChecksumCalculator.cpp \
- GLSharedGroup.cpp \
- glUtils.cpp \
- SocketStream.cpp \
- TcpStream.cpp \
-
-### CodecCommon guest ##############################################
-$(call emugl-begin-static-library,libOpenglCodecCommon)
-
-LOCAL_SRC_FILES := $(commonSources)
-
-LOCAL_CFLAGS += -DLOG_TAG=\"eglCodecCommon\"
-
-$(call emugl-export,SHARED_LIBRARIES,libcutils libutils liblog)
-$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
-$(call emugl-end-module)
+++ /dev/null
-/*
-* Copyright (C) 2016 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 "ChecksumCalculator.h"
-
-#include <string>
-#include <vector>
-#include <string.h>
-
-// Checklist when implementing new protocol:
-// 1. update CHECKSUMHELPER_MAX_VERSION
-// 2. update maxChecksumSize()
-// 3. update checksumByteSize()
-// 4. update addBuffer, writeChecksum, resetChecksum, validate
-
-// change CHECKSUMHELPER_MAX_VERSION when you want to update the protocol version
-#define CHECKSUMHELPER_MAX_VERSION 1
-
-// checksum buffer size
-// Please add a new checksum buffer size when implementing a new protocol,
-// as well as modifying the maxChecksumSize function.
-static const size_t kV1ChecksumSize = 8;
-
-static constexpr size_t maxChecksumSize() {
- return 0 > kV1ChecksumSize ? 0 : kV1ChecksumSize;
-}
-
-static const size_t kMaxChecksumSize = maxChecksumSize();
-
-// utility macros to create checksum string at compilation time
-#define CHECKSUMHELPER_VERSION_STR_PREFIX "ANDROID_EMU_CHECKSUM_HELPER_v"
-#define CHECKSUMHELPER_MACRO_TO_STR(x) #x
-#define CHECKSUMHELPER_MACRO_VAL_TO_STR(x) CHECKSUMHELPER_MACRO_TO_STR(x)
-
-static const uint32_t kMaxVersion = CHECKSUMHELPER_MAX_VERSION;
-static const char* kMaxVersionStrPrefix = CHECKSUMHELPER_VERSION_STR_PREFIX;
-static const char* kMaxVersionStr = CHECKSUMHELPER_VERSION_STR_PREFIX CHECKSUMHELPER_MACRO_VAL_TO_STR(CHECKSUMHELPER_MAX_VERSION);
-
-#undef CHECKSUMHELPER_MAX_VERSION
-#undef CHECKSUMHELPER_VERSION_STR_PREFIX
-#undef CHECKSUMHELPER_MACRO_TO_STR
-#undef CHECKSUMHELPER_MACRO_VAL_TO_STR
-
-uint32_t ChecksumCalculator::getMaxVersion() {return kMaxVersion;}
-const char* ChecksumCalculator::getMaxVersionStr() {return kMaxVersionStr;}
-const char* ChecksumCalculator::getMaxVersionStrPrefix() {return kMaxVersionStrPrefix;}
-
-bool ChecksumCalculator::setVersion(uint32_t version) {
- if (version > kMaxVersion) { // unsupported version
- LOG_CHECKSUMHELPER("%s: ChecksumCalculator Set Unsupported version Version %d\n",
- __FUNCTION__, m_version);
- return false;
- }
- if (m_isEncodingChecksum) { // setVersion is called in the middle of encoding checksums
- LOG_CHECKSUMHELPER("%s: called between addBuffer and writeChecksum\n",
- __FUNCTION__);
- return false;
- }
- m_version = version;
- LOG_CHECKSUMHELPER("%s: ChecksumCalculator Set Version %d\n", __FUNCTION__,
- m_version);
- return true;
-}
-
-size_t ChecksumCalculator::checksumByteSize() const {
- switch (m_version) {
- case 0:
- return 0;
- case 1:
- return sizeof(uint32_t) + sizeof(m_numWrite);
- default:
- return 0;
- }
-}
-
-void ChecksumCalculator::addBuffer(const void* buf, size_t packetLen) {
- m_isEncodingChecksum = true;
- switch (m_version) {
- case 1:
- m_v1BufferTotalLength += packetLen;
- break;
- }
-}
-
-bool ChecksumCalculator::writeChecksum(void* outputChecksum, size_t outputChecksumLen) {
- if (outputChecksumLen < checksumByteSize()) return false;
- char *checksumPtr = (char *)outputChecksum;
- switch (m_version) {
- case 1: { // protocol v1 is to reverse the packetLen and write it at the end
- uint32_t val = computeV1Checksum();
- memcpy(checksumPtr, &val, sizeof(val));
- memcpy(checksumPtr+sizeof(val), &m_numWrite, sizeof(m_numWrite));
- break;
- }
- }
- resetChecksum();
- m_numWrite++;
- return true;
-}
-
-void ChecksumCalculator::resetChecksum() {
- switch (m_version) {
- case 1:
- m_v1BufferTotalLength = 0;
- break;
- }
- m_isEncodingChecksum = false;
-}
-
-bool ChecksumCalculator::validate(const void* expectedChecksum, size_t expectedChecksumLen) {
- size_t checksumSize = checksumByteSize();
- if (expectedChecksumLen != checksumSize) {
- m_numRead++;
- resetChecksum();
- return false;
- }
- // buffers for computing the checksum
- unsigned char sChecksumBuffer[kMaxChecksumSize];
- switch (m_version) {
- case 1: {
- uint32_t val = computeV1Checksum();
- memcpy(sChecksumBuffer, &val, sizeof(val));
- memcpy(sChecksumBuffer+sizeof(val), &m_numRead, sizeof(m_numRead));
- break;
- }
- }
- bool isValid = !memcmp(sChecksumBuffer, expectedChecksum, checksumSize);
- m_numRead++;
- resetChecksum();
- return isValid;
-}
-
-uint32_t ChecksumCalculator::computeV1Checksum() {
- uint32_t revLen = m_v1BufferTotalLength;
- revLen = (revLen & 0xffff0000) >> 16 | (revLen & 0x0000ffff) << 16;
- revLen = (revLen & 0xff00ff00) >> 8 | (revLen & 0x00ff00ff) << 8;
- revLen = (revLen & 0xf0f0f0f0) >> 4 | (revLen & 0x0f0f0f0f) << 4;
- revLen = (revLen & 0xcccccccc) >> 2 | (revLen & 0x33333333) << 2;
- revLen = (revLen & 0xaaaaaaaa) >> 1 | (revLen & 0x55555555) << 1;
- return revLen;
-}
+++ /dev/null
-/*
-* Copyright (C) 2016 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.
-*/
-
-#pragma once
-
-#include <stdint.h>
-#include <stdlib.h>
-
-// Set TRACE_CHECKSUMHELPER to 1 to debug creation/destruction of GLprotocol
-// instances.
-#define TRACE_CHECKSUMHELPER 0
-
-#if TRACE_CHECKSUMHELPER
-#define LOG_CHECKSUMHELPER(x...) fprintf(stderr, x)
-#else
-#define LOG_CHECKSUMHELPER(x...)
-#endif
-
-// ChecksumCalculator adds checksum as an array of bytes to GL pipe communication, which
-// size depends on the protocol version. Each pipe should use one ChecksumCalculator.
-// It can:
-// (1) take a list of buffers one by one and compute their checksum string,
-// in this case the checksum should be as the data in those buffers are
-// concatenated;
-// (2) compute the checksum of the buffer list, then either write them into
-// a buffer provided by user, or compare it against a checksum provided
-// by user
-// (3) support different checksum version in future.
-//
-// For backward compatibility, checksum version 0 behaves the same as there is
-// no checksum (i.e., checksumByteSize returns 0, validate always returns true,
-// addBuffer and writeCheckSum does nothing).
-//
-// Notice that to detect package lost, ChecksumCalculator also keeps track of how
-// many times it generates/validates checksums, and might use it as part of the
-// checksum.
-//
-// To evaluate checksums from a list of data buffers buf1, buf2... Please call
-// addBuffer(buf1, buf1len), addBuffer(buf2, buf2len) ... in order.
-// Then if the checksum needs to be encoded into a buffer, one needs to allocate
-// a checksum buffer with size checksumByteSize(), and call
-// writeChecksum(checksumBuffer) to write the checksum to the buffer.
-// If the checksum needs to be validated against an existing one, one needs to
-// call validate(existChecksum, existChecksumLen).
-//
-// The checksum generator and validator must be set to the same version, and
-// the validator must check ALL checksums in the order they are generated,
-// otherwise the validation function will return false.
-//
-// It is allowed to change the checksum version between calculating two
-// checksums. This is designed for backward compatibility reason.
-//
-// Example 1, encoding and decoding:
-//
-// bool testChecksum(void* buf, size_t bufLen) {
-// // encoding message
-// ChecksumCalculator encoder;
-// encoder.setVersion(1);
-// encoder.addBuffer(buf, bufLen);
-// std::vector<unsigned char> message(bufLen + encoder.checksumByteSize());
-// memcpy(&message[0], buf, bufLen);
-// encoder.writeChecksum(&message[0] + bufLen, encoder.checksumByteSize());
-//
-// // decoding message
-// ChecksumCalculator decoder;
-// decoder.setVersion(1);
-// decoder.addBuffer(&message[0], bufLen);
-// return decoder.validate(&message[0] + bufLen, decoder.checksumByteSize());
-// }
-// The return value is true.
-//
-// Example 2, decoding will fail if the order of messages is wrong:
-//
-// bool testChecksumOrder(void* buf1, size_t bufLen1,
-// void* buf2, size_t bufLen2) {
-// // encoding messages
-// ChecksumCalculator encoder;
-// encoder.setVersion(1);
-//
-// std::vector<unsigned char> message1(bufLen1 + encoder.checksumByteSize());
-// std::vector<unsigned char> message2(bufLen2 + encoder.checksumByteSize());
-//
-// encoder.addBuffer(buf1, bufLen1);
-// std::vector<unsigned char> message1(bufLen1 + encoder.checksumByteSize());
-// memcpy(&message1[0], buf1, bufLen1);
-// encoder.writeChecksum(&message1[0] + bufLen1, encoder.checksumByteSize());
-//
-// encoder.addBuffer(buf2, bufLen2);
-// std::vector<unsigned char> message2(bufLen2 + encoder.checksumByteSize());
-// memcpy(&message2[0], buf2, bufLen2);
-// encoder.writeChecksum(&message2[0] + bufLen2, encoder.checksumByteSize());
-//
-// // decoding messages
-// ChecksumCalculator decoder;
-// decoder.setVersion(1);
-// decoder.addBuffer(&message2[0], bufLen2);
-// // returns false because the decoding order is not consistent with
-// // encoding order
-// if (!decoder.validate(&message2[0]+bufLen2, decoder.checksumByteSize())) {
-// return false;
-// }
-//
-// decoder.addBuffer(&message1[0], bufLen1);
-// if (!decoder.validate(&message1[0]+bufLen1, decoder.checksumByteSize())) {
-// return false;
-// }
-//
-// return false;
-// }
-
-class ChecksumCalculator {
-public:
- // Get and set current checksum version
- uint32_t getVersion() const { return m_version; }
- // Call setVersion to set a checksum version. It should be called before
- // addBuffer(), writeChecksum() and validate(). And it should be called
- // exact once per rendering thread if both host and guest support checksum.
- // It won't be called if either host or guest does not support checksum.
- bool setVersion(uint32_t version);
-
- // Maximum supported checksum version
- static uint32_t getMaxVersion();
- // A version string that looks like "ANDROID_EMU_CHECKSUM_HELPER_v1"
- // Used multiple times when the guest queries the maximum supported version
- // from the host.
- // The library owns the returned pointer. The returned pointer will be
- // deconstructed when unloading library.
- static const char* getMaxVersionStr();
- static const char* getMaxVersionStrPrefix();
-
- // Size of checksum in the current version
- size_t checksumByteSize() const;
-
- // Update the current checksum value from the data
- // at |buf| of |bufLen| bytes. Once all buffers
- // have been added, call writeChecksum() to store
- // the final checksum value and reset its state.
- void addBuffer(const void* buf, size_t bufLen);
- // Write the checksum from the list of buffers to outputChecksum
- // Will reset the list of buffers by calling resetChecksum.
- // Return false if the buffer is not long enough
- // Please query buffer size from checksumByteSize()
- bool writeChecksum(void* outputChecksum, size_t outputChecksumLen);
- // Restore the states for computing checksums.
- // Automatically called at the end of writeChecksum and validate.
- // Can also be used to abandon the current checksum being calculated.
- // Notes: it doesn't update the internal read / write counter
- void resetChecksum();
-
- // Calculate the checksum from the list of buffers and
- // compare it with the checksum encoded in expectedChecksum
- // Will reset the list of buffers by calling resetChecksum.
- bool validate(const void* expectedChecksum, size_t expectedChecksumLen);
-protected:
- uint32_t m_version = 0;
- // A temporary state used to compute the total length of a list of buffers,
- // if addBuffer is called.
- uint32_t m_numRead = 0;
- uint32_t m_numWrite = 0;
- // m_isEncodingChecksum is true when between addBuffer and writeChecksum
- bool m_isEncodingChecksum = false;
-private:
- // Compute a 32bit checksum
- // Used in protocol v1
- uint32_t computeV1Checksum();
- // The buffer used in protocol version 1 to compute checksum.
- uint32_t m_v1BufferTotalLength = 0;
-};
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _ERROR_LOG_H_
-#define _ERROR_LOG_H_
-
-#if defined(__ANDROID__)
-# include <cutils/log.h>
-# define ERR(...) ALOGE(__VA_ARGS__)
-# ifdef EMUGL_DEBUG
-# define DBG(...) ALOGD(__VA_ARGS__)
-# else
-# define DBG(...) ((void)0)
-# endif
-#else
-# include <stdio.h>
-# define ERR(...) fprintf(stderr, __VA_ARGS__)
-# ifdef EMUGL_DEBUG
-# define DBG(...) fprintf(stderr, __VA_ARGS__)
-# else
-# define DBG(...) ((void)0)
-# endif
-#endif
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _FIXED_BUFFER_H
-#define _FIXED_BUFFER_H
-
-class FixedBuffer {
-public:
- FixedBuffer(size_t initialSize = 0) {
- m_buffer = NULL;
- m_bufferLen = initialSize;
- alloc(m_bufferLen);
- }
-
- ~FixedBuffer() {
- delete [] m_buffer;
- m_bufferLen = 0;
- }
-
- void * alloc(size_t size) {
- if (m_bufferLen >= size)
- return (void *)(m_buffer);
-
- if (m_buffer != NULL)
- delete[] m_buffer;
-
- m_bufferLen = size;
- m_buffer = new unsigned char[m_bufferLen];
- if (m_buffer == NULL)
- m_bufferLen = 0;
-
- return m_buffer;
- }
- void *ptr() { return m_buffer; }
- size_t len() { return m_bufferLen; }
-private:
- unsigned char *m_buffer;
- size_t m_bufferLen;
-};
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "GLClientState.h"
-#include "ErrorLog.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "glUtils.h"
-#include <cutils/log.h>
-
-#ifndef MAX
-#define MAX(a, b) ((a) < (b) ? (b) : (a))
-#endif
-
-GLClientState::GLClientState(int nLocations)
-{
- if (nLocations < LAST_LOCATION) {
- nLocations = LAST_LOCATION;
- }
- m_nLocations = nLocations;
- m_states = new VertexAttribState[m_nLocations];
- for (int i = 0; i < m_nLocations; i++) {
- m_states[i].enabled = 0;
- m_states[i].enableDirty = false;
- m_states[i].data = 0;
- }
- m_currentArrayVbo = 0;
- m_currentIndexVbo = 0;
- // init gl constans;
- m_states[VERTEX_LOCATION].glConst = GL_VERTEX_ARRAY;
- m_states[NORMAL_LOCATION].glConst = GL_NORMAL_ARRAY;
- m_states[COLOR_LOCATION].glConst = GL_COLOR_ARRAY;
- m_states[POINTSIZE_LOCATION].glConst = GL_POINT_SIZE_ARRAY_OES;
- m_states[TEXCOORD0_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
- m_states[TEXCOORD1_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
- m_states[TEXCOORD2_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
- m_states[TEXCOORD3_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
- m_states[TEXCOORD4_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
- m_states[TEXCOORD5_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
- m_states[TEXCOORD6_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
- m_states[TEXCOORD7_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
- m_states[MATRIXINDEX_LOCATION].glConst = GL_MATRIX_INDEX_ARRAY_OES;
- m_states[WEIGHT_LOCATION].glConst = GL_WEIGHT_ARRAY_OES;
- m_activeTexture = 0;
- m_currentProgram = 0;
-
- m_pixelStore.unpack_alignment = 4;
- m_pixelStore.pack_alignment = 4;
-
- memset(m_tex.unit, 0, sizeof(m_tex.unit));
- m_tex.activeUnit = &m_tex.unit[0];
- m_tex.textures = NULL;
- m_tex.numTextures = 0;
- m_tex.allocTextures = 0;
-
- m_maxVertexAttribsDirty = true;
-}
-
-GLClientState::~GLClientState()
-{
- delete m_states;
-}
-
-void GLClientState::enable(int location, int state)
-{
- if (!validLocation(location)) {
- return;
- }
-
- m_states[location].enableDirty |= (state != m_states[location].enabled);
- m_states[location].enabled = state;
-}
-
-void GLClientState::setState(int location, int size, GLenum type, GLboolean normalized, GLsizei stride, const void *data)
-{
- if (!validLocation(location)) {
- return;
- }
- m_states[location].size = size;
- m_states[location].type = type;
- m_states[location].stride = stride;
- m_states[location].data = (void*)data;
- m_states[location].bufferObject = m_currentArrayVbo;
- m_states[location].elementSize = size ? (glSizeof(type) * size) : 0;
- m_states[location].normalized = normalized;
-}
-
-void GLClientState::setBufferObject(int location, GLuint id)
-{
- if (!validLocation(location)) {
- return;
- }
-
- m_states[location].bufferObject = id;
-}
-
-const GLClientState::VertexAttribState * GLClientState::getState(int location)
-{
- if (!validLocation(location)) {
- return NULL;
- }
- return & m_states[location];
-}
-
-const GLClientState::VertexAttribState * GLClientState::getStateAndEnableDirty(int location, bool *enableChanged)
-{
- if (!validLocation(location)) {
- return NULL;
- }
-
- if (enableChanged) {
- *enableChanged = m_states[location].enableDirty;
- }
-
- m_states[location].enableDirty = false;
- return & m_states[location];
-}
-
-int GLClientState::getLocation(GLenum loc)
-{
- int retval;
-
- switch(loc) {
- case GL_VERTEX_ARRAY:
- retval = int(VERTEX_LOCATION);
- break;
- case GL_NORMAL_ARRAY:
- retval = int(NORMAL_LOCATION);
- break;
- case GL_COLOR_ARRAY:
- retval = int(COLOR_LOCATION);
- break;
- case GL_POINT_SIZE_ARRAY_OES:
- retval = int(POINTSIZE_LOCATION);
- break;
- case GL_TEXTURE_COORD_ARRAY:
- retval = int (TEXCOORD0_LOCATION + m_activeTexture);
- break;
- case GL_MATRIX_INDEX_ARRAY_OES:
- retval = int (MATRIXINDEX_LOCATION);
- break;
- case GL_WEIGHT_ARRAY_OES:
- retval = int (WEIGHT_LOCATION);
- break;
- default:
- retval = loc;
- }
- return retval;
-}
-
-void GLClientState::getClientStatePointer(GLenum pname, GLvoid** params)
-{
- const GLClientState::VertexAttribState *state = NULL;
- switch (pname) {
- case GL_VERTEX_ARRAY_POINTER: {
- state = getState(GLClientState::VERTEX_LOCATION);
- break;
- }
- case GL_NORMAL_ARRAY_POINTER: {
- state = getState(GLClientState::NORMAL_LOCATION);
- break;
- }
- case GL_COLOR_ARRAY_POINTER: {
- state = getState(GLClientState::COLOR_LOCATION);
- break;
- }
- case GL_TEXTURE_COORD_ARRAY_POINTER: {
- state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
- break;
- }
- case GL_POINT_SIZE_ARRAY_POINTER_OES: {
- state = getState(GLClientState::POINTSIZE_LOCATION);
- break;
- }
- case GL_MATRIX_INDEX_ARRAY_POINTER_OES: {
- state = getState(GLClientState::MATRIXINDEX_LOCATION);
- break;
- }
- case GL_WEIGHT_ARRAY_POINTER_OES: {
- state = getState(GLClientState::WEIGHT_LOCATION);
- break;
- }
- }
- if (state && params)
- *params = state->data;
-}
-
-int GLClientState::setPixelStore(GLenum param, GLint value)
-{
- int retval = 0;
- switch(param) {
- case GL_UNPACK_ALIGNMENT:
- if (value == 1 || value == 2 || value == 4 || value == 8) {
- m_pixelStore.unpack_alignment = value;
- } else {
- retval = GL_INVALID_VALUE;
- }
- break;
- case GL_PACK_ALIGNMENT:
- if (value == 1 || value == 2 || value == 4 || value == 8) {
- m_pixelStore.pack_alignment = value;
- } else {
- retval = GL_INVALID_VALUE;
- }
- break;
- default:
- retval = GL_INVALID_ENUM;
- }
- return retval;
-}
-
-
-
-
-size_t GLClientState::pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack) const
-{
- if (width <= 0 || height <= 0) return 0;
-
- int pixelsize = glUtilsPixelBitSize(format, type) >> 3;
-
- int alignment = pack ? m_pixelStore.pack_alignment : m_pixelStore.unpack_alignment;
-
- if (pixelsize == 0 ) {
- ERR("unknown pixel size: width: %d height: %d format: %d type: %d pack: %d align: %d\n",
- width, height, format, type, pack, alignment);
- }
- size_t linesize = pixelsize * width;
- size_t aligned_linesize = int(linesize / alignment) * alignment;
- if (aligned_linesize < linesize) {
- aligned_linesize += alignment;
- }
- return aligned_linesize * height;
-}
-
-GLenum GLClientState::setActiveTextureUnit(GLenum texture)
-{
- GLuint unit = texture - GL_TEXTURE0;
- if (unit >= MAX_TEXTURE_UNITS) {
- return GL_INVALID_ENUM;
- }
- m_tex.activeUnit = &m_tex.unit[unit];
- return GL_NO_ERROR;
-}
-
-GLenum GLClientState::getActiveTextureUnit() const
-{
- return GL_TEXTURE0 + (m_tex.activeUnit - &m_tex.unit[0]);
-}
-
-void GLClientState::enableTextureTarget(GLenum target)
-{
- switch (target) {
- case GL_TEXTURE_2D:
- m_tex.activeUnit->enables |= (1u << TEXTURE_2D);
- break;
- case GL_TEXTURE_EXTERNAL_OES:
- m_tex.activeUnit->enables |= (1u << TEXTURE_EXTERNAL);
- break;
- }
-}
-
-void GLClientState::disableTextureTarget(GLenum target)
-{
- switch (target) {
- case GL_TEXTURE_2D:
- m_tex.activeUnit->enables &= ~(1u << TEXTURE_2D);
- break;
- case GL_TEXTURE_EXTERNAL_OES:
- m_tex.activeUnit->enables &= ~(1u << TEXTURE_EXTERNAL);
- break;
- }
-}
-
-GLenum GLClientState::getPriorityEnabledTarget(GLenum allDisabled) const
-{
- unsigned int enables = m_tex.activeUnit->enables;
- if (enables & (1u << TEXTURE_EXTERNAL)) {
- return GL_TEXTURE_EXTERNAL_OES;
- } else if (enables & (1u << TEXTURE_2D)) {
- return GL_TEXTURE_2D;
- } else {
- return allDisabled;
- }
-}
-
-int GLClientState::compareTexId(const void* pid, const void* prec)
-{
- const GLuint* id = (const GLuint*)pid;
- const TextureRec* rec = (const TextureRec*)prec;
- return (GLint)(*id) - (GLint)rec->id;
-}
-
-GLenum GLClientState::bindTexture(GLenum target, GLuint texture,
- GLboolean* firstUse)
-{
- GLboolean first = GL_FALSE;
- TextureRec* texrec = NULL;
- if (texture != 0) {
- if (m_tex.textures) {
- texrec = (TextureRec*)bsearch(&texture, m_tex.textures,
- m_tex.numTextures, sizeof(TextureRec), compareTexId);
- }
- if (!texrec) {
- if (!(texrec = addTextureRec(texture, target))) {
- return GL_OUT_OF_MEMORY;
- }
- first = GL_TRUE;
- }
- if (target != texrec->target) {
- return GL_INVALID_OPERATION;
- }
- }
-
- switch (target) {
- case GL_TEXTURE_2D:
- m_tex.activeUnit->texture[TEXTURE_2D] = texture;
- break;
- case GL_TEXTURE_EXTERNAL_OES:
- m_tex.activeUnit->texture[TEXTURE_EXTERNAL] = texture;
- break;
- }
-
- if (firstUse) {
- *firstUse = first;
- }
-
- return GL_NO_ERROR;
-}
-
-GLClientState::TextureRec* GLClientState::addTextureRec(GLuint id,
- GLenum target)
-{
- if (m_tex.numTextures == m_tex.allocTextures) {
- const GLuint MAX_TEXTURES = 0xFFFFFFFFu;
-
- GLuint newAlloc;
- if (MAX_TEXTURES - m_tex.allocTextures >= m_tex.allocTextures) {
- newAlloc = MAX(4, 2 * m_tex.allocTextures);
- } else {
- if (m_tex.allocTextures == MAX_TEXTURES) {
- return NULL;
- }
- newAlloc = MAX_TEXTURES;
- }
-
- TextureRec* newTextures = (TextureRec*)realloc(m_tex.textures,
- newAlloc * sizeof(TextureRec));
- if (!newTextures) {
- return NULL;
- }
-
- m_tex.textures = newTextures;
- m_tex.allocTextures = newAlloc;
- }
-
- TextureRec* tex = m_tex.textures + m_tex.numTextures;
- TextureRec* prev = tex - 1;
- while (tex != m_tex.textures && id < prev->id) {
- *tex-- = *prev--;
- }
- tex->id = id;
- tex->target = target;
- m_tex.numTextures++;
-
- return tex;
-}
-
-GLuint GLClientState::getBoundTexture(GLenum target) const
-{
- switch (target) {
- case GL_TEXTURE_2D:
- return m_tex.activeUnit->texture[TEXTURE_2D];
- case GL_TEXTURE_EXTERNAL_OES:
- return m_tex.activeUnit->texture[TEXTURE_EXTERNAL];
- default:
- return 0;
- }
-}
-
-void GLClientState::deleteTextures(GLsizei n, const GLuint* textures)
-{
- // Updating the textures array could be made more efficient when deleting
- // several textures:
- // - compacting the array could be done in a single pass once the deleted
- // textures are marked, or
- // - could swap deleted textures to the end and re-sort.
- TextureRec* texrec;
- for (const GLuint* texture = textures; texture != textures + n; texture++) {
- texrec = (TextureRec*)bsearch(texture, m_tex.textures,
- m_tex.numTextures, sizeof(TextureRec), compareTexId);
- if (texrec) {
- const TextureRec* end = m_tex.textures + m_tex.numTextures;
- memmove(texrec, texrec + 1,
- (end - texrec - 1) * sizeof(TextureRec));
- m_tex.numTextures--;
-
- for (TextureUnit* unit = m_tex.unit;
- unit != m_tex.unit + MAX_TEXTURE_UNITS;
- unit++)
- {
- if (unit->texture[TEXTURE_2D] == *texture) {
- unit->texture[TEXTURE_2D] = 0;
- } else if (unit->texture[TEXTURE_EXTERNAL] == *texture) {
- unit->texture[TEXTURE_EXTERNAL] = 0;
- }
- }
- }
- }
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _GL_CLIENT_STATE_H_
-#define _GL_CLIENT_STATE_H_
-
-#define GL_API
-#ifndef ANDROID
-#define GL_APIENTRY
-#define GL_APIENTRYP
-#endif
-
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "ErrorLog.h"
-#include "codec_defs.h"
-
-class GLClientState {
-public:
- typedef enum {
- VERTEX_LOCATION = 0,
- NORMAL_LOCATION = 1,
- COLOR_LOCATION = 2,
- POINTSIZE_LOCATION = 3,
- TEXCOORD0_LOCATION = 4,
- TEXCOORD1_LOCATION = 5,
- TEXCOORD2_LOCATION = 6,
- TEXCOORD3_LOCATION = 7,
- TEXCOORD4_LOCATION = 8,
- TEXCOORD5_LOCATION = 9,
- TEXCOORD6_LOCATION = 10,
- TEXCOORD7_LOCATION = 11,
- MATRIXINDEX_LOCATION = 12,
- WEIGHT_LOCATION = 13,
- LAST_LOCATION = 14
- } StateLocation;
-
- typedef struct {
- GLint enabled;
- GLint size;
- GLenum type;
- GLsizei stride;
- void *data;
- GLuint bufferObject;
- GLenum glConst;
- unsigned int elementSize;
- bool enableDirty; // true if any enable state has changed since last draw
- bool normalized;
- } VertexAttribState;
-
- typedef struct {
- int unpack_alignment;
- int pack_alignment;
- } PixelStoreState;
-
- enum {
- MAX_TEXTURE_UNITS = 32,
- };
-
-public:
- GLClientState(int nLocations = CODEC_MAX_VERTEX_ATTRIBUTES);
- ~GLClientState();
- int nLocations() { return m_nLocations; }
- const PixelStoreState *pixelStoreState() { return &m_pixelStore; }
- int setPixelStore(GLenum param, GLint value);
- GLuint currentArrayVbo() { return m_currentArrayVbo; }
- GLuint currentIndexVbo() { return m_currentIndexVbo; }
- void enable(int location, int state);
- void setState(int location, int size, GLenum type, GLboolean normalized, GLsizei stride, const void *data);
- void setBufferObject(int location, GLuint id);
- const VertexAttribState *getState(int location);
- const VertexAttribState *getStateAndEnableDirty(int location, bool *enableChanged);
- int getLocation(GLenum loc);
- void setActiveTexture(int texUnit) {m_activeTexture = texUnit; };
- int getActiveTexture() const { return m_activeTexture; }
- void setMaxVertexAttribs(int val) {
- m_maxVertexAttribs = val;
- m_maxVertexAttribsDirty = false;
- }
-
- void unBindBuffer(GLuint id)
- {
- if (m_currentArrayVbo == id) m_currentArrayVbo = 0;
- else if (m_currentIndexVbo == id) m_currentIndexVbo = 0;
- }
-
- int bindBuffer(GLenum target, GLuint id)
- {
- int err = 0;
- switch(target) {
- case GL_ARRAY_BUFFER:
- m_currentArrayVbo = id;
- break;
- case GL_ELEMENT_ARRAY_BUFFER:
- m_currentIndexVbo = id;
- break;
- default:
- err = -1;
- }
- return err;
- }
-
- int getBuffer(GLenum target)
- {
- int ret=0;
- switch (target) {
- case GL_ARRAY_BUFFER:
- ret = m_currentArrayVbo;
- break;
- case GL_ELEMENT_ARRAY_BUFFER:
- ret = m_currentIndexVbo;
- break;
- default:
- ret = -1;
- }
- return ret;
- }
- size_t pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack) const;
-
- void setCurrentProgram(GLint program) { m_currentProgram = program; }
- GLint currentProgram() const { return m_currentProgram; }
-
- /* OES_EGL_image_external
- *
- * These functions manipulate GL state which interacts with the
- * OES_EGL_image_external extension, to support client-side emulation on
- * top of host implementations that don't have it.
- *
- * Most of these calls should only be used with TEXTURE_2D or
- * TEXTURE_EXTERNAL_OES texture targets; TEXTURE_CUBE_MAP or other extension
- * targets should bypass this. An exception is bindTexture(), which should
- * see all glBindTexture() calls for any target.
- */
-
- // glActiveTexture(GL_TEXTURE0 + i)
- // Sets the active texture unit. Up to MAX_TEXTURE_UNITS are supported.
- GLenum setActiveTextureUnit(GLenum texture);
- GLenum getActiveTextureUnit() const;
-
- // glEnable(GL_TEXTURE_(2D|EXTERNAL_OES))
- void enableTextureTarget(GLenum target);
-
- // glDisable(GL_TEXTURE_(2D|EXTERNAL_OES))
- void disableTextureTarget(GLenum target);
-
- // Implements the target priority logic:
- // * Return GL_TEXTURE_EXTERNAL_OES if enabled, else
- // * Return GL_TEXTURE_2D if enabled, else
- // * Return the allDisabled value.
- // For some cases passing GL_TEXTURE_2D for allDisabled makes callee code
- // simpler; for other cases passing a recognizable enum like GL_ZERO or
- // GL_INVALID_ENUM is appropriate.
- GLenum getPriorityEnabledTarget(GLenum allDisabled) const;
-
- // glBindTexture(GL_TEXTURE_*, ...)
- // Set the target binding of the active texture unit to texture. Returns
- // GL_NO_ERROR on success or GL_INVALID_OPERATION if the texture has
- // previously been bound to a different target. If firstUse is not NULL,
- // it is set to indicate whether this is the first use of the texture.
- // For accurate error detection, bindTexture should be called for *all*
- // targets, not just 2D and EXTERNAL_OES.
- GLenum bindTexture(GLenum target, GLuint texture, GLboolean* firstUse);
-
- // Return the texture currently bound to GL_TEXTURE_(2D|EXTERNAL_OES).
- GLuint getBoundTexture(GLenum target) const;
-
- // glDeleteTextures(...)
- // Remove references to the to-be-deleted textures.
- void deleteTextures(GLsizei n, const GLuint* textures);
-
-private:
- PixelStoreState m_pixelStore;
- VertexAttribState *m_states;
- int m_maxVertexAttribs;
- bool m_maxVertexAttribsDirty;
- int m_nLocations;
- GLuint m_currentArrayVbo;
- GLuint m_currentIndexVbo;
- int m_activeTexture;
- GLint m_currentProgram;
-
- bool validLocation(int location) { return (location >= 0 && location < m_nLocations); }
-
- enum TextureTarget {
- TEXTURE_2D = 0,
- TEXTURE_EXTERNAL = 1,
- TEXTURE_TARGET_COUNT
- };
- struct TextureUnit {
- unsigned int enables;
- GLuint texture[TEXTURE_TARGET_COUNT];
- };
- struct TextureRec {
- GLuint id;
- GLenum target;
- };
- struct TextureState {
- TextureUnit unit[MAX_TEXTURE_UNITS];
- TextureUnit* activeUnit;
- TextureRec* textures;
- GLuint numTextures;
- GLuint allocTextures;
- };
- TextureState m_tex;
-
- static int compareTexId(const void* pid, const void* prec);
- TextureRec* addTextureRec(GLuint id, GLenum target);
-
-public:
- void getClientStatePointer(GLenum pname, GLvoid** params);
-
- template <class T>
- int getVertexAttribParameter(GLuint index, GLenum param, T *ptr)
- {
- bool handled = true;
- const VertexAttribState *vertexAttrib = getState(index);
- if (vertexAttrib == NULL) {
- ERR("getVeterxAttriParameter for non existant index %d\n", index);
- // set gl error;
- return handled;
- }
-
- switch(param) {
- case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
- *ptr = (T)(vertexAttrib->bufferObject);
- break;
- case GL_VERTEX_ATTRIB_ARRAY_ENABLED:
- *ptr = (T)(vertexAttrib->enabled);
- break;
- case GL_VERTEX_ATTRIB_ARRAY_SIZE:
- *ptr = (T)(vertexAttrib->size);
- break;
- case GL_VERTEX_ATTRIB_ARRAY_STRIDE:
- *ptr = (T)(vertexAttrib->stride);
- break;
- case GL_VERTEX_ATTRIB_ARRAY_TYPE:
- *ptr = (T)(vertexAttrib->type);
- break;
- case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:
- *ptr = (T)(vertexAttrib->normalized);
- break;
- case GL_CURRENT_VERTEX_ATTRIB:
- handled = false;
- break;
- default:
- handled = false;
- ERR("unknown vertex-attrib parameter param %d\n", param);
- }
- return handled;
- }
-
- template <class T>
- bool getClientStateParameter(GLenum param, T* ptr)
- {
- bool isClientStateParam = false;
- switch (param) {
- case GL_CLIENT_ACTIVE_TEXTURE: {
- GLint tex = getActiveTexture() + GL_TEXTURE0;
- *ptr = tex;
- isClientStateParam = true;
- break;
- }
- case GL_VERTEX_ARRAY_SIZE: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::VERTEX_LOCATION);
- *ptr = state->size;
- isClientStateParam = true;
- break;
- }
- case GL_VERTEX_ARRAY_TYPE: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::VERTEX_LOCATION);
- *ptr = state->type;
- isClientStateParam = true;
- break;
- }
- case GL_VERTEX_ARRAY_STRIDE: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::VERTEX_LOCATION);
- *ptr = state->stride;
- isClientStateParam = true;
- break;
- }
- case GL_COLOR_ARRAY_SIZE: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::COLOR_LOCATION);
- *ptr = state->size;
- isClientStateParam = true;
- break;
- }
- case GL_COLOR_ARRAY_TYPE: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::COLOR_LOCATION);
- *ptr = state->type;
- isClientStateParam = true;
- break;
- }
- case GL_COLOR_ARRAY_STRIDE: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::COLOR_LOCATION);
- *ptr = state->stride;
- isClientStateParam = true;
- break;
- }
- case GL_NORMAL_ARRAY_TYPE: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::NORMAL_LOCATION);
- *ptr = state->type;
- isClientStateParam = true;
- break;
- }
- case GL_NORMAL_ARRAY_STRIDE: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::NORMAL_LOCATION);
- *ptr = state->stride;
- isClientStateParam = true;
- break;
- }
- case GL_TEXTURE_COORD_ARRAY_SIZE: {
- const GLClientState::VertexAttribState *state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
- *ptr = state->size;
- isClientStateParam = true;
- break;
- }
- case GL_TEXTURE_COORD_ARRAY_TYPE: {
- const GLClientState::VertexAttribState *state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
- *ptr = state->type;
- isClientStateParam = true;
- break;
- }
- case GL_TEXTURE_COORD_ARRAY_STRIDE: {
- const GLClientState::VertexAttribState *state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
- *ptr = state->stride;
- isClientStateParam = true;
- break;
- }
- case GL_POINT_SIZE_ARRAY_TYPE_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::POINTSIZE_LOCATION);
- *ptr = state->type;
- isClientStateParam = true;
- break;
- }
- case GL_POINT_SIZE_ARRAY_STRIDE_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::POINTSIZE_LOCATION);
- *ptr = state->stride;
- isClientStateParam = true;
- break;
- }
- case GL_MATRIX_INDEX_ARRAY_SIZE_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::MATRIXINDEX_LOCATION);
- *ptr = state->size;
- isClientStateParam = true;
- break;
- }
- case GL_MATRIX_INDEX_ARRAY_TYPE_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::MATRIXINDEX_LOCATION);
- *ptr = state->type;
- isClientStateParam = true;
- break;
- }
- case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::MATRIXINDEX_LOCATION);
- *ptr = state->stride;
- isClientStateParam = true;
- break;
- }
- case GL_WEIGHT_ARRAY_SIZE_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::WEIGHT_LOCATION);
- *ptr = state->size;
- isClientStateParam = true;
- break;
- }
- case GL_WEIGHT_ARRAY_TYPE_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::WEIGHT_LOCATION);
- *ptr = state->type;
- isClientStateParam = true;
- break;
- }
- case GL_WEIGHT_ARRAY_STRIDE_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::WEIGHT_LOCATION);
- *ptr = state->stride;
- isClientStateParam = true;
- break;
- }
- case GL_VERTEX_ARRAY_BUFFER_BINDING: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::VERTEX_LOCATION);
- *ptr = state->bufferObject;
- isClientStateParam = true;
- break;
- }
- case GL_NORMAL_ARRAY_BUFFER_BINDING: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::NORMAL_LOCATION);
- *ptr = state->bufferObject;
- isClientStateParam = true;
- break;
- }
- case GL_COLOR_ARRAY_BUFFER_BINDING: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::COLOR_LOCATION);
- *ptr = state->bufferObject;
- isClientStateParam = true;
- break;
- }
- case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: {
- const GLClientState::VertexAttribState *state = getState(getActiveTexture()+GLClientState::TEXCOORD0_LOCATION);
- *ptr = state->bufferObject;
- isClientStateParam = true;
- break;
- }
- case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::POINTSIZE_LOCATION);
- *ptr = state->bufferObject;
- isClientStateParam = true;
- break;
- }
- case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::MATRIXINDEX_LOCATION);
- *ptr = state->bufferObject;
- isClientStateParam = true;
- break;
- }
- case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: {
- const GLClientState::VertexAttribState *state = getState(GLClientState::WEIGHT_LOCATION);
- *ptr = state->bufferObject;
- isClientStateParam = true;
- break;
- }
- case GL_ARRAY_BUFFER_BINDING: {
- int buffer = getBuffer(GL_ARRAY_BUFFER);
- *ptr = buffer;
- isClientStateParam = true;
- break;
- }
- case GL_ELEMENT_ARRAY_BUFFER_BINDING: {
- int buffer = getBuffer(GL_ELEMENT_ARRAY_BUFFER);
- *ptr = buffer;
- isClientStateParam = true;
- break;
- }
- case GL_MAX_VERTEX_ATTRIBS: {
- if (m_maxVertexAttribsDirty) {
- isClientStateParam = false;
- } else {
- *ptr = m_maxVertexAttribs;
- isClientStateParam = true;
- }
- break;
- }
- }
- return isClientStateParam;
- }
-
-};
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "GLSharedGroup.h"
-
-/**** KeyedVector utilities ****/
-
-template <typename T>
-static void clearObjectMap(android::DefaultKeyedVector<GLuint, T>& v) {
- for (size_t i = 0; i < v.size(); i++)
- delete v.valueAt(i);
- v.clear();
-}
-
-/**** BufferData ****/
-
-BufferData::BufferData() : m_size(0) {};
-BufferData::BufferData(GLsizeiptr size, void * data) : m_size(size)
-{
- void * buffer = NULL;
- if (size>0) buffer = m_fixedBuffer.alloc(size);
- if (data) memcpy(buffer, data, size);
-}
-
-/**** ProgramData ****/
-ProgramData::ProgramData() : m_numIndexes(0),
- m_initialized(false),
- m_locShiftWAR(false)
-{
- m_Indexes = NULL;
-}
-
-void ProgramData::initProgramData(GLuint numIndexes)
-{
- m_initialized = true;
- m_numIndexes = numIndexes;
- delete[] m_Indexes;
- m_Indexes = new IndexInfo[numIndexes];
- m_locShiftWAR = false;
-}
-
-bool ProgramData::isInitialized()
-{
- return m_initialized;
-}
-
-ProgramData::~ProgramData()
-{
- delete[] m_Indexes;
- m_Indexes = NULL;
-}
-
-void ProgramData::setIndexInfo(GLuint index, GLint base, GLint size, GLenum type)
-{
- if (index>=m_numIndexes)
- return;
- m_Indexes[index].base = base;
- m_Indexes[index].size = size;
- m_Indexes[index].type = type;
- if (index > 0) {
- m_Indexes[index].appBase = m_Indexes[index-1].appBase +
- m_Indexes[index-1].size;
- }
- else {
- m_Indexes[index].appBase = 0;
- }
- m_Indexes[index].hostLocsPerElement = 1;
- m_Indexes[index].flags = 0;
- m_Indexes[index].samplerValue = 0;
-}
-
-void ProgramData::setIndexFlags(GLuint index, GLuint flags)
-{
- if (index >= m_numIndexes)
- return;
- m_Indexes[index].flags |= flags;
-}
-
-GLuint ProgramData::getIndexForLocation(GLint location)
-{
- GLuint index = m_numIndexes;
- GLint minDist = -1;
- for (GLuint i=0;i<m_numIndexes;++i)
- {
- GLint dist = location - m_Indexes[i].base;
- if (dist >= 0 &&
- (minDist < 0 || dist < minDist)) {
- index = i;
- minDist = dist;
- }
- }
- return index;
-}
-
-GLenum ProgramData::getTypeForLocation(GLint location)
-{
- GLuint index = getIndexForLocation(location);
- if (index<m_numIndexes) {
- return m_Indexes[index].type;
- }
- return 0;
-}
-
-void ProgramData::setupLocationShiftWAR()
-{
- m_locShiftWAR = false;
- for (GLuint i=0; i<m_numIndexes; i++) {
- if (0 != (m_Indexes[i].base & 0xffff)) {
- return;
- }
- }
- // if we have one uniform at location 0, we do not need the WAR.
- if (m_numIndexes > 1) {
- m_locShiftWAR = true;
- }
-}
-
-GLint ProgramData::locationWARHostToApp(GLint hostLoc, GLint arrIndex)
-{
- if (!m_locShiftWAR) return hostLoc;
-
- GLuint index = getIndexForLocation(hostLoc);
- if (index<m_numIndexes) {
- if (arrIndex > 0) {
- m_Indexes[index].hostLocsPerElement =
- (hostLoc - m_Indexes[index].base) / arrIndex;
- }
- return m_Indexes[index].appBase + arrIndex;
- }
- return -1;
-}
-
-GLint ProgramData::locationWARAppToHost(GLint appLoc)
-{
- if (!m_locShiftWAR) return appLoc;
-
- for(GLuint i=0; i<m_numIndexes; i++) {
- GLint elemIndex = appLoc - m_Indexes[i].appBase;
- if (elemIndex >= 0 && elemIndex < m_Indexes[i].size) {
- return m_Indexes[i].base +
- elemIndex * m_Indexes[i].hostLocsPerElement;
- }
- }
- return -1;
-}
-
-GLint ProgramData::getNextSamplerUniform(GLint index, GLint* val, GLenum* target)
-{
- for (GLint i = index + 1; i >= 0 && i < (GLint)m_numIndexes; i++) {
- if (m_Indexes[i].type == GL_SAMPLER_2D) {
- if (val) *val = m_Indexes[i].samplerValue;
- if (target) {
- if (m_Indexes[i].flags & INDEX_FLAG_SAMPLER_EXTERNAL) {
- *target = GL_TEXTURE_EXTERNAL_OES;
- } else {
- *target = GL_TEXTURE_2D;
- }
- }
- return i;
- }
- }
- return -1;
-}
-
-bool ProgramData::setSamplerUniform(GLint appLoc, GLint val, GLenum* target)
-{
- for (GLuint i = 0; i < m_numIndexes; i++) {
- GLint elemIndex = appLoc - m_Indexes[i].appBase;
- if (elemIndex >= 0 && elemIndex < m_Indexes[i].size) {
- if (m_Indexes[i].type == GL_TEXTURE_2D) {
- m_Indexes[i].samplerValue = val;
- if (target) {
- if (m_Indexes[i].flags & INDEX_FLAG_SAMPLER_EXTERNAL) {
- *target = GL_TEXTURE_EXTERNAL_OES;
- } else {
- *target = GL_TEXTURE_2D;
- }
- }
- return true;
- }
- }
- }
- return false;
-}
-
-bool ProgramData::attachShader(GLuint shader)
-{
- size_t n = m_shaders.size();
- for (size_t i = 0; i < n; i++) {
- if (m_shaders[i] == shader) {
- return false;
- }
- }
- // AKA m_shaders.push_back(), but that has an ambiguous call to insertAt()
- // due to the default parameters. This is the desired insertAt() overload.
- m_shaders.insertAt(shader, m_shaders.size(), 1);
- return true;
-}
-
-bool ProgramData::detachShader(GLuint shader)
-{
- size_t n = m_shaders.size();
- for (size_t i = 0; i < n; i++) {
- if (m_shaders[i] == shader) {
- m_shaders.removeAt(i);
- return true;
- }
- }
- return false;
-}
-
-/***** GLSharedGroup ****/
-
-GLSharedGroup::GLSharedGroup() :
- m_buffers(android::DefaultKeyedVector<GLuint, BufferData*>(NULL)),
- m_programs(android::DefaultKeyedVector<GLuint, ProgramData*>(NULL)),
- m_shaders(android::DefaultKeyedVector<GLuint, ShaderData*>(NULL))
-{
-}
-
-GLSharedGroup::~GLSharedGroup()
-{
- m_buffers.clear();
- m_programs.clear();
- clearObjectMap(m_buffers);
- clearObjectMap(m_programs);
- clearObjectMap(m_shaders);
-}
-
-bool GLSharedGroup::isObject(GLuint obj)
-{
- android::AutoMutex _lock(m_lock);
- return ((m_shaders.valueFor(obj)!=NULL) || (m_programs.valueFor(obj)!=NULL));
-}
-
-BufferData * GLSharedGroup::getBufferData(GLuint bufferId)
-{
- android::AutoMutex _lock(m_lock);
- return m_buffers.valueFor(bufferId);
-}
-
-void GLSharedGroup::addBufferData(GLuint bufferId, GLsizeiptr size, void * data)
-{
- android::AutoMutex _lock(m_lock);
- m_buffers.add(bufferId, new BufferData(size, data));
-}
-
-void GLSharedGroup::updateBufferData(GLuint bufferId, GLsizeiptr size, void * data)
-{
- android::AutoMutex _lock(m_lock);
- ssize_t idx = m_buffers.indexOfKey(bufferId);
- if (idx >= 0) {
- delete m_buffers.valueAt(idx);
- m_buffers.editValueAt(idx) = new BufferData(size, data);
- } else {
- m_buffers.add(bufferId, new BufferData(size, data));
- }
-}
-
-GLenum GLSharedGroup::subUpdateBufferData(GLuint bufferId, GLintptr offset, GLsizeiptr size, void * data)
-{
- android::AutoMutex _lock(m_lock);
- BufferData * buf = m_buffers.valueFor(bufferId);
- if ((!buf) || (buf->m_size < offset+size) || (offset < 0) || (size<0)) return GL_INVALID_VALUE;
-
- //it's safe to update now
- memcpy((char*)buf->m_fixedBuffer.ptr() + offset, data, size);
- return GL_NO_ERROR;
-}
-
-void GLSharedGroup::deleteBufferData(GLuint bufferId)
-{
- android::AutoMutex _lock(m_lock);
- ssize_t idx = m_buffers.indexOfKey(bufferId);
- if (idx >= 0) {
- delete m_buffers.valueAt(idx);
- m_buffers.removeItemsAt(idx);
- }
-}
-
-void GLSharedGroup::addProgramData(GLuint program)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData *pData = m_programs.valueFor(program);
- if (pData)
- {
- m_programs.removeItem(program);
- delete pData;
- }
-
- m_programs.add(program,new ProgramData());
-}
-
-void GLSharedGroup::initProgramData(GLuint program, GLuint numIndexes)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData *pData = m_programs.valueFor(program);
- if (pData)
- {
- pData->initProgramData(numIndexes);
- }
-}
-
-bool GLSharedGroup::isProgramInitialized(GLuint program)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* pData = m_programs.valueFor(program);
- if (pData)
- {
- return pData->isInitialized();
- }
- return false;
-}
-
-void GLSharedGroup::deleteProgramData(GLuint program)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData *pData = m_programs.valueFor(program);
- if (pData)
- delete pData;
- m_programs.removeItem(program);
-}
-
-void GLSharedGroup::attachShader(GLuint program, GLuint shader)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* programData = m_programs.valueFor(program);
- ssize_t idx = m_shaders.indexOfKey(shader);
- if (programData && idx >= 0) {
- if (programData->attachShader(shader)) {
- refShaderDataLocked(idx);
- }
- }
-}
-
-void GLSharedGroup::detachShader(GLuint program, GLuint shader)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* programData = m_programs.valueFor(program);
- ssize_t idx = m_shaders.indexOfKey(shader);
- if (programData && idx >= 0) {
- if (programData->detachShader(shader)) {
- unrefShaderDataLocked(idx);
- }
- }
-}
-
-void GLSharedGroup::setProgramIndexInfo(GLuint program, GLuint index, GLint base, GLint size, GLenum type, const char* name)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* pData = m_programs.valueFor(program);
- if (pData)
- {
- pData->setIndexInfo(index,base,size,type);
-
- if (type == GL_SAMPLER_2D) {
- size_t n = pData->getNumShaders();
- for (size_t i = 0; i < n; i++) {
- GLuint shaderId = pData->getShader(i);
- ShaderData* shader = m_shaders.valueFor(shaderId);
- if (!shader) continue;
- ShaderData::StringList::iterator nameIter = shader->samplerExternalNames.begin();
- ShaderData::StringList::iterator nameEnd = shader->samplerExternalNames.end();
- while (nameIter != nameEnd) {
- if (*nameIter == name) {
- pData->setIndexFlags(index, ProgramData::INDEX_FLAG_SAMPLER_EXTERNAL);
- break;
- }
- ++nameIter;
- }
- }
- }
- }
-}
-
-GLenum GLSharedGroup::getProgramUniformType(GLuint program, GLint location)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* pData = m_programs.valueFor(program);
- GLenum type=0;
- if (pData)
- {
- type = pData->getTypeForLocation(location);
- }
- return type;
-}
-
-bool GLSharedGroup::isProgram(GLuint program)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* pData = m_programs.valueFor(program);
- return (pData!=NULL);
-}
-
-void GLSharedGroup::setupLocationShiftWAR(GLuint program)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* pData = m_programs.valueFor(program);
- if (pData) pData->setupLocationShiftWAR();
-}
-
-GLint GLSharedGroup::locationWARHostToApp(GLuint program, GLint hostLoc, GLint arrIndex)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* pData = m_programs.valueFor(program);
- if (pData) return pData->locationWARHostToApp(hostLoc, arrIndex);
- else return hostLoc;
-}
-
-GLint GLSharedGroup::locationWARAppToHost(GLuint program, GLint appLoc)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* pData = m_programs.valueFor(program);
- if (pData) return pData->locationWARAppToHost(appLoc);
- else return appLoc;
-}
-
-bool GLSharedGroup::needUniformLocationWAR(GLuint program)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* pData = m_programs.valueFor(program);
- if (pData) return pData->needUniformLocationWAR();
- return false;
-}
-
-GLint GLSharedGroup::getNextSamplerUniform(GLuint program, GLint index, GLint* val, GLenum* target) const
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* pData = m_programs.valueFor(program);
- return pData ? pData->getNextSamplerUniform(index, val, target) : -1;
-}
-
-bool GLSharedGroup::setSamplerUniform(GLuint program, GLint appLoc, GLint val, GLenum* target)
-{
- android::AutoMutex _lock(m_lock);
- ProgramData* pData = m_programs.valueFor(program);
- return pData ? pData->setSamplerUniform(appLoc, val, target) : false;
-}
-
-bool GLSharedGroup::addShaderData(GLuint shader)
-{
- android::AutoMutex _lock(m_lock);
- ShaderData* data = new ShaderData;
- if (data) {
- if (m_shaders.add(shader, data) < 0) {
- delete data;
- data = NULL;
- }
- data->refcount = 1;
- }
- return data != NULL;
-}
-
-ShaderData* GLSharedGroup::getShaderData(GLuint shader)
-{
- android::AutoMutex _lock(m_lock);
- return m_shaders.valueFor(shader);
-}
-
-void GLSharedGroup::unrefShaderData(GLuint shader)
-{
- android::AutoMutex _lock(m_lock);
- ssize_t idx = m_shaders.indexOfKey(shader);
- if (idx >= 0) {
- unrefShaderDataLocked(idx);
- }
-}
-
-void GLSharedGroup::refShaderDataLocked(ssize_t shaderIdx)
-{
- assert(shaderIdx >= 0 && shaderIdx <= m_shaders.size());
- ShaderData* data = m_shaders.valueAt(shaderIdx);
- data->refcount++;
-}
-
-void GLSharedGroup::unrefShaderDataLocked(ssize_t shaderIdx)
-{
- assert(shaderIdx >= 0 && shaderIdx <= m_shaders.size());
- ShaderData* data = m_shaders.valueAt(shaderIdx);
- if (--data->refcount == 0) {
- delete data;
- m_shaders.removeItemsAt(shaderIdx);
- }
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _GL_SHARED_GROUP_H_
-#define _GL_SHARED_GROUP_H_
-
-#define GL_API
-#ifndef ANDROID
-#define GL_APIENTRY
-#define GL_APIENTRYP
-#endif
-
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "ErrorLog.h"
-#include <utils/KeyedVector.h>
-#include <utils/List.h>
-#include <utils/String8.h>
-#include <utils/threads.h>
-#include "FixedBuffer.h"
-#include "SmartPtr.h"
-
-struct BufferData {
- BufferData();
- BufferData(GLsizeiptr size, void * data);
- GLsizeiptr m_size;
- FixedBuffer m_fixedBuffer;
-};
-
-class ProgramData {
-private:
- typedef struct _IndexInfo {
- GLint base;
- GLint size;
- GLenum type;
- GLint appBase;
- GLint hostLocsPerElement;
- GLuint flags;
- GLint samplerValue; // only set for sampler uniforms
- } IndexInfo;
-
- GLuint m_numIndexes;
- IndexInfo* m_Indexes;
- bool m_initialized;
- bool m_locShiftWAR;
-
- android::Vector<GLuint> m_shaders;
-
-public:
- enum {
- INDEX_FLAG_SAMPLER_EXTERNAL = 0x00000001,
- };
-
- ProgramData();
- void initProgramData(GLuint numIndexes);
- bool isInitialized();
- virtual ~ProgramData();
- void setIndexInfo(GLuint index, GLint base, GLint size, GLenum type);
- void setIndexFlags(GLuint index, GLuint flags);
- GLuint getIndexForLocation(GLint location);
- GLenum getTypeForLocation(GLint location);
-
- bool needUniformLocationWAR() const { return m_locShiftWAR; }
- void setupLocationShiftWAR();
- GLint locationWARHostToApp(GLint hostLoc, GLint arrIndex);
- GLint locationWARAppToHost(GLint appLoc);
-
- GLint getNextSamplerUniform(GLint index, GLint* val, GLenum* target);
- bool setSamplerUniform(GLint appLoc, GLint val, GLenum* target);
-
- bool attachShader(GLuint shader);
- bool detachShader(GLuint shader);
- size_t getNumShaders() const { return m_shaders.size(); }
- GLuint getShader(size_t i) const { return m_shaders[i]; }
-};
-
-struct ShaderData {
- typedef android::List<android::String8> StringList;
- StringList samplerExternalNames;
- int refcount;
-};
-
-class GLSharedGroup {
-private:
- android::DefaultKeyedVector<GLuint, BufferData*> m_buffers;
- android::DefaultKeyedVector<GLuint, ProgramData*> m_programs;
- android::DefaultKeyedVector<GLuint, ShaderData*> m_shaders;
- mutable android::Mutex m_lock;
-
- void refShaderDataLocked(ssize_t shaderIdx);
- void unrefShaderDataLocked(ssize_t shaderIdx);
-
-public:
- GLSharedGroup();
- ~GLSharedGroup();
- bool isObject(GLuint obj);
- BufferData * getBufferData(GLuint bufferId);
- void addBufferData(GLuint bufferId, GLsizeiptr size, void * data);
- void updateBufferData(GLuint bufferId, GLsizeiptr size, void * data);
- GLenum subUpdateBufferData(GLuint bufferId, GLintptr offset, GLsizeiptr size, void * data);
- void deleteBufferData(GLuint);
-
- bool isProgram(GLuint program);
- bool isProgramInitialized(GLuint program);
- void addProgramData(GLuint program);
- void initProgramData(GLuint program, GLuint numIndexes);
- void attachShader(GLuint program, GLuint shader);
- void detachShader(GLuint program, GLuint shader);
- void deleteProgramData(GLuint program);
- void setProgramIndexInfo(GLuint program, GLuint index, GLint base, GLint size, GLenum type, const char* name);
- GLenum getProgramUniformType(GLuint program, GLint location);
- void setupLocationShiftWAR(GLuint program);
- GLint locationWARHostToApp(GLuint program, GLint hostLoc, GLint arrIndex);
- GLint locationWARAppToHost(GLuint program, GLint appLoc);
- bool needUniformLocationWAR(GLuint program);
- GLint getNextSamplerUniform(GLuint program, GLint index, GLint* val, GLenum* target) const;
- bool setSamplerUniform(GLuint program, GLint appLoc, GLint val, GLenum* target);
-
- bool addShaderData(GLuint shader);
- // caller must hold a reference to the shader as long as it holds the pointer
- ShaderData* getShaderData(GLuint shader);
- void unrefShaderData(GLuint shader);
-};
-
-typedef SmartPtr<GLSharedGroup> GLSharedGroupPtr;
-
-#endif //_GL_SHARED_GROUP_H_
+++ /dev/null
-
-ROOT=../..
-
-include $(ROOT)/make/commondefs
-
-CXXFILES = TcpStream.cpp GLClientState.cpp glUtils.cpp
-CXXINCS += -I$(ROOT)/libs/GLESv1 -I$(ROOT)/include
-
-LIBRARY_NAME = libcodecCommon.a
-
-include $(COMMONRULES)
-
-
+++ /dev/null
-/*
-* Copyright (C) 2011 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 __SMART_PTR_H
-#define __SMART_PTR_H
-
-#include <cutils/threads.h>
-#include <cutils/atomic.h>
-
-template <class T, bool threadSafe = false>
-class SmartPtr
-{
-public:
- explicit SmartPtr(T* ptr = (T*)NULL) {
- if (threadSafe) {
- m_lock = new mutex_t;
- mutex_init(m_lock);
- }
- else m_lock = NULL;
-
- m_ptr = ptr;
- if (ptr)
- m_pRefCount = new int32_t(1);
- else
- m_pRefCount = NULL;
- }
-
- SmartPtr<T,threadSafe>(const SmartPtr<T,false>& rhs) {
- if (threadSafe) {
- m_lock = new mutex_t;
- mutex_init(m_lock);
- }
- else m_lock = NULL;
-
- m_pRefCount = rhs.m_pRefCount;
- m_ptr = rhs.m_ptr;
- use();
- }
-
- SmartPtr<T,threadSafe>(SmartPtr<T,true>& rhs) {
- if (threadSafe) {
- m_lock = new mutex_t;
- mutex_init(m_lock);
- }
- else m_lock = NULL;
-
- if (rhs.m_lock) mutex_lock(rhs.m_lock);
- m_pRefCount = rhs.m_pRefCount;
- m_ptr = rhs.m_ptr;
- use();
- if (rhs.m_lock) mutex_unlock(rhs.m_lock);
- }
-
- ~SmartPtr() {
- if (m_lock) mutex_lock(m_lock);
- release();
- if (m_lock)
- {
- mutex_unlock(m_lock);
- mutex_destroy(m_lock);
- delete m_lock;
- }
- }
-
- T* Ptr() const {
- return m_ptr;
- }
-
- const T* constPtr() const
- {
- return m_ptr;
- }
-
- T* operator->() const {
- return m_ptr;
- }
-
- T& operator*() const {
- return *m_ptr;
- }
-
- operator void*() const {
- return (void *)m_ptr;
- }
-
- // This gives STL lists something to compare.
- bool operator <(const SmartPtr<T>& t1) const {
- return m_ptr < t1.m_ptr;
- }
-
- SmartPtr<T,threadSafe>& operator=(const SmartPtr<T,false>& rhs)
- {
- if (m_ptr == rhs.m_ptr)
- return *this;
-
- if (m_lock) mutex_lock(m_lock);
- release();
- m_pRefCount = rhs.m_pRefCount;
- m_ptr = rhs.m_ptr;
- use();
- if (m_lock) mutex_unlock(m_lock);
-
- return *this;
- }
-
- SmartPtr<T,threadSafe>& operator=(SmartPtr<T,true>& rhs)
- {
- if (m_ptr == rhs.m_ptr)
- return *this;
-
- if (m_lock) mutex_lock(m_lock);
- release();
- if (rhs.m_lock) mutex_lock(rhs.m_lock);
- m_pRefCount = rhs.m_pRefCount;
- m_ptr = rhs.m_ptr;
- use();
- if (rhs.m_lock) mutex_unlock(rhs.m_lock);
- if (m_lock) mutex_unlock(m_lock);
-
- return *this;
- }
-
-private:
- int32_t *m_pRefCount;
- mutex_t *m_lock;
- T* m_ptr;
-
- // Increment the reference count on this pointer by 1.
- int use() {
- if (!m_pRefCount) return 0;
- return android_atomic_inc(m_pRefCount) + 1;
- }
-
- // Decrement the reference count on the pointer by 1.
- // If the reference count goes to (or below) 0, the pointer is deleted.
- int release() {
- if (!m_pRefCount) return 0;
-
- int iVal = android_atomic_dec(m_pRefCount);
- if (iVal > 1)
- return iVal - 1;
-
- delete m_pRefCount;
- m_pRefCount = NULL;
-
- if (m_ptr) {
- delete m_ptr;
- m_ptr = NULL;
- }
- return 0;
- }
-
-};
-
-#endif // of __SMART_PTR_H
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "SocketStream.h"
-#include <cutils/sockets.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-#ifndef _WIN32
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <sys/un.h>
-#else
-#include <ws2tcpip.h>
-#endif
-
-SocketStream::SocketStream(size_t bufSize) :
- IOStream(bufSize),
- m_sock(-1),
- m_bufsize(bufSize),
- m_buf(NULL)
-{
-}
-
-SocketStream::SocketStream(int sock, size_t bufSize) :
- IOStream(bufSize),
- m_sock(sock),
- m_bufsize(bufSize),
- m_buf(NULL)
-{
-}
-
-SocketStream::~SocketStream()
-{
- if (m_sock >= 0) {
-#ifdef _WIN32
- closesocket(m_sock);
-#else
- ::close(m_sock);
-#endif
- }
- if (m_buf != NULL) {
- free(m_buf);
- m_buf = NULL;
- }
-}
-
-
-void *SocketStream::allocBuffer(size_t minSize)
-{
- size_t allocSize = (m_bufsize < minSize ? minSize : m_bufsize);
- if (!m_buf) {
- m_buf = (unsigned char *)malloc(allocSize);
- }
- else if (m_bufsize < allocSize) {
- unsigned char *p = (unsigned char *)realloc(m_buf, allocSize);
- if (p != NULL) {
- m_buf = p;
- m_bufsize = allocSize;
- } else {
- ERR("%s: realloc (%zu) failed\n", __FUNCTION__, allocSize);
- free(m_buf);
- m_buf = NULL;
- m_bufsize = 0;
- }
- }
-
- return m_buf;
-};
-
-int SocketStream::commitBuffer(size_t size)
-{
- return writeFully(m_buf, size);
-}
-
-int SocketStream::writeFully(const void* buffer, size_t size)
-{
- if (!valid()) return -1;
-
- size_t res = size;
- int retval = 0;
-
- while (res > 0) {
- ssize_t stat = ::send(m_sock, (const char *)buffer + (size - res), res, 0);
- if (stat < 0) {
- if (errno != EINTR) {
- retval = stat;
- ERR("%s: failed: %s\n", __FUNCTION__, strerror(errno));
- break;
- }
- } else {
- res -= stat;
- }
- }
- return retval;
-}
-
-const unsigned char *SocketStream::readFully(void *buf, size_t len)
-{
- const unsigned char* ret = NULL;
- if (!valid()) return NULL;
- if (!buf) {
- return NULL; // do not allow NULL buf in that implementation
- }
- size_t res = len;
- while (res > 0) {
- ssize_t stat = ::recv(m_sock, (char *)(buf) + len - res, res, 0);
- if (stat > 0) {
- res -= stat;
- continue;
- }
- if (stat == 0 || errno != EINTR) { // client shutdown or error
- return NULL;
- }
- }
- return (const unsigned char *)buf;
-}
-
-const unsigned char *SocketStream::read( void *buf, size_t *inout_len)
-{
- if (!valid()) return NULL;
- if (!buf) {
- return NULL; // do not allow NULL buf in that implementation
- }
-
- int n;
- do {
- n = recv(buf, *inout_len);
- } while( n < 0 && errno == EINTR );
-
- if (n > 0) {
- *inout_len = n;
- return (const unsigned char *)buf;
- }
-
- return NULL;
-}
-
-int SocketStream::recv(void *buf, size_t len)
-{
- if (!valid()) return int(ERR_INVALID_SOCKET);
- int res = 0;
- while(true) {
- res = ::recv(m_sock, (char *)buf, len, 0);
- if (res < 0) {
- if (errno == EINTR) {
- continue;
- }
- }
- break;
- }
- return res;
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 __SOCKET_STREAM_H
-#define __SOCKET_STREAM_H
-
-#include <stdlib.h>
-#include "IOStream.h"
-
-class SocketStream : public IOStream {
-public:
- typedef enum { ERR_INVALID_SOCKET = -1000 } SocketStreamError;
-
- explicit SocketStream(size_t bufsize = 10000);
- virtual ~SocketStream();
-
- virtual int listen(unsigned short port) = 0;
- virtual SocketStream *accept() = 0;
- virtual int connect(unsigned short port) = 0;
-
- virtual void *allocBuffer(size_t minSize);
- virtual int commitBuffer(size_t size);
- virtual const unsigned char *readFully(void *buf, size_t len);
- virtual const unsigned char *read(void *buf, size_t *inout_len);
-
- bool valid() { return m_sock >= 0; }
- virtual int recv(void *buf, size_t len);
- virtual int writeFully(const void *buf, size_t len);
-
-protected:
- int m_sock;
- size_t m_bufsize;
- unsigned char *m_buf;
-
- SocketStream(int sock, size_t bufSize);
-};
-
-#endif /* __SOCKET_STREAM_H */
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "TcpStream.h"
-#include <cutils/sockets.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-#ifndef _WIN32
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#else
-#include <ws2tcpip.h>
-#endif
-
-TcpStream::TcpStream(size_t bufSize) :
- SocketStream(bufSize)
-{
-}
-
-TcpStream::TcpStream(int sock, size_t bufSize) :
- SocketStream(sock, bufSize)
-{
- // disable Nagle algorithm to improve bandwidth of small
- // packets which are quite common in our implementation.
-#ifdef _WIN32
- DWORD flag;
-#else
- int flag;
-#endif
- flag = 1;
- setsockopt( sock, IPPROTO_TCP, TCP_NODELAY, (const char*)&flag, sizeof(flag) );
-}
-
-int TcpStream::listen(unsigned short port)
-{
- m_sock = socket_loopback_server(port, SOCK_STREAM);
- if (!valid()) return int(ERR_INVALID_SOCKET);
-
- return 0;
-}
-
-SocketStream * TcpStream::accept()
-{
- int clientSock = -1;
-
- while (true) {
- struct sockaddr_in addr;
- socklen_t len = sizeof(addr);
- clientSock = ::accept(m_sock, (sockaddr *)&addr, &len);
-
- if (clientSock < 0 && errno == EINTR) {
- continue;
- }
- break;
- }
-
- TcpStream *clientStream = NULL;
-
- if (clientSock >= 0) {
- clientStream = new TcpStream(clientSock, m_bufsize);
- }
- return clientStream;
-}
-
-int TcpStream::connect(unsigned short port)
-{
- return connect("127.0.0.1",port);
-}
-
-int TcpStream::connect(const char* hostname, unsigned short port)
-{
- m_sock = socket_network_client(hostname, port, SOCK_STREAM);
- if (!valid()) return -1;
- return 0;
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 __TCP_STREAM_H
-#define __TCP_STREAM_H
-
-#include "SocketStream.h"
-
-class TcpStream : public SocketStream {
-public:
- explicit TcpStream(size_t bufsize = 10000);
- virtual int listen(unsigned short port);
- virtual SocketStream *accept();
- virtual int connect(unsigned short port);
- int connect(const char* hostname, unsigned short port);
-private:
- TcpStream(int sock, size_t bufSize);
-};
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _CODEC_DEFS_H
-#define _CODEC_DEFS_H
-
-#define CODEC_SERVER_PORT 22468
-
-#define CODEC_MAX_VERTEX_ATTRIBUTES 64
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "glUtils.h"
-#include <string.h>
-#include "ErrorLog.h"
-#include <IOStream.h>
-
-size_t glSizeof(GLenum type)
-{
- size_t retval = 0;
- switch(type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- retval = 1;
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_HALF_FLOAT_OES:
- retval = 2;
- break;
- case GL_UNSIGNED_INT:
- case GL_INT:
- case GL_FLOAT:
- case GL_FIXED:
- case GL_BOOL:
- retval = 4;
- break;
-#ifdef GL_DOUBLE
- case GL_DOUBLE:
- retval = 8;
- break;
-#endif
- case GL_FLOAT_VEC2:
- case GL_INT_VEC2:
- case GL_BOOL_VEC2:
- retval = 8;
- break;
- case GL_INT_VEC3:
- case GL_BOOL_VEC3:
- case GL_FLOAT_VEC3:
- retval = 12;
- break;
- case GL_FLOAT_VEC4:
- case GL_BOOL_VEC4:
- case GL_INT_VEC4:
- case GL_FLOAT_MAT2:
- retval = 16;
- break;
- case GL_FLOAT_MAT3:
- retval = 36;
- break;
- case GL_FLOAT_MAT4:
- retval = 64;
- break;
- case GL_SAMPLER_2D:
- case GL_SAMPLER_CUBE:
- retval = 4;
- break;
- default:
- ERR("**** ERROR unknown type 0x%x (%s,%d)\n", type, __FUNCTION__,__LINE__);
- }
- return retval;
-
-}
-
-size_t glUtilsParamSize(GLenum param)
-{
- size_t s = 0;
-
- switch(param)
- {
- case GL_DEPTH_TEST:
- case GL_DEPTH_FUNC:
- case GL_DEPTH_BITS:
- case GL_MAX_CLIP_PLANES:
- case GL_GREEN_BITS:
- case GL_MAX_MODELVIEW_STACK_DEPTH:
- case GL_MAX_PROJECTION_STACK_DEPTH:
- case GL_MAX_TEXTURE_STACK_DEPTH:
- case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
- case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
- case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
- case GL_MAX_TEXTURE_SIZE:
- case GL_TEXTURE_GEN_MODE_OES:
- case GL_TEXTURE_ENV_MODE:
- case GL_FOG_MODE:
- case GL_FOG_DENSITY:
- case GL_FOG_START:
- case GL_FOG_END:
- case GL_SPOT_EXPONENT:
- case GL_CONSTANT_ATTENUATION:
- case GL_LINEAR_ATTENUATION:
- case GL_QUADRATIC_ATTENUATION:
- case GL_SHININESS:
- case GL_LIGHT_MODEL_TWO_SIDE:
- case GL_POINT_SIZE:
- case GL_POINT_SIZE_MIN:
- case GL_POINT_SIZE_MAX:
- case GL_POINT_FADE_THRESHOLD_SIZE:
- case GL_CULL_FACE:
- case GL_CULL_FACE_MODE:
- case GL_FRONT_FACE:
- case GL_SHADE_MODEL:
- case GL_DEPTH_WRITEMASK:
- case GL_DEPTH_CLEAR_VALUE:
- case GL_STENCIL_FAIL:
- case GL_STENCIL_PASS_DEPTH_FAIL:
- case GL_STENCIL_PASS_DEPTH_PASS:
- case GL_STENCIL_REF:
- case GL_STENCIL_WRITEMASK:
- case GL_MATRIX_MODE:
- case GL_MODELVIEW_STACK_DEPTH:
- case GL_PROJECTION_STACK_DEPTH:
- case GL_TEXTURE_STACK_DEPTH:
- case GL_ALPHA_TEST_FUNC:
- case GL_ALPHA_TEST_REF:
- case GL_ALPHA_TEST:
- case GL_DITHER:
- case GL_BLEND_DST:
- case GL_BLEND_SRC:
- case GL_BLEND:
- case GL_LOGIC_OP_MODE:
- case GL_SCISSOR_TEST:
- case GL_MAX_TEXTURE_UNITS:
- case GL_ACTIVE_TEXTURE:
- case GL_ALPHA_BITS:
- case GL_ARRAY_BUFFER_BINDING:
- case GL_BLUE_BITS:
- case GL_CLIENT_ACTIVE_TEXTURE:
- case GL_CLIP_PLANE0:
- case GL_CLIP_PLANE1:
- case GL_CLIP_PLANE2:
- case GL_CLIP_PLANE3:
- case GL_CLIP_PLANE4:
- case GL_CLIP_PLANE5:
- case GL_COLOR_ARRAY:
- case GL_COLOR_ARRAY_BUFFER_BINDING:
- case GL_COLOR_ARRAY_SIZE:
- case GL_COLOR_ARRAY_STRIDE:
- case GL_COLOR_ARRAY_TYPE:
- case GL_COLOR_LOGIC_OP:
- case GL_COLOR_MATERIAL:
- case GL_PACK_ALIGNMENT:
- case GL_PERSPECTIVE_CORRECTION_HINT:
- case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
- case GL_POINT_SIZE_ARRAY_STRIDE_OES:
- case GL_POINT_SIZE_ARRAY_TYPE_OES:
- case GL_POINT_SMOOTH:
- case GL_POINT_SMOOTH_HINT:
- case GL_POINT_SPRITE_OES:
- case GL_COORD_REPLACE_OES:
- case GL_COMBINE_ALPHA:
- case GL_SRC0_RGB:
- case GL_SRC1_RGB:
- case GL_SRC2_RGB:
- case GL_OPERAND0_RGB:
- case GL_OPERAND1_RGB:
- case GL_OPERAND2_RGB:
- case GL_SRC0_ALPHA:
- case GL_SRC1_ALPHA:
- case GL_SRC2_ALPHA:
- case GL_OPERAND0_ALPHA:
- case GL_OPERAND1_ALPHA:
- case GL_OPERAND2_ALPHA:
- case GL_RGB_SCALE:
- case GL_ALPHA_SCALE:
- case GL_COMBINE_RGB:
- case GL_POLYGON_OFFSET_FACTOR:
- case GL_POLYGON_OFFSET_FILL:
- case GL_POLYGON_OFFSET_UNITS:
- case GL_RED_BITS:
- case GL_RESCALE_NORMAL:
- case GL_SAMPLE_ALPHA_TO_COVERAGE:
- case GL_SAMPLE_ALPHA_TO_ONE:
- case GL_SAMPLE_BUFFERS:
- case GL_SAMPLE_COVERAGE:
- case GL_SAMPLE_COVERAGE_INVERT:
- case GL_SAMPLE_COVERAGE_VALUE:
- case GL_SAMPLES:
- case GL_MAX_SAMPLES_EXT:
- case GL_STENCIL_BITS:
- case GL_STENCIL_CLEAR_VALUE:
- case GL_STENCIL_FUNC:
- case GL_STENCIL_TEST:
- case GL_STENCIL_VALUE_MASK:
- case GL_STENCIL_BACK_FUNC:
- case GL_STENCIL_BACK_VALUE_MASK:
- case GL_STENCIL_BACK_REF:
- case GL_STENCIL_BACK_FAIL:
- case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
- case GL_STENCIL_BACK_PASS_DEPTH_PASS:
- case GL_STENCIL_BACK_WRITEMASK:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_BINDING_2D:
- case GL_TEXTURE_BINDING_CUBE_MAP:
- case GL_TEXTURE_BINDING_EXTERNAL_OES:
- case GL_TEXTURE_COORD_ARRAY:
- case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
- case GL_TEXTURE_COORD_ARRAY_SIZE:
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
- case GL_TEXTURE_COORD_ARRAY_TYPE:
- case GL_UNPACK_ALIGNMENT:
- case GL_VERTEX_ARRAY:
- case GL_VERTEX_ARRAY_BUFFER_BINDING:
- case GL_VERTEX_ARRAY_SIZE:
- case GL_VERTEX_ARRAY_STRIDE:
- case GL_VERTEX_ARRAY_TYPE:
- case GL_SPOT_CUTOFF:
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_GENERATE_MIPMAP:
- case GL_GENERATE_MIPMAP_HINT:
- case GL_RENDERBUFFER_WIDTH_OES:
- case GL_RENDERBUFFER_HEIGHT_OES:
- case GL_RENDERBUFFER_INTERNAL_FORMAT_OES:
- case GL_RENDERBUFFER_RED_SIZE_OES:
- case GL_RENDERBUFFER_GREEN_SIZE_OES:
- case GL_RENDERBUFFER_BLUE_SIZE_OES:
- case GL_RENDERBUFFER_ALPHA_SIZE_OES:
- case GL_RENDERBUFFER_DEPTH_SIZE_OES:
- case GL_RENDERBUFFER_STENCIL_SIZE_OES:
- case GL_RENDERBUFFER_BINDING:
- case GL_FRAMEBUFFER_BINDING:
- case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES:
- case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES:
- case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES:
- case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES:
- case GL_FENCE_STATUS_NV:
- case GL_FENCE_CONDITION_NV:
- case GL_TEXTURE_WIDTH_QCOM:
- case GL_TEXTURE_HEIGHT_QCOM:
- case GL_TEXTURE_DEPTH_QCOM:
- case GL_TEXTURE_INTERNAL_FORMAT_QCOM:
- case GL_TEXTURE_FORMAT_QCOM:
- case GL_TEXTURE_TYPE_QCOM:
- case GL_TEXTURE_IMAGE_VALID_QCOM:
- case GL_TEXTURE_NUM_LEVELS_QCOM:
- case GL_TEXTURE_TARGET_QCOM:
- case GL_TEXTURE_OBJECT_VALID_QCOM:
- case GL_BLEND_EQUATION_RGB_OES:
- case GL_BLEND_EQUATION_ALPHA_OES:
- case GL_BLEND_DST_RGB_OES:
- case GL_BLEND_SRC_RGB_OES:
- case GL_BLEND_DST_ALPHA_OES:
- case GL_BLEND_SRC_ALPHA_OES:
- case GL_MAX_LIGHTS:
- case GL_SHADER_TYPE:
- case GL_DELETE_STATUS:
- case GL_COMPILE_STATUS:
- case GL_INFO_LOG_LENGTH:
- case GL_SHADER_SOURCE_LENGTH:
- case GL_CURRENT_PROGRAM:
- case GL_LINK_STATUS:
- case GL_VALIDATE_STATUS:
- case GL_ATTACHED_SHADERS:
- case GL_ACTIVE_UNIFORMS:
- case GL_ACTIVE_ATTRIBUTES:
- case GL_SUBPIXEL_BITS:
- case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
- case GL_NUM_SHADER_BINARY_FORMATS:
- case GL_SHADER_COMPILER:
- case GL_MAX_VERTEX_ATTRIBS:
- case GL_MAX_VERTEX_UNIFORM_VECTORS:
- case GL_MAX_VARYING_VECTORS:
- case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
- case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
- case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
- case GL_MAX_RENDERBUFFER_SIZE:
- case GL_MAX_TEXTURE_IMAGE_UNITS:
- case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
- case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
- case GL_LINE_WIDTH:
- s = 1;
- break;
- case GL_ALIASED_LINE_WIDTH_RANGE:
- case GL_ALIASED_POINT_SIZE_RANGE:
- case GL_DEPTH_RANGE:
- case GL_MAX_VIEWPORT_DIMS:
- case GL_SMOOTH_POINT_SIZE_RANGE:
- case GL_SMOOTH_LINE_WIDTH_RANGE:
- s= 2;
- break;
- case GL_SPOT_DIRECTION:
- case GL_POINT_DISTANCE_ATTENUATION:
- case GL_CURRENT_NORMAL:
- s = 3;
- break;
- case GL_CURRENT_VERTEX_ATTRIB:
- case GL_CURRENT_TEXTURE_COORDS:
- case GL_CURRENT_COLOR:
- case GL_FOG_COLOR:
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- case GL_EMISSION:
- case GL_POSITION:
- case GL_LIGHT_MODEL_AMBIENT:
- case GL_TEXTURE_ENV_COLOR:
- case GL_SCISSOR_BOX:
- case GL_VIEWPORT:
- case GL_TEXTURE_CROP_RECT_OES:
- case GL_COLOR_CLEAR_VALUE:
- case GL_COLOR_WRITEMASK:
- case GL_AMBIENT_AND_DIFFUSE:
- case GL_BLEND_COLOR:
- s = 4;
- break;
- case GL_MODELVIEW_MATRIX:
- case GL_PROJECTION_MATRIX:
- case GL_TEXTURE_MATRIX:
- s = 16;
- break;
- default:
- ERR("glUtilsParamSize: unknow param 0x%08x\n", param);
- s = 1; // assume 1
- }
- return s;
-}
-
-void glUtilsPackPointerData(unsigned char *dst, unsigned char *src,
- int size, GLenum type, unsigned int stride,
- unsigned int datalen)
-{
- unsigned int vsize = size * glSizeof(type);
- if (stride == 0) stride = vsize;
-
- if (stride == vsize) {
- memcpy(dst, src, datalen);
- } else {
- for (unsigned int i = 0; i < datalen; i += vsize) {
- memcpy(dst, src, vsize);
- dst += vsize;
- src += stride;
- }
- }
-}
-
-void glUtilsWritePackPointerData(void* _stream, unsigned char *src,
- int size, GLenum type, unsigned int stride,
- unsigned int datalen)
-{
- IOStream* stream = reinterpret_cast<IOStream*>(_stream);
-
- unsigned int vsize = size * glSizeof(type);
- if (stride == 0) stride = vsize;
-
- if (stride == vsize) {
- stream->writeFully(src, datalen);
- } else {
- for (unsigned int i = 0; i < datalen; i += vsize) {
- stream->writeFully(src, (size_t)vsize);
- src += stride;
- }
- }
-}
-
-int glUtilsPixelBitSize(GLenum format, GLenum type)
-{
- int components = 0;
- int componentsize = 0;
- int pixelsize = 0;
- switch(type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- componentsize = 8;
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_RGB565_OES:
- case GL_RGB5_A1_OES:
- case GL_RGBA4_OES:
- pixelsize = 16;
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- case GL_FIXED:
- case GL_UNSIGNED_INT_24_8_OES:
- pixelsize = 32;
- break;
- default:
- ERR("glUtilsPixelBitSize: unknown pixel type - assuming pixel data 0\n");
- componentsize = 0;
- }
-
- if (pixelsize == 0) {
- switch(format) {
-#if 0
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
-#endif
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_DEPTH_COMPONENT:
- case GL_DEPTH_STENCIL_OES:
- components = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- components = 2;
- break;
- case GL_RGB:
-#if 0
- case GL_BGR:
-#endif
- components = 3;
- break;
- case GL_RGBA:
- case GL_BGRA_EXT:
- components = 4;
- break;
- default:
- ERR("glUtilsPixelBitSize: unknown pixel format...\n");
- components = 0;
- }
- pixelsize = components * componentsize;
- }
-
- return pixelsize;
-}
-
-// pack a list of strings into one.
-void glUtilsPackStrings(char *ptr, char **strings, GLint *length, GLsizei count)
-{
- char *p = ptr;
- *p = '\0';
- for (int i = 0; i < count; i++) {
- int l=0;
- if (strings[i]!=NULL) {
- if (length == NULL || length[i] < 0) {
- l = strlen(strings[i]);
- strcat(p, strings[i]);
- } else {
- l = length[i];
- strncat(p, strings[i], l);
- }
- }
- p += l;
- }
-}
-
-// claculate the length of a list of strings
-int glUtilsCalcShaderSourceLen( char **strings, GLint *length, GLsizei count)
-{
- int len = 0;
- for (int i = 0; i < count; i++) {
- int l;
- if (length == NULL || length[i] < 0) {
- l = strings[i]!=NULL ? strlen(strings[i]) : 0;
- } else {
- l = length[i];
- }
- len += l;
- }
- return len;
-
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 __GL_UTILS_H__
-#define __GL_UTILS_H__
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef GL_API
- #undef GL_API
-#endif
-#define GL_API
-
-#ifdef GL_APIENTRY
- #undef GL_APIENTRY
-#endif
-
-#ifdef GL_APIENTRYP
- #undef GL_APIENTRYP
-#endif
-#define GL_APIENTRYP
-
-#ifndef ANDROID
-#define GL_APIENTRY
-#endif
-
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- size_t glSizeof(GLenum type);
- size_t glUtilsParamSize(GLenum param);
- void glUtilsPackPointerData(unsigned char *dst, unsigned char *str,
- int size, GLenum type, unsigned int stride,
- unsigned int datalen);
- void glUtilsWritePackPointerData(void* stream, unsigned char *src,
- int size, GLenum type, unsigned int stride,
- unsigned int datalen);
- int glUtilsPixelBitSize(GLenum format, GLenum type);
- void glUtilsPackStrings(char *ptr, char **strings, GLint *length, GLsizei count);
- int glUtilsCalcShaderSourceLen(char **strings, GLint *length, GLsizei count);
-#ifdef __cplusplus
-};
-#endif
-
-namespace GLUtils {
-
- template <class T> void minmax(T *indices, int count, int *min, int *max) {
- *min = -1;
- *max = -1;
- T *ptr = indices;
- for (int i = 0; i < count; i++) {
- if (*min == -1 || *ptr < *min) *min = *ptr;
- if (*max == -1 || *ptr > *max) *max = *ptr;
- ptr++;
- }
- }
-
- template <class T> void shiftIndices(T *indices, int count, int offset) {
- T *ptr = indices;
- for (int i = 0; i < count; i++) {
- *ptr += offset;
- ptr++;
- }
- }
-
-
- template <class T> void shiftIndices(T *src, T *dst, int count, int offset)
- {
- for (int i = 0; i < count; i++) {
- *dst = *src + offset;
- dst++;
- src++;
- }
- }
-}; // namespace GLUtils
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 __GL_BASE_TYPES__H
-#define __GL_BASE_TYPES__H
-
-#include <KHR/khrplatform.h>
-
-#ifndef gl_APIENTRY
-#define gl_APIENTRY KHRONOS_APIENTRY
-#endif
-
-#ifndef gl2_APIENTRY
-#define gl2_APIENTRY KHRONOS_APIENTRY
-#endif
-
-typedef void GLvoid;
-typedef unsigned int GLenum;
-typedef unsigned char GLboolean;
-typedef unsigned int GLbitfield;
-typedef char GLchar;
-typedef khronos_int8_t GLbyte;
-typedef short GLshort;
-typedef int GLint;
-typedef int GLsizei;
-typedef khronos_uint8_t GLubyte;
-typedef unsigned short GLushort;
-typedef unsigned int GLuint;
-typedef khronos_float_t GLfloat;
-typedef khronos_float_t GLclampf;
-typedef khronos_int32_t GLfixed;
-typedef khronos_int32_t GLclampx;
-typedef khronos_intptr_t GLintptr;
-typedef khronos_ssize_t GLsizeiptr;
-typedef char *GLstr;
-/* JR XXX Treating this as an in handle - is this correct? */
-typedef void * GLeglImageOES;
-
-/* ErrorCode */
-#ifndef GL_INVALID_ENUM
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-#define GL_OUT_OF_MEMORY 0x0505
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-#endif
-
-#endif
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-### GLESv1 implementation ###########################################
-$(call emugl-begin-shared-library,libGLESv1_CM_emulation)
-$(call emugl-import,libOpenglSystemCommon libGLESv1_enc lib_renderControl_enc)
-
-LOCAL_CFLAGS += -DLOG_TAG=\"GLES_emulation\" -DGL_GLEXT_PROTOTYPES
-
-LOCAL_SRC_FILES := gl.cpp
-LOCAL_MODULE_RELATIVE_PATH := egl
-
-$(call emugl-end-module)
+++ /dev/null
-/*
-* Copyright 2011 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 "EGLClientIface.h"
-#include "HostConnection.h"
-#include "GLEncoder.h"
-#include "GLES/gl.h"
-#include "GLES/glext.h"
-#include "ErrorLog.h"
-#include "gralloc_cb.h"
-#include "ThreadInfo.h"
-#include "EGLImage.h"
-
-
-//XXX: fix this macro to get the context from fast tls path
-#define GET_CONTEXT GLEncoder * ctx = getEGLThreadInfo()->hostConn->glEncoder();
-
-#include "gl_entry.cpp"
-
-//The functions table
-#include "gl_ftable.h"
-
-static EGLClient_eglInterface * s_egl = NULL;
-static EGLClient_glesInterface * s_gl = NULL;
-
-#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
- HostConnection *hostCon = HostConnection::get(); \
- if (!hostCon) { \
- ALOGE("egl: Failed to get host connection\n"); \
- return ret; \
- } \
- renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
- if (!rcEnc) { \
- ALOGE("egl: Failed to get renderControl encoder context\n"); \
- return ret; \
- }
-
-//GL extensions
-void glEGLImageTargetTexture2DOES(void * self, GLenum target, GLeglImageOES img)
-{
- (void)self;
-
- DBG("glEGLImageTargetTexture2DOES v1 target=%#x img=%p", target, img);
-
- EGLImage_t *image = (EGLImage_t*)img;
-
- if (image->target == EGL_NATIVE_BUFFER_ANDROID) {
- //TODO: check error - we don't have a way to set gl error
- android_native_buffer_t* native_buffer = image->native_buffer;
-
- if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
- return;
- }
-
- if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
- return;
- }
-
- GET_CONTEXT;
- DEFINE_AND_VALIDATE_HOST_CONNECTION();
-
- ctx->override2DTextureTarget(target);
- rcEnc->rcBindTexture(rcEnc,
- ((cb_handle_t *)(native_buffer->handle))->hostHandle);
- ctx->restore2DTextureTarget();
- }
- else if (image->target == EGL_GL_TEXTURE_2D_KHR) {
- GET_CONTEXT;
- ctx->override2DTextureTarget(target);
- GLeglImageOES hostImage = reinterpret_cast<GLeglImageOES>((intptr_t)image->host_egl_image);
- ctx->m_glEGLImageTargetTexture2DOES_enc(self, target, hostImage);
- ctx->restore2DTextureTarget();
- }
-}
-
-void glEGLImageTargetRenderbufferStorageOES(void *self, GLenum target, GLeglImageOES image)
-{
- (void)self;
- (void)target;
-
- DBG("glEGLImageTargetRenderbufferStorageOES v1 target=%#x image=%p",
- target, image);
- //TODO: check error - we don't have a way to set gl error
- android_native_buffer_t* native_buffer = (android_native_buffer_t*)image;
-
- if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
- return;
- }
-
- if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
- return;
- }
-
- DEFINE_AND_VALIDATE_HOST_CONNECTION();
- rcEnc->rcBindRenderbuffer(rcEnc,
- ((cb_handle_t *)(native_buffer->handle))->hostHandle);
-
- return;
-}
-
-void * getProcAddress(const char * procname)
-{
- // search in GL function table
- for (int i=0; i<gl_num_funcs; i++) {
- if (!strcmp(gl_funcs_by_name[i].name, procname)) {
- return gl_funcs_by_name[i].proc;
- }
- }
- return NULL;
-}
-
-void finish()
-{
- glFinish();
-}
-
-const GLubyte *my_glGetString (void *self, GLenum name)
-{
- (void)self;
-
- if (s_egl) {
- return (const GLubyte*)s_egl->getGLString(name);
- }
- return NULL;
-}
-
-void init()
-{
- GET_CONTEXT;
- ctx->m_glEGLImageTargetTexture2DOES_enc = ctx->glEGLImageTargetTexture2DOES;
- ctx->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES;
- ctx->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES;
- ctx->glGetString = &my_glGetString;
-}
-
-extern "C" {
-EGLClient_glesInterface * init_emul_gles(EGLClient_eglInterface *eglIface)
-{
- s_egl = eglIface;
-
- if (!s_gl) {
- s_gl = new EGLClient_glesInterface();
- s_gl->getProcAddress = getProcAddress;
- s_gl->finish = finish;
- s_gl->init = init;
- }
-
- return s_gl;
-}
-} //extern
-
-
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-### GLESv1_enc Encoder ###########################################
-$(call emugl-begin-shared-library,libGLESv1_enc)
-
-LOCAL_CFLAGS += -DLOG_TAG=\"emuglGLESv1_enc\"
-
-LOCAL_SRC_FILES := \
- GLEncoder.cpp \
- GLEncoderUtils.cpp \
- gl_client_context.cpp \
- gl_enc.cpp \
- gl_entry.cpp
-
-$(call emugl-import,libOpenglCodecCommon)
-$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
-$(call emugl-export,C_INCLUDES,$(intermediates))
-
-$(call emugl-end-module)
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "GLEncoder.h"
-#include "glUtils.h"
-#include "FixedBuffer.h"
-#include <cutils/log.h>
-#include <assert.h>
-
-#ifndef MIN
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-static GLubyte *gVendorString= (GLubyte *) "Android";
-static GLubyte *gRendererString= (GLubyte *) "Android HW-GLES 1.0";
-static GLubyte *gVersionString= (GLubyte *) "OpenGL ES-CM 1.0";
-static GLubyte *gExtensionsString= (GLubyte *) "GL_OES_EGL_image_external ";
-
-#define SET_ERROR_IF(condition,err) if((condition)) { \
- ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
- ctx->setError(err); \
- return; \
- }
-
-
-#define RET_AND_SET_ERROR_IF(condition,err,ret) if((condition)) { \
- ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
- ctx->setError(err); \
- return ret; \
- }
-
-GLenum GLEncoder::s_glGetError(void * self)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- GLenum err = ctx->getError();
- if(err != GL_NO_ERROR) {
- ctx->setError(GL_NO_ERROR);
- return err;
- }
-
- return ctx->m_glGetError_enc(self);
-
-}
-
-GLint * GLEncoder::getCompressedTextureFormats()
-{
- if (m_compressedTextureFormats == NULL) {
- this->glGetIntegerv(this, GL_NUM_COMPRESSED_TEXTURE_FORMATS,
- &m_num_compressedTextureFormats);
- if (m_num_compressedTextureFormats > 0) {
- // get number of texture formats;
- m_compressedTextureFormats = new GLint[m_num_compressedTextureFormats];
- this->glGetCompressedTextureFormats(this, m_num_compressedTextureFormats, m_compressedTextureFormats);
- }
- }
- return m_compressedTextureFormats;
-}
-
-void GLEncoder::s_glGetIntegerv(void *self, GLenum param, GLint *ptr)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- GLClientState* state = ctx->m_state;
-
- switch (param) {
- case GL_COMPRESSED_TEXTURE_FORMATS: {
- GLint * compressedTextureFormats = ctx->getCompressedTextureFormats();
- if (ctx->m_num_compressedTextureFormats > 0 &&
- compressedTextureFormats != NULL) {
- memcpy(ptr, compressedTextureFormats,
- ctx->m_num_compressedTextureFormats * sizeof(GLint));
- }
- break;
- }
-
- case GL_MAX_TEXTURE_UNITS:
- ctx->m_glGetIntegerv_enc(self, param, ptr);
- *ptr = MIN(*ptr, GLClientState::MAX_TEXTURE_UNITS);
- break;
-
- case GL_TEXTURE_BINDING_2D:
- *ptr = state->getBoundTexture(GL_TEXTURE_2D);
- break;
-
- case GL_TEXTURE_BINDING_EXTERNAL_OES:
- *ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES);
- break;
-
- default:
- if (!state->getClientStateParameter<GLint>(param,ptr)) {
- ctx->m_glGetIntegerv_enc(self, param, ptr);
- }
- break;
- }
-}
-
-void GLEncoder::s_glGetFloatv(void *self, GLenum param, GLfloat *ptr)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- GLClientState* state = ctx->m_state;
-
- switch (param) {
- case GL_COMPRESSED_TEXTURE_FORMATS: {
- GLint * compressedTextureFormats = ctx->getCompressedTextureFormats();
- if (ctx->m_num_compressedTextureFormats > 0 &&
- compressedTextureFormats != NULL) {
- for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
- ptr[i] = (GLfloat) compressedTextureFormats[i];
- }
- }
- break;
- }
-
- case GL_MAX_TEXTURE_UNITS:
- ctx->m_glGetFloatv_enc(self, param, ptr);
- *ptr = MIN(*ptr, (GLfloat)GLClientState::MAX_TEXTURE_UNITS);
- break;
-
- case GL_TEXTURE_BINDING_2D:
- *ptr = (GLfloat)state->getBoundTexture(GL_TEXTURE_2D);
- break;
-
- case GL_TEXTURE_BINDING_EXTERNAL_OES:
- *ptr = (GLfloat)state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES);
- break;
-
- default:
- if (!state->getClientStateParameter<GLfloat>(param,ptr)) {
- ctx->m_glGetFloatv_enc(self, param, ptr);
- }
- break;
- }
-}
-
-void GLEncoder::s_glGetFixedv(void *self, GLenum param, GLfixed *ptr)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- GLClientState* state = ctx->m_state;
-
- switch (param) {
- case GL_COMPRESSED_TEXTURE_FORMATS: {
- GLint * compressedTextureFormats = ctx->getCompressedTextureFormats();
- if (ctx->m_num_compressedTextureFormats > 0 &&
- compressedTextureFormats != NULL) {
- for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
- ptr[i] = compressedTextureFormats[i] << 16;
- }
- }
- break;
- }
-
- case GL_MAX_TEXTURE_UNITS:
- ctx->m_glGetFixedv_enc(self, param, ptr);
- *ptr = MIN(*ptr, GLClientState::MAX_TEXTURE_UNITS << 16);
- break;
-
- case GL_TEXTURE_BINDING_2D:
- *ptr = state->getBoundTexture(GL_TEXTURE_2D) << 16;
- break;
-
- case GL_TEXTURE_BINDING_EXTERNAL_OES:
- *ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES) << 16;
- break;
-
- default:
- if (!state->getClientStateParameter<GLfixed>(param,ptr)) {
- ctx->m_glGetFixedv_enc(self, param, ptr);
- }
- break;
- }
-}
-
-void GLEncoder::s_glGetBooleanv(void *self, GLenum param, GLboolean *ptr)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- GLClientState* state = ctx->m_state;
-
- switch (param) {
- case GL_COMPRESSED_TEXTURE_FORMATS: {
- GLint* compressedTextureFormats = ctx->getCompressedTextureFormats();
- if (ctx->m_num_compressedTextureFormats > 0 &&
- compressedTextureFormats != NULL) {
- for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
- ptr[i] = compressedTextureFormats[i] != 0 ? GL_TRUE : GL_FALSE;
- }
- }
- break;
- }
-
- case GL_TEXTURE_BINDING_2D:
- *ptr = state->getBoundTexture(GL_TEXTURE_2D) != 0 ? GL_TRUE : GL_FALSE;
- break;
-
- case GL_TEXTURE_BINDING_EXTERNAL_OES:
- *ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES) != 0
- ? GL_TRUE : GL_FALSE;
- break;
-
- default:
- if (!state->getClientStateParameter<GLboolean>(param,ptr)) {
- ctx->m_glGetBooleanv_enc(self, param, ptr);
- }
- break;
- }
-}
-
-void GLEncoder::s_glGetPointerv(void * self, GLenum param, GLvoid **params)
-{
- GLEncoder * ctx = (GLEncoder *) self;
- assert(ctx->m_state != NULL);
- ctx->m_state->getClientStatePointer(param,params);
-}
-
-void GLEncoder::s_glFlush(void *self)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- ctx->m_glFlush_enc(self);
- ctx->m_stream->flush();
-}
-
-const GLubyte *GLEncoder::s_glGetString(void *self, GLenum name)
-{
- (void)self;
-
- GLubyte *retval = (GLubyte *) "";
- switch(name) {
- case GL_VENDOR:
- retval = gVendorString;
- break;
- case GL_RENDERER:
- retval = gRendererString;
- break;
- case GL_VERSION:
- retval = gVersionString;
- break;
- case GL_EXTENSIONS:
- retval = gExtensionsString;
- break;
- }
- return retval;
-}
-
-void GLEncoder::s_glPixelStorei(void *self, GLenum param, GLint value)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- ctx->m_glPixelStorei_enc(ctx, param, value);
- ALOG_ASSERT(ctx->m_state, "GLEncoder::s_glPixelStorei");
- ctx->m_state->setPixelStore(param, value);
-}
-
-void GLEncoder::s_glVertexPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- ctx->m_state->setState(GLClientState::VERTEX_LOCATION, size, type, false, stride, data);
-}
-
-void GLEncoder::s_glNormalPointer(void *self, GLenum type, GLsizei stride, const void *data)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- ctx->m_state->setState(GLClientState::NORMAL_LOCATION, 3, type, false, stride, data);
-}
-
-void GLEncoder::s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- ctx->m_state->setState(GLClientState::COLOR_LOCATION, size, type, false, stride, data);
-}
-
-void GLEncoder::s_glPointSizePointerOES(void *self, GLenum type, GLsizei stride, const void *data)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- ctx->m_state->setState(GLClientState::POINTSIZE_LOCATION, 1, type, false, stride, data);
-}
-
-void GLEncoder::s_glClientActiveTexture(void *self, GLenum texture)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- ctx->m_state->setActiveTexture(texture - GL_TEXTURE0);
-}
-
-void GLEncoder::s_glTexCoordPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- int loc = ctx->m_state->getLocation(GL_TEXTURE_COORD_ARRAY);
- ctx->m_state->setState(loc, size, type, false, stride, data);
-}
-
-void GLEncoder::s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- int loc = ctx->m_state->getLocation(GL_MATRIX_INDEX_ARRAY_OES);
- ctx->m_state->setState(loc, size, type, false, stride, data);
-}
-
-void GLEncoder::s_glWeightPointerOES(void * self, int size, GLenum type, GLsizei stride, const void * data)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- int loc = ctx->m_state->getLocation(GL_WEIGHT_ARRAY_OES);
- ctx->m_state->setState(loc, size, type, false, stride, data);
-}
-
-void GLEncoder::s_glEnableClientState(void *self, GLenum state)
-{
- GLEncoder *ctx = (GLEncoder *) self;
- assert(ctx->m_state != NULL);
- int loc = ctx->m_state->getLocation(state);
- ctx->m_state->enable(loc, 1);
-}
-
-void GLEncoder::s_glDisableClientState(void *self, GLenum state)
-{
- GLEncoder *ctx = (GLEncoder *) self;
- assert(ctx->m_state != NULL);
- int loc = ctx->m_state->getLocation(state);
- ctx->m_state->enable(loc, 0);
-}
-
-GLboolean GLEncoder::s_glIsEnabled(void *self, GLenum cap)
-{
- GLEncoder *ctx = (GLEncoder *) self;
- assert(ctx->m_state != NULL);
- int loc = ctx->m_state->getLocation(cap);
- const GLClientState::VertexAttribState *state = ctx->m_state->getState(loc);
-
- if (state!=NULL)
- return state->enabled;
-
- return ctx->m_glIsEnabled_enc(self,cap);
-}
-
-void GLEncoder::s_glBindBuffer(void *self, GLenum target, GLuint id)
-{
- GLEncoder *ctx = (GLEncoder *) self;
- assert(ctx->m_state != NULL);
- ctx->m_state->bindBuffer(target, id);
- // TODO set error state if needed;
- ctx->m_glBindBuffer_enc(self, target, id);
-}
-
-void GLEncoder::s_glBufferData(void * self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage)
-{
- GLEncoder *ctx = (GLEncoder *) self;
- GLuint bufferId = ctx->m_state->getBuffer(target);
- SET_ERROR_IF(bufferId==0, GL_INVALID_OPERATION);
- SET_ERROR_IF(size<0, GL_INVALID_VALUE);
-
- ctx->m_shared->updateBufferData(bufferId, size, (void*)data);
- ctx->m_glBufferData_enc(self, target, size, data, usage);
-}
-
-void GLEncoder::s_glBufferSubData(void * self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data)
-{
- GLEncoder *ctx = (GLEncoder *) self;
- GLuint bufferId = ctx->m_state->getBuffer(target);
- SET_ERROR_IF(bufferId==0, GL_INVALID_OPERATION);
-
- GLenum res = ctx->m_shared->subUpdateBufferData(bufferId, offset, size, (void*)data);
- SET_ERROR_IF(res, res);
-
- ctx->m_glBufferSubData_enc(self, target, offset, size, data);
-}
-
-void GLEncoder::s_glDeleteBuffers(void * self, GLsizei n, const GLuint * buffers)
-{
- GLEncoder *ctx = (GLEncoder *) self;
- SET_ERROR_IF(n<0, GL_INVALID_VALUE);
- for (int i=0; i<n; i++) {
- ctx->m_shared->deleteBufferData(buffers[i]);
- ctx->m_glDeleteBuffers_enc(self,1,&buffers[i]);
- }
-}
-
-void GLEncoder::sendVertexData(unsigned int first, unsigned int count)
-{
- assert(m_state != NULL);
- for (int i = 0; i < GLClientState::LAST_LOCATION; i++) {
- bool enableDirty;
- const GLClientState::VertexAttribState *state = m_state->getStateAndEnableDirty(i, &enableDirty);
-
- // do not process if state not valid
- if (!state) continue;
-
- // do not send disable state if state was already disabled
- if (!enableDirty && !state->enabled) continue;
-
- if ( i >= GLClientState::TEXCOORD0_LOCATION &&
- i <= GLClientState::TEXCOORD7_LOCATION ) {
- m_glClientActiveTexture_enc(this, GL_TEXTURE0 + i - GLClientState::TEXCOORD0_LOCATION);
- }
-
- if (state->enabled) {
-
- if (enableDirty)
- m_glEnableClientState_enc(this, state->glConst);
-
- unsigned int datalen = state->elementSize * count;
- int stride = state->stride;
- if (stride == 0) stride = state->elementSize;
- int firstIndex = stride * first;
-
- this->m_glBindBuffer_enc(this, GL_ARRAY_BUFFER, state->bufferObject);
- if (state->bufferObject == 0) {
-
- switch(i) {
- case GLClientState::VERTEX_LOCATION:
- this->glVertexPointerData(this, state->size, state->type, state->stride,
- (unsigned char *)state->data + firstIndex, datalen);
- break;
- case GLClientState::NORMAL_LOCATION:
- this->glNormalPointerData(this, state->type, state->stride,
- (unsigned char *)state->data + firstIndex, datalen);
- break;
- case GLClientState::COLOR_LOCATION:
- this->glColorPointerData(this, state->size, state->type, state->stride,
- (unsigned char *)state->data + firstIndex, datalen);
- break;
- case GLClientState::TEXCOORD0_LOCATION:
- case GLClientState::TEXCOORD1_LOCATION:
- case GLClientState::TEXCOORD2_LOCATION:
- case GLClientState::TEXCOORD3_LOCATION:
- case GLClientState::TEXCOORD4_LOCATION:
- case GLClientState::TEXCOORD5_LOCATION:
- case GLClientState::TEXCOORD6_LOCATION:
- case GLClientState::TEXCOORD7_LOCATION:
- this->glTexCoordPointerData(this, i - GLClientState::TEXCOORD0_LOCATION, state->size, state->type, state->stride,
- (unsigned char *)state->data + firstIndex, datalen);
- break;
- case GLClientState::POINTSIZE_LOCATION:
- this->glPointSizePointerData(this, state->type, state->stride,
- (unsigned char *) state->data + firstIndex, datalen);
- break;
- case GLClientState::WEIGHT_LOCATION:
- this->glWeightPointerData(this, state->size, state->type, state->stride,
- (unsigned char * ) state->data + firstIndex, datalen);
- break;
- case GLClientState::MATRIXINDEX_LOCATION:
- this->glMatrixIndexPointerData(this, state->size, state->type, state->stride,
- (unsigned char *)state->data + firstIndex, datalen);
- break;
- }
- } else {
-
- switch(i) {
- case GLClientState::VERTEX_LOCATION:
- this->glVertexPointerOffset(this, state->size, state->type, state->stride,
- (uintptr_t)state->data + firstIndex);
- break;
- case GLClientState::NORMAL_LOCATION:
- this->glNormalPointerOffset(this, state->type, state->stride,
- (uintptr_t)state->data + firstIndex);
- break;
- case GLClientState::POINTSIZE_LOCATION:
- this->glPointSizePointerOffset(this, state->type, state->stride,
- (uintptr_t)state->data + firstIndex);
- break;
- case GLClientState::COLOR_LOCATION:
- this->glColorPointerOffset(this, state->size, state->type, state->stride,
- (uintptr_t)state->data + firstIndex);
- break;
- case GLClientState::TEXCOORD0_LOCATION:
- case GLClientState::TEXCOORD1_LOCATION:
- case GLClientState::TEXCOORD2_LOCATION:
- case GLClientState::TEXCOORD3_LOCATION:
- case GLClientState::TEXCOORD4_LOCATION:
- case GLClientState::TEXCOORD5_LOCATION:
- case GLClientState::TEXCOORD6_LOCATION:
- case GLClientState::TEXCOORD7_LOCATION:
- this->glTexCoordPointerOffset(this, state->size, state->type, state->stride,
- (uintptr_t)state->data + firstIndex);
- break;
- case GLClientState::WEIGHT_LOCATION:
- this->glWeightPointerOffset(this,state->size,state->type,state->stride,
- (uintptr_t)state->data+firstIndex);
- break;
- case GLClientState::MATRIXINDEX_LOCATION:
- this->glMatrixIndexPointerOffset(this,state->size,state->type,state->stride,
- (uintptr_t)state->data+firstIndex);
- break;
- }
- }
- this->m_glBindBuffer_enc(this, GL_ARRAY_BUFFER, m_state->currentArrayVbo());
- } else {
- this->m_glDisableClientState_enc(this, state->glConst);
- }
- }
-}
-
-void GLEncoder::s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count)
-{
- GLEncoder *ctx = (GLEncoder *)self;
-
- bool has_arrays = false;
- for (int i = 0; i < GLClientState::LAST_LOCATION; i++) {
- const GLClientState::VertexAttribState *state = ctx->m_state->getState(i);
- if (state->enabled) {
- if (state->bufferObject || state->data) {
- has_arrays = true;
- } else {
- ALOGE("glDrawArrays: a vertex attribute array is enabled with no data bound\n");
- ctx->setError(GL_INVALID_OPERATION);
- return;
- }
- }
- }
- if (!has_arrays) {
- ALOGE("glDrawArrays: no data bound to the command - ignoring\n");
- return;
- }
-
- ctx->sendVertexData(first, count);
- ctx->m_glDrawArrays_enc(ctx, mode, /*first*/ 0, count);
-}
-
-void GLEncoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices)
-{
-
- GLEncoder *ctx = (GLEncoder *)self;
- assert(ctx->m_state != NULL);
- SET_ERROR_IF(count<0, GL_INVALID_VALUE);
-
- bool has_immediate_arrays = false;
- bool has_indirect_arrays = false;
-
- for (int i = 0; i < GLClientState::LAST_LOCATION; i++) {
- const GLClientState::VertexAttribState *state = ctx->m_state->getState(i);
- if (state->enabled) {
- if (state->bufferObject != 0) {
- has_indirect_arrays = true;
- } else if (state->data) {
- has_immediate_arrays = true;
- } else {
- ALOGE("glDrawElements: a vertex attribute array is enabled with no data bound\n");
- ctx->setError(GL_INVALID_OPERATION);
- return;
- }
- }
- }
-
- if (!has_immediate_arrays && !has_indirect_arrays) {
- ALOGE("glDrawElements: no data bound to the command - ignoring\n");
- return;
- }
-
- bool adjustIndices = true;
- if (ctx->m_state->currentIndexVbo() != 0) {
- if (!has_immediate_arrays) {
- ctx->sendVertexData(0, count);
- ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo());
- ctx->glDrawElementsOffset(ctx, mode, count, type, (uintptr_t)indices);
- adjustIndices = false;
- } else {
- BufferData * buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo());
- ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, 0);
- indices = (void*)((GLintptr)buf->m_fixedBuffer.ptr() + (GLintptr)indices);
- }
- }
- if (adjustIndices) {
- void *adjustedIndices = (void*)indices;
- int minIndex = 0, maxIndex = 0;
-
- switch(type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- GLUtils::minmax<unsigned char>((unsigned char *)indices, count, &minIndex, &maxIndex);
- if (minIndex != 0) {
- adjustedIndices = ctx->m_fixedBuffer.alloc(glSizeof(type) * count);
- GLUtils::shiftIndices<unsigned char>((unsigned char *)indices,
- (unsigned char *)adjustedIndices,
- count, -minIndex);
- }
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- GLUtils::minmax<unsigned short>((unsigned short *)indices, count, &minIndex, &maxIndex);
- if (minIndex != 0) {
- adjustedIndices = ctx->m_fixedBuffer.alloc(glSizeof(type) * count);
- GLUtils::shiftIndices<unsigned short>((unsigned short *)indices,
- (unsigned short *)adjustedIndices,
- count, -minIndex);
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- GLUtils::minmax<unsigned int>((unsigned int *)indices, count, &minIndex, &maxIndex);
- if (minIndex != 0) {
- adjustedIndices = ctx->m_fixedBuffer.alloc(glSizeof(type) * count);
- GLUtils::shiftIndices<unsigned int>((unsigned int *)indices,
- (unsigned int *)adjustedIndices,
- count, -minIndex);
- }
- break;
- default:
- ALOGE("unsupported index buffer type %d\n", type);
- }
- if (has_indirect_arrays || 1) {
- ctx->sendVertexData(minIndex, maxIndex - minIndex + 1);
- ctx->glDrawElementsData(ctx, mode, count, type, adjustedIndices,
- count * glSizeof(type));
- // XXX - OPTIMIZATION (see the other else branch) should be implemented
- if(!has_indirect_arrays) {
- //ALOGD("unoptimized drawelements !!!\n");
- }
- } else {
- // we are all direct arrays and immidate mode index array -
- // rebuild the arrays and the index array;
- ALOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
- }
- }
-}
-
-void GLEncoder::s_glActiveTexture(void* self, GLenum texture)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- GLClientState* state = ctx->m_state;
- GLenum err;
-
- if ((err = state->setActiveTextureUnit(texture)) != GL_NO_ERROR) {
- ALOGE("%s:%s:%d GL error %#x\n", __FILE__, __FUNCTION__, __LINE__, err);
- ctx->setError(err);
- return;
- }
-
- ctx->m_glActiveTexture_enc(ctx, texture);
-}
-
-void GLEncoder::s_glBindTexture(void* self, GLenum target, GLuint texture)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- GLClientState* state = ctx->m_state;
- GLenum err;
-
- GLboolean firstUse;
- if ((err = state->bindTexture(target, texture, &firstUse)) != GL_NO_ERROR) {
- ALOGE("%s:%s:%d GL error %#x\n", __FILE__, __FUNCTION__, __LINE__, err);
- ctx->setError(err);
- return;
- }
-
- if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES) {
- ctx->m_glBindTexture_enc(ctx, target, texture);
- return;
- }
-
- GLenum priorityTarget = state->getPriorityEnabledTarget(GL_TEXTURE_2D);
-
- if (target == GL_TEXTURE_EXTERNAL_OES && firstUse) {
- // set TEXTURE_EXTERNAL_OES default states which differ from TEXTURE_2D
- ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
- ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
- GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
- GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
- GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- if (target != priorityTarget) {
- ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
- state->getBoundTexture(GL_TEXTURE_2D));
- }
- }
-
- if (target == priorityTarget) {
- ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
- }
-}
-
-void GLEncoder::s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- GLClientState* state = ctx->m_state;
-
- state->deleteTextures(n, textures);
- ctx->m_glDeleteTextures_enc(ctx, n, textures);
-}
-
-void GLEncoder::s_glDisable(void* self, GLenum cap)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- GLClientState* state = ctx->m_state;
-
- if (cap == GL_TEXTURE_2D || cap == GL_TEXTURE_EXTERNAL_OES) {
- GLenum prevTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
- state->disableTextureTarget(cap);
- GLenum currTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
-
- if (prevTarget != currTarget) {
- if (currTarget == GL_INVALID_ENUM) {
- ctx->m_glDisable_enc(ctx, GL_TEXTURE_2D);
- currTarget = GL_TEXTURE_2D;
- }
- // maintain the invariant that when TEXTURE_EXTERNAL_OES is
- // disabled, the TEXTURE_2D binding is active, even if
- // TEXTURE_2D is also disabled.
- ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
- state->getBoundTexture(currTarget));
- }
-
- } else {
- ctx->m_glDisable_enc(ctx, cap);
- }
-}
-
-void GLEncoder::s_glEnable(void* self, GLenum cap)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- GLClientState* state = ctx->m_state;
-
- if (cap == GL_TEXTURE_2D || cap == GL_TEXTURE_EXTERNAL_OES) {
- GLenum prevTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
- state->enableTextureTarget(cap);
- GLenum currTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
-
- if (prevTarget != currTarget) {
- if (prevTarget == GL_INVALID_ENUM) {
- ctx->m_glEnable_enc(ctx, GL_TEXTURE_2D);
- }
- if (currTarget == GL_TEXTURE_EXTERNAL_OES) {
- ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
- state->getBoundTexture(currTarget));
- }
- }
-
- } else {
- ctx->m_glEnable_enc(ctx, cap);
- }
-}
-
-void GLEncoder::s_glGetTexParameterfv(void* self,
- GLenum target, GLenum pname, GLfloat* params)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- const GLClientState* state = ctx->m_state;
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glGetTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glGetTexParameterfv_enc(ctx, target, pname, params);
- }
-}
-
-void GLEncoder::s_glGetTexParameteriv(void* self,
- GLenum target, GLenum pname, GLint* params)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- const GLClientState* state = ctx->m_state;
-
- switch (pname) {
- case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
- *params = 1;
- break;
-
- default:
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glGetTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glGetTexParameteriv_enc(ctx, target, pname, params);
- }
- break;
- }
-}
-
-void GLEncoder::s_glGetTexParameterxv(void* self,
- GLenum target, GLenum pname, GLfixed* params)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- const GLClientState* state = ctx->m_state;
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glGetTexParameterxv_enc(ctx, GL_TEXTURE_2D, pname, params);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glGetTexParameterxv_enc(ctx, target, pname, params);
- }
-}
-
-static bool isValidTextureExternalParam(GLenum pname, GLenum param)
-{
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- return param == GL_NEAREST || param == GL_LINEAR;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- return param == GL_CLAMP_TO_EDGE;
-
- case GL_GENERATE_MIPMAP:
- return param == GL_FALSE;
-
- default:
- return true;
- }
-}
-
-void GLEncoder::s_glTexParameterf(void* self,
- GLenum target, GLenum pname, GLfloat param)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- const GLClientState* state = ctx->m_state;
-
- SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
- !isValidTextureExternalParam(pname, (GLenum)param)),
- GL_INVALID_ENUM);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexParameterf_enc(ctx, GL_TEXTURE_2D, pname, param);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexParameterf_enc(ctx, target, pname, param);
- }
-}
-
-void GLEncoder::s_glTexParameterfv(void* self,
- GLenum target, GLenum pname, const GLfloat* params)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- const GLClientState* state = ctx->m_state;
-
- SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
- !isValidTextureExternalParam(pname, (GLenum)params[0])),
- GL_INVALID_ENUM);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexParameterfv_enc(ctx, target, pname, params);
- }
-}
-
-void GLEncoder::s_glTexParameteri(void* self,
- GLenum target, GLenum pname, GLint param)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- const GLClientState* state = ctx->m_state;
-
- SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
- !isValidTextureExternalParam(pname, (GLenum)param)),
- GL_INVALID_ENUM);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D, pname, param);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexParameteri_enc(ctx, target, pname, param);
- }
-}
-
-void GLEncoder::s_glTexParameterx(void* self,
- GLenum target, GLenum pname, GLfixed param)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- const GLClientState* state = ctx->m_state;
-
- SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
- !isValidTextureExternalParam(pname, (GLenum)param)),
- GL_INVALID_ENUM);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexParameterx_enc(ctx, GL_TEXTURE_2D, pname, param);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexParameterx_enc(ctx, target, pname, param);
- }
-}
-
-void GLEncoder::s_glTexParameteriv(void* self,
- GLenum target, GLenum pname, const GLint* params)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- const GLClientState* state = ctx->m_state;
-
- SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
- !isValidTextureExternalParam(pname, (GLenum)params[0])),
- GL_INVALID_ENUM);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexParameteriv_enc(ctx, target, pname, params);
- }
-}
-
-void GLEncoder::s_glTexParameterxv(void* self,
- GLenum target, GLenum pname, const GLfixed* params)
-{
- GLEncoder* ctx = (GLEncoder*)self;
- const GLClientState* state = ctx->m_state;
-
- SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
- !isValidTextureExternalParam(pname, (GLenum)params[0])),
- GL_INVALID_ENUM);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexParameterxv_enc(ctx, GL_TEXTURE_2D, pname, params);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexParameterxv_enc(ctx, target, pname, params);
- }
-}
-
-void GLEncoder::override2DTextureTarget(GLenum target)
-{
- if ((target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) &&
- target != m_state->getPriorityEnabledTarget(GL_TEXTURE_2D)) {
- m_glBindTexture_enc(this, GL_TEXTURE_2D,
- m_state->getBoundTexture(target));
- }
-}
-
-void GLEncoder::restore2DTextureTarget()
-{
- GLenum priorityTarget = m_state->getPriorityEnabledTarget(GL_TEXTURE_2D);
- m_glBindTexture_enc(this, GL_TEXTURE_2D,
- m_state->getBoundTexture(priorityTarget));
-}
-
-GLEncoder::GLEncoder(IOStream *stream, ChecksumCalculator *protocol)
- : gl_encoder_context_t(stream, protocol)
-{
- m_initialized = false;
- m_state = NULL;
- m_error = GL_NO_ERROR;
- m_num_compressedTextureFormats = 0;
- m_compressedTextureFormats = NULL;
-
- // overrides;
-#define OVERRIDE(name) m_##name##_enc = this-> name ; this-> name = &s_##name
-
- OVERRIDE(glFlush);
- OVERRIDE(glPixelStorei);
- OVERRIDE(glVertexPointer);
- OVERRIDE(glNormalPointer);
- OVERRIDE(glColorPointer);
- OVERRIDE(glPointSizePointerOES);
- OVERRIDE(glClientActiveTexture);
- OVERRIDE(glTexCoordPointer);
- OVERRIDE(glMatrixIndexPointerOES);
- OVERRIDE(glWeightPointerOES);
-
- OVERRIDE(glGetIntegerv);
- OVERRIDE(glGetFloatv);
- OVERRIDE(glGetBooleanv);
- OVERRIDE(glGetFixedv);
- OVERRIDE(glGetPointerv);
-
- OVERRIDE(glBindBuffer);
- OVERRIDE(glBufferData);
- OVERRIDE(glBufferSubData);
- OVERRIDE(glDeleteBuffers);
-
- OVERRIDE(glEnableClientState);
- OVERRIDE(glDisableClientState);
- OVERRIDE(glIsEnabled);
- OVERRIDE(glDrawArrays);
- OVERRIDE(glDrawElements);
-
- this->glGetString = s_glGetString;
- this->glFinish = s_glFinish;
-
- OVERRIDE(glGetError);
-
- OVERRIDE(glActiveTexture);
- OVERRIDE(glBindTexture);
- OVERRIDE(glDeleteTextures);
- OVERRIDE(glDisable);
- OVERRIDE(glEnable);
- OVERRIDE(glGetTexParameterfv);
- OVERRIDE(glGetTexParameteriv);
- OVERRIDE(glGetTexParameterxv);
- OVERRIDE(glTexParameterf);
- OVERRIDE(glTexParameterfv);
- OVERRIDE(glTexParameteri);
- OVERRIDE(glTexParameterx);
- OVERRIDE(glTexParameteriv);
- OVERRIDE(glTexParameterxv);
-}
-
-GLEncoder::~GLEncoder()
-{
- delete [] m_compressedTextureFormats;
-}
-
-size_t GLEncoder::pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
-{
- assert(m_state != NULL);
- return m_state->pixelDataSize(width, height, format, type, pack);
-}
-
-void GLEncoder::s_glFinish(void *self)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- ctx->glFinishRoundTrip(self);
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _GL_ENCODER_H_
-#define _GL_ENCODER_H_
-
-#include "gl_enc.h"
-#include "GLClientState.h"
-#include "GLSharedGroup.h"
-#include "FixedBuffer.h"
-#include "ChecksumCalculator.h"
-
-class GLEncoder : public gl_encoder_context_t {
-
-public:
- GLEncoder(IOStream *stream, ChecksumCalculator* protocol);
- virtual ~GLEncoder();
- void setClientState(GLClientState *state) {
- m_state = state;
- }
- void setSharedGroup(GLSharedGroupPtr shared) { m_shared = shared; }
- void flush() { m_stream->flush(); }
- size_t pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
-
- void setInitialized(){ m_initialized = true; };
- bool isInitialized(){ return m_initialized; };
-
- virtual void setError(GLenum error){ m_error = error; };
- virtual GLenum getError() { return m_error; };
-
- void override2DTextureTarget(GLenum target);
- void restore2DTextureTarget();
-
-private:
-
- bool m_initialized;
- GLClientState *m_state;
- GLSharedGroupPtr m_shared;
- GLenum m_error;
- FixedBuffer m_fixedBuffer;
- GLint *m_compressedTextureFormats;
- GLint m_num_compressedTextureFormats;
-
- GLint *getCompressedTextureFormats();
- // original functions;
- glGetError_client_proc_t m_glGetError_enc;
- glGetIntegerv_client_proc_t m_glGetIntegerv_enc;
- glGetFloatv_client_proc_t m_glGetFloatv_enc;
- glGetFixedv_client_proc_t m_glGetFixedv_enc;
- glGetBooleanv_client_proc_t m_glGetBooleanv_enc;
- glGetPointerv_client_proc_t m_glGetPointerv_enc;
-
- glPixelStorei_client_proc_t m_glPixelStorei_enc;
- glVertexPointer_client_proc_t m_glVertexPointer_enc;
- glNormalPointer_client_proc_t m_glNormalPointer_enc;
- glColorPointer_client_proc_t m_glColorPointer_enc;
- glPointSizePointerOES_client_proc_t m_glPointSizePointerOES_enc;
- glTexCoordPointer_client_proc_t m_glTexCoordPointer_enc;
- glClientActiveTexture_client_proc_t m_glClientActiveTexture_enc;
- glMatrixIndexPointerOES_client_proc_t m_glMatrixIndexPointerOES_enc;
- glWeightPointerOES_client_proc_t m_glWeightPointerOES_enc;
-
- glBindBuffer_client_proc_t m_glBindBuffer_enc;
- glBufferData_client_proc_t m_glBufferData_enc;
- glBufferSubData_client_proc_t m_glBufferSubData_enc;
- glDeleteBuffers_client_proc_t m_glDeleteBuffers_enc;
-
- glEnableClientState_client_proc_t m_glEnableClientState_enc;
- glDisableClientState_client_proc_t m_glDisableClientState_enc;
- glIsEnabled_client_proc_t m_glIsEnabled_enc;
- glDrawArrays_client_proc_t m_glDrawArrays_enc;
- glDrawElements_client_proc_t m_glDrawElements_enc;
- glFlush_client_proc_t m_glFlush_enc;
-
- glActiveTexture_client_proc_t m_glActiveTexture_enc;
- glBindTexture_client_proc_t m_glBindTexture_enc;
- glDeleteTextures_client_proc_t m_glDeleteTextures_enc;
- glDisable_client_proc_t m_glDisable_enc;
- glEnable_client_proc_t m_glEnable_enc;
- glGetTexParameterfv_client_proc_t m_glGetTexParameterfv_enc;
- glGetTexParameteriv_client_proc_t m_glGetTexParameteriv_enc;
- glGetTexParameterxv_client_proc_t m_glGetTexParameterxv_enc;
- glTexParameterf_client_proc_t m_glTexParameterf_enc;
- glTexParameterfv_client_proc_t m_glTexParameterfv_enc;
- glTexParameteri_client_proc_t m_glTexParameteri_enc;
- glTexParameterx_client_proc_t m_glTexParameterx_enc;
- glTexParameteriv_client_proc_t m_glTexParameteriv_enc;
- glTexParameterxv_client_proc_t m_glTexParameterxv_enc;
-
- // statics
- static GLenum s_glGetError(void * self);
- static void s_glGetIntegerv(void *self, GLenum pname, GLint *ptr);
- static void s_glGetBooleanv(void *self, GLenum pname, GLboolean *ptr);
- static void s_glGetFloatv(void *self, GLenum pname, GLfloat *ptr);
- static void s_glGetFixedv(void *self, GLenum pname, GLfixed *ptr);
- static void s_glGetPointerv(void *self, GLenum pname, GLvoid **params);
-
- static void s_glFlush(void * self);
- static const GLubyte * s_glGetString(void *self, GLenum name);
- static void s_glVertexPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
- static void s_glNormalPointer(void *self, GLenum type, GLsizei stride, const void *data);
- static void s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
- static void s_glPointSizePointerOES(void *self, GLenum type, GLsizei stride, const void *data);
- static void s_glClientActiveTexture(void *self, GLenum texture);
- static void s_glTexCoordPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
- static void s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data);
- static void s_glWeightPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data);
- static void s_glDisableClientState(void *self, GLenum state);
- static void s_glEnableClientState(void *self, GLenum state);
- static GLboolean s_glIsEnabled(void *self, GLenum cap);
- static void s_glBindBuffer(void *self, GLenum target, GLuint id);
- static void s_glBufferData(void *self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
- static void s_glBufferSubData(void *self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
- static void s_glDeleteBuffers(void *self, GLsizei n, const GLuint * buffers);
-
- static void s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count);
- static void s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices);
- static void s_glPixelStorei(void *self, GLenum param, GLint value);
-
- static void s_glFinish(void *self);
- void sendVertexData(unsigned first, unsigned count);
-
- static void s_glActiveTexture(void* self, GLenum texture);
- static void s_glBindTexture(void* self, GLenum target, GLuint texture);
- static void s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures);
- static void s_glDisable(void* self, GLenum cap);
- static void s_glEnable(void* self, GLenum cap);
- static void s_glGetTexParameterfv(void* self, GLenum target, GLenum pname, GLfloat* params);
- static void s_glGetTexParameteriv(void* self, GLenum target, GLenum pname, GLint* params);
- static void s_glGetTexParameterxv(void* self, GLenum target, GLenum pname, GLfixed* params);
- static void s_glTexParameterf(void* self, GLenum target, GLenum pname, GLfloat param);
- static void s_glTexParameterfv(void* self, GLenum target, GLenum pname, const GLfloat* params);
- static void s_glTexParameteri(void* self, GLenum target, GLenum pname, GLint param);
- static void s_glTexParameterx(void* self, GLenum target, GLenum pname, GLfixed param);
- static void s_glTexParameteriv(void* self, GLenum target, GLenum pname, const GLint* params);
- static void s_glTexParameterxv(void* self, GLenum target, GLenum pname, const GLfixed* params);
-
-public:
- glEGLImageTargetTexture2DOES_client_proc_t m_glEGLImageTargetTexture2DOES_enc;
-
-};
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 <stdio.h>
-#include <stdlib.h>
-#include "GLEncoder.h"
-
-namespace glesv1_enc {
-
-size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
-{
- GLEncoder *ctx = (GLEncoder *)self;
- return ctx->pixelDataSize(width, height, format, type, pack);
-}
-
-} // namespace glesv1_enc
+++ /dev/null
-/*
-* Copyright (C) 2011 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 GL_ENCODER_UTILS_H
-#define GL_ENCODER_UTILS_H
-
-namespace glesv1_enc {
- size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
-};
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-
-
-#include <string.h>
-#include "gl_client_context.h"
-
-
-#include <stdio.h>
-
-int gl_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
-{
- glAlphaFunc = (glAlphaFunc_client_proc_t) getProc("glAlphaFunc", userData);
- glClearColor = (glClearColor_client_proc_t) getProc("glClearColor", userData);
- glClearDepthf = (glClearDepthf_client_proc_t) getProc("glClearDepthf", userData);
- glClipPlanef = (glClipPlanef_client_proc_t) getProc("glClipPlanef", userData);
- glColor4f = (glColor4f_client_proc_t) getProc("glColor4f", userData);
- glDepthRangef = (glDepthRangef_client_proc_t) getProc("glDepthRangef", userData);
- glFogf = (glFogf_client_proc_t) getProc("glFogf", userData);
- glFogfv = (glFogfv_client_proc_t) getProc("glFogfv", userData);
- glFrustumf = (glFrustumf_client_proc_t) getProc("glFrustumf", userData);
- glGetClipPlanef = (glGetClipPlanef_client_proc_t) getProc("glGetClipPlanef", userData);
- glGetFloatv = (glGetFloatv_client_proc_t) getProc("glGetFloatv", userData);
- glGetLightfv = (glGetLightfv_client_proc_t) getProc("glGetLightfv", userData);
- glGetMaterialfv = (glGetMaterialfv_client_proc_t) getProc("glGetMaterialfv", userData);
- glGetTexEnvfv = (glGetTexEnvfv_client_proc_t) getProc("glGetTexEnvfv", userData);
- glGetTexParameterfv = (glGetTexParameterfv_client_proc_t) getProc("glGetTexParameterfv", userData);
- glLightModelf = (glLightModelf_client_proc_t) getProc("glLightModelf", userData);
- glLightModelfv = (glLightModelfv_client_proc_t) getProc("glLightModelfv", userData);
- glLightf = (glLightf_client_proc_t) getProc("glLightf", userData);
- glLightfv = (glLightfv_client_proc_t) getProc("glLightfv", userData);
- glLineWidth = (glLineWidth_client_proc_t) getProc("glLineWidth", userData);
- glLoadMatrixf = (glLoadMatrixf_client_proc_t) getProc("glLoadMatrixf", userData);
- glMaterialf = (glMaterialf_client_proc_t) getProc("glMaterialf", userData);
- glMaterialfv = (glMaterialfv_client_proc_t) getProc("glMaterialfv", userData);
- glMultMatrixf = (glMultMatrixf_client_proc_t) getProc("glMultMatrixf", userData);
- glMultiTexCoord4f = (glMultiTexCoord4f_client_proc_t) getProc("glMultiTexCoord4f", userData);
- glNormal3f = (glNormal3f_client_proc_t) getProc("glNormal3f", userData);
- glOrthof = (glOrthof_client_proc_t) getProc("glOrthof", userData);
- glPointParameterf = (glPointParameterf_client_proc_t) getProc("glPointParameterf", userData);
- glPointParameterfv = (glPointParameterfv_client_proc_t) getProc("glPointParameterfv", userData);
- glPointSize = (glPointSize_client_proc_t) getProc("glPointSize", userData);
- glPolygonOffset = (glPolygonOffset_client_proc_t) getProc("glPolygonOffset", userData);
- glRotatef = (glRotatef_client_proc_t) getProc("glRotatef", userData);
- glScalef = (glScalef_client_proc_t) getProc("glScalef", userData);
- glTexEnvf = (glTexEnvf_client_proc_t) getProc("glTexEnvf", userData);
- glTexEnvfv = (glTexEnvfv_client_proc_t) getProc("glTexEnvfv", userData);
- glTexParameterf = (glTexParameterf_client_proc_t) getProc("glTexParameterf", userData);
- glTexParameterfv = (glTexParameterfv_client_proc_t) getProc("glTexParameterfv", userData);
- glTranslatef = (glTranslatef_client_proc_t) getProc("glTranslatef", userData);
- glActiveTexture = (glActiveTexture_client_proc_t) getProc("glActiveTexture", userData);
- glAlphaFuncx = (glAlphaFuncx_client_proc_t) getProc("glAlphaFuncx", userData);
- glBindBuffer = (glBindBuffer_client_proc_t) getProc("glBindBuffer", userData);
- glBindTexture = (glBindTexture_client_proc_t) getProc("glBindTexture", userData);
- glBlendFunc = (glBlendFunc_client_proc_t) getProc("glBlendFunc", userData);
- glBufferData = (glBufferData_client_proc_t) getProc("glBufferData", userData);
- glBufferSubData = (glBufferSubData_client_proc_t) getProc("glBufferSubData", userData);
- glClear = (glClear_client_proc_t) getProc("glClear", userData);
- glClearColorx = (glClearColorx_client_proc_t) getProc("glClearColorx", userData);
- glClearDepthx = (glClearDepthx_client_proc_t) getProc("glClearDepthx", userData);
- glClearStencil = (glClearStencil_client_proc_t) getProc("glClearStencil", userData);
- glClientActiveTexture = (glClientActiveTexture_client_proc_t) getProc("glClientActiveTexture", userData);
- glColor4ub = (glColor4ub_client_proc_t) getProc("glColor4ub", userData);
- glColor4x = (glColor4x_client_proc_t) getProc("glColor4x", userData);
- glColorMask = (glColorMask_client_proc_t) getProc("glColorMask", userData);
- glColorPointer = (glColorPointer_client_proc_t) getProc("glColorPointer", userData);
- glCompressedTexImage2D = (glCompressedTexImage2D_client_proc_t) getProc("glCompressedTexImage2D", userData);
- glCompressedTexSubImage2D = (glCompressedTexSubImage2D_client_proc_t) getProc("glCompressedTexSubImage2D", userData);
- glCopyTexImage2D = (glCopyTexImage2D_client_proc_t) getProc("glCopyTexImage2D", userData);
- glCopyTexSubImage2D = (glCopyTexSubImage2D_client_proc_t) getProc("glCopyTexSubImage2D", userData);
- glCullFace = (glCullFace_client_proc_t) getProc("glCullFace", userData);
- glDeleteBuffers = (glDeleteBuffers_client_proc_t) getProc("glDeleteBuffers", userData);
- glDeleteTextures = (glDeleteTextures_client_proc_t) getProc("glDeleteTextures", userData);
- glDepthFunc = (glDepthFunc_client_proc_t) getProc("glDepthFunc", userData);
- glDepthMask = (glDepthMask_client_proc_t) getProc("glDepthMask", userData);
- glDepthRangex = (glDepthRangex_client_proc_t) getProc("glDepthRangex", userData);
- glDisable = (glDisable_client_proc_t) getProc("glDisable", userData);
- glDisableClientState = (glDisableClientState_client_proc_t) getProc("glDisableClientState", userData);
- glDrawArrays = (glDrawArrays_client_proc_t) getProc("glDrawArrays", userData);
- glDrawElements = (glDrawElements_client_proc_t) getProc("glDrawElements", userData);
- glEnable = (glEnable_client_proc_t) getProc("glEnable", userData);
- glEnableClientState = (glEnableClientState_client_proc_t) getProc("glEnableClientState", userData);
- glFinish = (glFinish_client_proc_t) getProc("glFinish", userData);
- glFlush = (glFlush_client_proc_t) getProc("glFlush", userData);
- glFogx = (glFogx_client_proc_t) getProc("glFogx", userData);
- glFogxv = (glFogxv_client_proc_t) getProc("glFogxv", userData);
- glFrontFace = (glFrontFace_client_proc_t) getProc("glFrontFace", userData);
- glFrustumx = (glFrustumx_client_proc_t) getProc("glFrustumx", userData);
- glGetBooleanv = (glGetBooleanv_client_proc_t) getProc("glGetBooleanv", userData);
- glGetBufferParameteriv = (glGetBufferParameteriv_client_proc_t) getProc("glGetBufferParameteriv", userData);
- glClipPlanex = (glClipPlanex_client_proc_t) getProc("glClipPlanex", userData);
- glGenBuffers = (glGenBuffers_client_proc_t) getProc("glGenBuffers", userData);
- glGenTextures = (glGenTextures_client_proc_t) getProc("glGenTextures", userData);
- glGetError = (glGetError_client_proc_t) getProc("glGetError", userData);
- glGetFixedv = (glGetFixedv_client_proc_t) getProc("glGetFixedv", userData);
- glGetIntegerv = (glGetIntegerv_client_proc_t) getProc("glGetIntegerv", userData);
- glGetLightxv = (glGetLightxv_client_proc_t) getProc("glGetLightxv", userData);
- glGetMaterialxv = (glGetMaterialxv_client_proc_t) getProc("glGetMaterialxv", userData);
- glGetPointerv = (glGetPointerv_client_proc_t) getProc("glGetPointerv", userData);
- glGetString = (glGetString_client_proc_t) getProc("glGetString", userData);
- glGetTexEnviv = (glGetTexEnviv_client_proc_t) getProc("glGetTexEnviv", userData);
- glGetTexEnvxv = (glGetTexEnvxv_client_proc_t) getProc("glGetTexEnvxv", userData);
- glGetTexParameteriv = (glGetTexParameteriv_client_proc_t) getProc("glGetTexParameteriv", userData);
- glGetTexParameterxv = (glGetTexParameterxv_client_proc_t) getProc("glGetTexParameterxv", userData);
- glHint = (glHint_client_proc_t) getProc("glHint", userData);
- glIsBuffer = (glIsBuffer_client_proc_t) getProc("glIsBuffer", userData);
- glIsEnabled = (glIsEnabled_client_proc_t) getProc("glIsEnabled", userData);
- glIsTexture = (glIsTexture_client_proc_t) getProc("glIsTexture", userData);
- glLightModelx = (glLightModelx_client_proc_t) getProc("glLightModelx", userData);
- glLightModelxv = (glLightModelxv_client_proc_t) getProc("glLightModelxv", userData);
- glLightx = (glLightx_client_proc_t) getProc("glLightx", userData);
- glLightxv = (glLightxv_client_proc_t) getProc("glLightxv", userData);
- glLineWidthx = (glLineWidthx_client_proc_t) getProc("glLineWidthx", userData);
- glLoadIdentity = (glLoadIdentity_client_proc_t) getProc("glLoadIdentity", userData);
- glLoadMatrixx = (glLoadMatrixx_client_proc_t) getProc("glLoadMatrixx", userData);
- glLogicOp = (glLogicOp_client_proc_t) getProc("glLogicOp", userData);
- glMaterialx = (glMaterialx_client_proc_t) getProc("glMaterialx", userData);
- glMaterialxv = (glMaterialxv_client_proc_t) getProc("glMaterialxv", userData);
- glMatrixMode = (glMatrixMode_client_proc_t) getProc("glMatrixMode", userData);
- glMultMatrixx = (glMultMatrixx_client_proc_t) getProc("glMultMatrixx", userData);
- glMultiTexCoord4x = (glMultiTexCoord4x_client_proc_t) getProc("glMultiTexCoord4x", userData);
- glNormal3x = (glNormal3x_client_proc_t) getProc("glNormal3x", userData);
- glNormalPointer = (glNormalPointer_client_proc_t) getProc("glNormalPointer", userData);
- glOrthox = (glOrthox_client_proc_t) getProc("glOrthox", userData);
- glPixelStorei = (glPixelStorei_client_proc_t) getProc("glPixelStorei", userData);
- glPointParameterx = (glPointParameterx_client_proc_t) getProc("glPointParameterx", userData);
- glPointParameterxv = (glPointParameterxv_client_proc_t) getProc("glPointParameterxv", userData);
- glPointSizex = (glPointSizex_client_proc_t) getProc("glPointSizex", userData);
- glPolygonOffsetx = (glPolygonOffsetx_client_proc_t) getProc("glPolygonOffsetx", userData);
- glPopMatrix = (glPopMatrix_client_proc_t) getProc("glPopMatrix", userData);
- glPushMatrix = (glPushMatrix_client_proc_t) getProc("glPushMatrix", userData);
- glReadPixels = (glReadPixels_client_proc_t) getProc("glReadPixels", userData);
- glRotatex = (glRotatex_client_proc_t) getProc("glRotatex", userData);
- glSampleCoverage = (glSampleCoverage_client_proc_t) getProc("glSampleCoverage", userData);
- glSampleCoveragex = (glSampleCoveragex_client_proc_t) getProc("glSampleCoveragex", userData);
- glScalex = (glScalex_client_proc_t) getProc("glScalex", userData);
- glScissor = (glScissor_client_proc_t) getProc("glScissor", userData);
- glShadeModel = (glShadeModel_client_proc_t) getProc("glShadeModel", userData);
- glStencilFunc = (glStencilFunc_client_proc_t) getProc("glStencilFunc", userData);
- glStencilMask = (glStencilMask_client_proc_t) getProc("glStencilMask", userData);
- glStencilOp = (glStencilOp_client_proc_t) getProc("glStencilOp", userData);
- glTexCoordPointer = (glTexCoordPointer_client_proc_t) getProc("glTexCoordPointer", userData);
- glTexEnvi = (glTexEnvi_client_proc_t) getProc("glTexEnvi", userData);
- glTexEnvx = (glTexEnvx_client_proc_t) getProc("glTexEnvx", userData);
- glTexEnviv = (glTexEnviv_client_proc_t) getProc("glTexEnviv", userData);
- glTexEnvxv = (glTexEnvxv_client_proc_t) getProc("glTexEnvxv", userData);
- glTexImage2D = (glTexImage2D_client_proc_t) getProc("glTexImage2D", userData);
- glTexParameteri = (glTexParameteri_client_proc_t) getProc("glTexParameteri", userData);
- glTexParameterx = (glTexParameterx_client_proc_t) getProc("glTexParameterx", userData);
- glTexParameteriv = (glTexParameteriv_client_proc_t) getProc("glTexParameteriv", userData);
- glTexParameterxv = (glTexParameterxv_client_proc_t) getProc("glTexParameterxv", userData);
- glTexSubImage2D = (glTexSubImage2D_client_proc_t) getProc("glTexSubImage2D", userData);
- glTranslatex = (glTranslatex_client_proc_t) getProc("glTranslatex", userData);
- glVertexPointer = (glVertexPointer_client_proc_t) getProc("glVertexPointer", userData);
- glViewport = (glViewport_client_proc_t) getProc("glViewport", userData);
- glPointSizePointerOES = (glPointSizePointerOES_client_proc_t) getProc("glPointSizePointerOES", userData);
- glVertexPointerOffset = (glVertexPointerOffset_client_proc_t) getProc("glVertexPointerOffset", userData);
- glColorPointerOffset = (glColorPointerOffset_client_proc_t) getProc("glColorPointerOffset", userData);
- glNormalPointerOffset = (glNormalPointerOffset_client_proc_t) getProc("glNormalPointerOffset", userData);
- glPointSizePointerOffset = (glPointSizePointerOffset_client_proc_t) getProc("glPointSizePointerOffset", userData);
- glTexCoordPointerOffset = (glTexCoordPointerOffset_client_proc_t) getProc("glTexCoordPointerOffset", userData);
- glWeightPointerOffset = (glWeightPointerOffset_client_proc_t) getProc("glWeightPointerOffset", userData);
- glMatrixIndexPointerOffset = (glMatrixIndexPointerOffset_client_proc_t) getProc("glMatrixIndexPointerOffset", userData);
- glVertexPointerData = (glVertexPointerData_client_proc_t) getProc("glVertexPointerData", userData);
- glColorPointerData = (glColorPointerData_client_proc_t) getProc("glColorPointerData", userData);
- glNormalPointerData = (glNormalPointerData_client_proc_t) getProc("glNormalPointerData", userData);
- glTexCoordPointerData = (glTexCoordPointerData_client_proc_t) getProc("glTexCoordPointerData", userData);
- glPointSizePointerData = (glPointSizePointerData_client_proc_t) getProc("glPointSizePointerData", userData);
- glWeightPointerData = (glWeightPointerData_client_proc_t) getProc("glWeightPointerData", userData);
- glMatrixIndexPointerData = (glMatrixIndexPointerData_client_proc_t) getProc("glMatrixIndexPointerData", userData);
- glDrawElementsOffset = (glDrawElementsOffset_client_proc_t) getProc("glDrawElementsOffset", userData);
- glDrawElementsData = (glDrawElementsData_client_proc_t) getProc("glDrawElementsData", userData);
- glGetCompressedTextureFormats = (glGetCompressedTextureFormats_client_proc_t) getProc("glGetCompressedTextureFormats", userData);
- glFinishRoundTrip = (glFinishRoundTrip_client_proc_t) getProc("glFinishRoundTrip", userData);
- glBlendEquationSeparateOES = (glBlendEquationSeparateOES_client_proc_t) getProc("glBlendEquationSeparateOES", userData);
- glBlendFuncSeparateOES = (glBlendFuncSeparateOES_client_proc_t) getProc("glBlendFuncSeparateOES", userData);
- glBlendEquationOES = (glBlendEquationOES_client_proc_t) getProc("glBlendEquationOES", userData);
- glDrawTexsOES = (glDrawTexsOES_client_proc_t) getProc("glDrawTexsOES", userData);
- glDrawTexiOES = (glDrawTexiOES_client_proc_t) getProc("glDrawTexiOES", userData);
- glDrawTexxOES = (glDrawTexxOES_client_proc_t) getProc("glDrawTexxOES", userData);
- glDrawTexsvOES = (glDrawTexsvOES_client_proc_t) getProc("glDrawTexsvOES", userData);
- glDrawTexivOES = (glDrawTexivOES_client_proc_t) getProc("glDrawTexivOES", userData);
- glDrawTexxvOES = (glDrawTexxvOES_client_proc_t) getProc("glDrawTexxvOES", userData);
- glDrawTexfOES = (glDrawTexfOES_client_proc_t) getProc("glDrawTexfOES", userData);
- glDrawTexfvOES = (glDrawTexfvOES_client_proc_t) getProc("glDrawTexfvOES", userData);
- glEGLImageTargetTexture2DOES = (glEGLImageTargetTexture2DOES_client_proc_t) getProc("glEGLImageTargetTexture2DOES", userData);
- glEGLImageTargetRenderbufferStorageOES = (glEGLImageTargetRenderbufferStorageOES_client_proc_t) getProc("glEGLImageTargetRenderbufferStorageOES", userData);
- glAlphaFuncxOES = (glAlphaFuncxOES_client_proc_t) getProc("glAlphaFuncxOES", userData);
- glClearColorxOES = (glClearColorxOES_client_proc_t) getProc("glClearColorxOES", userData);
- glClearDepthxOES = (glClearDepthxOES_client_proc_t) getProc("glClearDepthxOES", userData);
- glClipPlanexOES = (glClipPlanexOES_client_proc_t) getProc("glClipPlanexOES", userData);
- glClipPlanexIMG = (glClipPlanexIMG_client_proc_t) getProc("glClipPlanexIMG", userData);
- glColor4xOES = (glColor4xOES_client_proc_t) getProc("glColor4xOES", userData);
- glDepthRangexOES = (glDepthRangexOES_client_proc_t) getProc("glDepthRangexOES", userData);
- glFogxOES = (glFogxOES_client_proc_t) getProc("glFogxOES", userData);
- glFogxvOES = (glFogxvOES_client_proc_t) getProc("glFogxvOES", userData);
- glFrustumxOES = (glFrustumxOES_client_proc_t) getProc("glFrustumxOES", userData);
- glGetClipPlanexOES = (glGetClipPlanexOES_client_proc_t) getProc("glGetClipPlanexOES", userData);
- glGetClipPlanex = (glGetClipPlanex_client_proc_t) getProc("glGetClipPlanex", userData);
- glGetFixedvOES = (glGetFixedvOES_client_proc_t) getProc("glGetFixedvOES", userData);
- glGetLightxvOES = (glGetLightxvOES_client_proc_t) getProc("glGetLightxvOES", userData);
- glGetMaterialxvOES = (glGetMaterialxvOES_client_proc_t) getProc("glGetMaterialxvOES", userData);
- glGetTexEnvxvOES = (glGetTexEnvxvOES_client_proc_t) getProc("glGetTexEnvxvOES", userData);
- glGetTexParameterxvOES = (glGetTexParameterxvOES_client_proc_t) getProc("glGetTexParameterxvOES", userData);
- glLightModelxOES = (glLightModelxOES_client_proc_t) getProc("glLightModelxOES", userData);
- glLightModelxvOES = (glLightModelxvOES_client_proc_t) getProc("glLightModelxvOES", userData);
- glLightxOES = (glLightxOES_client_proc_t) getProc("glLightxOES", userData);
- glLightxvOES = (glLightxvOES_client_proc_t) getProc("glLightxvOES", userData);
- glLineWidthxOES = (glLineWidthxOES_client_proc_t) getProc("glLineWidthxOES", userData);
- glLoadMatrixxOES = (glLoadMatrixxOES_client_proc_t) getProc("glLoadMatrixxOES", userData);
- glMaterialxOES = (glMaterialxOES_client_proc_t) getProc("glMaterialxOES", userData);
- glMaterialxvOES = (glMaterialxvOES_client_proc_t) getProc("glMaterialxvOES", userData);
- glMultMatrixxOES = (glMultMatrixxOES_client_proc_t) getProc("glMultMatrixxOES", userData);
- glMultiTexCoord4xOES = (glMultiTexCoord4xOES_client_proc_t) getProc("glMultiTexCoord4xOES", userData);
- glNormal3xOES = (glNormal3xOES_client_proc_t) getProc("glNormal3xOES", userData);
- glOrthoxOES = (glOrthoxOES_client_proc_t) getProc("glOrthoxOES", userData);
- glPointParameterxOES = (glPointParameterxOES_client_proc_t) getProc("glPointParameterxOES", userData);
- glPointParameterxvOES = (glPointParameterxvOES_client_proc_t) getProc("glPointParameterxvOES", userData);
- glPointSizexOES = (glPointSizexOES_client_proc_t) getProc("glPointSizexOES", userData);
- glPolygonOffsetxOES = (glPolygonOffsetxOES_client_proc_t) getProc("glPolygonOffsetxOES", userData);
- glRotatexOES = (glRotatexOES_client_proc_t) getProc("glRotatexOES", userData);
- glSampleCoveragexOES = (glSampleCoveragexOES_client_proc_t) getProc("glSampleCoveragexOES", userData);
- glScalexOES = (glScalexOES_client_proc_t) getProc("glScalexOES", userData);
- glTexEnvxOES = (glTexEnvxOES_client_proc_t) getProc("glTexEnvxOES", userData);
- glTexEnvxvOES = (glTexEnvxvOES_client_proc_t) getProc("glTexEnvxvOES", userData);
- glTexParameterxOES = (glTexParameterxOES_client_proc_t) getProc("glTexParameterxOES", userData);
- glTexParameterxvOES = (glTexParameterxvOES_client_proc_t) getProc("glTexParameterxvOES", userData);
- glTranslatexOES = (glTranslatexOES_client_proc_t) getProc("glTranslatexOES", userData);
- glIsRenderbufferOES = (glIsRenderbufferOES_client_proc_t) getProc("glIsRenderbufferOES", userData);
- glBindRenderbufferOES = (glBindRenderbufferOES_client_proc_t) getProc("glBindRenderbufferOES", userData);
- glDeleteRenderbuffersOES = (glDeleteRenderbuffersOES_client_proc_t) getProc("glDeleteRenderbuffersOES", userData);
- glGenRenderbuffersOES = (glGenRenderbuffersOES_client_proc_t) getProc("glGenRenderbuffersOES", userData);
- glRenderbufferStorageOES = (glRenderbufferStorageOES_client_proc_t) getProc("glRenderbufferStorageOES", userData);
- glGetRenderbufferParameterivOES = (glGetRenderbufferParameterivOES_client_proc_t) getProc("glGetRenderbufferParameterivOES", userData);
- glIsFramebufferOES = (glIsFramebufferOES_client_proc_t) getProc("glIsFramebufferOES", userData);
- glBindFramebufferOES = (glBindFramebufferOES_client_proc_t) getProc("glBindFramebufferOES", userData);
- glDeleteFramebuffersOES = (glDeleteFramebuffersOES_client_proc_t) getProc("glDeleteFramebuffersOES", userData);
- glGenFramebuffersOES = (glGenFramebuffersOES_client_proc_t) getProc("glGenFramebuffersOES", userData);
- glCheckFramebufferStatusOES = (glCheckFramebufferStatusOES_client_proc_t) getProc("glCheckFramebufferStatusOES", userData);
- glFramebufferRenderbufferOES = (glFramebufferRenderbufferOES_client_proc_t) getProc("glFramebufferRenderbufferOES", userData);
- glFramebufferTexture2DOES = (glFramebufferTexture2DOES_client_proc_t) getProc("glFramebufferTexture2DOES", userData);
- glGetFramebufferAttachmentParameterivOES = (glGetFramebufferAttachmentParameterivOES_client_proc_t) getProc("glGetFramebufferAttachmentParameterivOES", userData);
- glGenerateMipmapOES = (glGenerateMipmapOES_client_proc_t) getProc("glGenerateMipmapOES", userData);
- glMapBufferOES = (glMapBufferOES_client_proc_t) getProc("glMapBufferOES", userData);
- glUnmapBufferOES = (glUnmapBufferOES_client_proc_t) getProc("glUnmapBufferOES", userData);
- glGetBufferPointervOES = (glGetBufferPointervOES_client_proc_t) getProc("glGetBufferPointervOES", userData);
- glCurrentPaletteMatrixOES = (glCurrentPaletteMatrixOES_client_proc_t) getProc("glCurrentPaletteMatrixOES", userData);
- glLoadPaletteFromModelViewMatrixOES = (glLoadPaletteFromModelViewMatrixOES_client_proc_t) getProc("glLoadPaletteFromModelViewMatrixOES", userData);
- glMatrixIndexPointerOES = (glMatrixIndexPointerOES_client_proc_t) getProc("glMatrixIndexPointerOES", userData);
- glWeightPointerOES = (glWeightPointerOES_client_proc_t) getProc("glWeightPointerOES", userData);
- glQueryMatrixxOES = (glQueryMatrixxOES_client_proc_t) getProc("glQueryMatrixxOES", userData);
- glDepthRangefOES = (glDepthRangefOES_client_proc_t) getProc("glDepthRangefOES", userData);
- glFrustumfOES = (glFrustumfOES_client_proc_t) getProc("glFrustumfOES", userData);
- glOrthofOES = (glOrthofOES_client_proc_t) getProc("glOrthofOES", userData);
- glClipPlanefOES = (glClipPlanefOES_client_proc_t) getProc("glClipPlanefOES", userData);
- glClipPlanefIMG = (glClipPlanefIMG_client_proc_t) getProc("glClipPlanefIMG", userData);
- glGetClipPlanefOES = (glGetClipPlanefOES_client_proc_t) getProc("glGetClipPlanefOES", userData);
- glClearDepthfOES = (glClearDepthfOES_client_proc_t) getProc("glClearDepthfOES", userData);
- glTexGenfOES = (glTexGenfOES_client_proc_t) getProc("glTexGenfOES", userData);
- glTexGenfvOES = (glTexGenfvOES_client_proc_t) getProc("glTexGenfvOES", userData);
- glTexGeniOES = (glTexGeniOES_client_proc_t) getProc("glTexGeniOES", userData);
- glTexGenivOES = (glTexGenivOES_client_proc_t) getProc("glTexGenivOES", userData);
- glTexGenxOES = (glTexGenxOES_client_proc_t) getProc("glTexGenxOES", userData);
- glTexGenxvOES = (glTexGenxvOES_client_proc_t) getProc("glTexGenxvOES", userData);
- glGetTexGenfvOES = (glGetTexGenfvOES_client_proc_t) getProc("glGetTexGenfvOES", userData);
- glGetTexGenivOES = (glGetTexGenivOES_client_proc_t) getProc("glGetTexGenivOES", userData);
- glGetTexGenxvOES = (glGetTexGenxvOES_client_proc_t) getProc("glGetTexGenxvOES", userData);
- glBindVertexArrayOES = (glBindVertexArrayOES_client_proc_t) getProc("glBindVertexArrayOES", userData);
- glDeleteVertexArraysOES = (glDeleteVertexArraysOES_client_proc_t) getProc("glDeleteVertexArraysOES", userData);
- glGenVertexArraysOES = (glGenVertexArraysOES_client_proc_t) getProc("glGenVertexArraysOES", userData);
- glIsVertexArrayOES = (glIsVertexArrayOES_client_proc_t) getProc("glIsVertexArrayOES", userData);
- glDiscardFramebufferEXT = (glDiscardFramebufferEXT_client_proc_t) getProc("glDiscardFramebufferEXT", userData);
- glMultiDrawArraysEXT = (glMultiDrawArraysEXT_client_proc_t) getProc("glMultiDrawArraysEXT", userData);
- glMultiDrawElementsEXT = (glMultiDrawElementsEXT_client_proc_t) getProc("glMultiDrawElementsEXT", userData);
- glMultiDrawArraysSUN = (glMultiDrawArraysSUN_client_proc_t) getProc("glMultiDrawArraysSUN", userData);
- glMultiDrawElementsSUN = (glMultiDrawElementsSUN_client_proc_t) getProc("glMultiDrawElementsSUN", userData);
- glRenderbufferStorageMultisampleIMG = (glRenderbufferStorageMultisampleIMG_client_proc_t) getProc("glRenderbufferStorageMultisampleIMG", userData);
- glFramebufferTexture2DMultisampleIMG = (glFramebufferTexture2DMultisampleIMG_client_proc_t) getProc("glFramebufferTexture2DMultisampleIMG", userData);
- glDeleteFencesNV = (glDeleteFencesNV_client_proc_t) getProc("glDeleteFencesNV", userData);
- glGenFencesNV = (glGenFencesNV_client_proc_t) getProc("glGenFencesNV", userData);
- glIsFenceNV = (glIsFenceNV_client_proc_t) getProc("glIsFenceNV", userData);
- glTestFenceNV = (glTestFenceNV_client_proc_t) getProc("glTestFenceNV", userData);
- glGetFenceivNV = (glGetFenceivNV_client_proc_t) getProc("glGetFenceivNV", userData);
- glFinishFenceNV = (glFinishFenceNV_client_proc_t) getProc("glFinishFenceNV", userData);
- glSetFenceNV = (glSetFenceNV_client_proc_t) getProc("glSetFenceNV", userData);
- glGetDriverControlsQCOM = (glGetDriverControlsQCOM_client_proc_t) getProc("glGetDriverControlsQCOM", userData);
- glGetDriverControlStringQCOM = (glGetDriverControlStringQCOM_client_proc_t) getProc("glGetDriverControlStringQCOM", userData);
- glEnableDriverControlQCOM = (glEnableDriverControlQCOM_client_proc_t) getProc("glEnableDriverControlQCOM", userData);
- glDisableDriverControlQCOM = (glDisableDriverControlQCOM_client_proc_t) getProc("glDisableDriverControlQCOM", userData);
- glExtGetTexturesQCOM = (glExtGetTexturesQCOM_client_proc_t) getProc("glExtGetTexturesQCOM", userData);
- glExtGetBuffersQCOM = (glExtGetBuffersQCOM_client_proc_t) getProc("glExtGetBuffersQCOM", userData);
- glExtGetRenderbuffersQCOM = (glExtGetRenderbuffersQCOM_client_proc_t) getProc("glExtGetRenderbuffersQCOM", userData);
- glExtGetFramebuffersQCOM = (glExtGetFramebuffersQCOM_client_proc_t) getProc("glExtGetFramebuffersQCOM", userData);
- glExtGetTexLevelParameterivQCOM = (glExtGetTexLevelParameterivQCOM_client_proc_t) getProc("glExtGetTexLevelParameterivQCOM", userData);
- glExtTexObjectStateOverrideiQCOM = (glExtTexObjectStateOverrideiQCOM_client_proc_t) getProc("glExtTexObjectStateOverrideiQCOM", userData);
- glExtGetTexSubImageQCOM = (glExtGetTexSubImageQCOM_client_proc_t) getProc("glExtGetTexSubImageQCOM", userData);
- glExtGetBufferPointervQCOM = (glExtGetBufferPointervQCOM_client_proc_t) getProc("glExtGetBufferPointervQCOM", userData);
- glExtGetShadersQCOM = (glExtGetShadersQCOM_client_proc_t) getProc("glExtGetShadersQCOM", userData);
- glExtGetProgramsQCOM = (glExtGetProgramsQCOM_client_proc_t) getProc("glExtGetProgramsQCOM", userData);
- glExtIsProgramBinaryQCOM = (glExtIsProgramBinaryQCOM_client_proc_t) getProc("glExtIsProgramBinaryQCOM", userData);
- glExtGetProgramBinarySourceQCOM = (glExtGetProgramBinarySourceQCOM_client_proc_t) getProc("glExtGetProgramBinarySourceQCOM", userData);
- glStartTilingQCOM = (glStartTilingQCOM_client_proc_t) getProc("glStartTilingQCOM", userData);
- glEndTilingQCOM = (glEndTilingQCOM_client_proc_t) getProc("glEndTilingQCOM", userData);
- return 0;
-}
-
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __gl_client_context_t_h
-#define __gl_client_context_t_h
-
-#include "gl_client_proc.h"
-
-#include "gl_types.h"
-
-
-struct gl_client_context_t {
-
- glAlphaFunc_client_proc_t glAlphaFunc;
- glClearColor_client_proc_t glClearColor;
- glClearDepthf_client_proc_t glClearDepthf;
- glClipPlanef_client_proc_t glClipPlanef;
- glColor4f_client_proc_t glColor4f;
- glDepthRangef_client_proc_t glDepthRangef;
- glFogf_client_proc_t glFogf;
- glFogfv_client_proc_t glFogfv;
- glFrustumf_client_proc_t glFrustumf;
- glGetClipPlanef_client_proc_t glGetClipPlanef;
- glGetFloatv_client_proc_t glGetFloatv;
- glGetLightfv_client_proc_t glGetLightfv;
- glGetMaterialfv_client_proc_t glGetMaterialfv;
- glGetTexEnvfv_client_proc_t glGetTexEnvfv;
- glGetTexParameterfv_client_proc_t glGetTexParameterfv;
- glLightModelf_client_proc_t glLightModelf;
- glLightModelfv_client_proc_t glLightModelfv;
- glLightf_client_proc_t glLightf;
- glLightfv_client_proc_t glLightfv;
- glLineWidth_client_proc_t glLineWidth;
- glLoadMatrixf_client_proc_t glLoadMatrixf;
- glMaterialf_client_proc_t glMaterialf;
- glMaterialfv_client_proc_t glMaterialfv;
- glMultMatrixf_client_proc_t glMultMatrixf;
- glMultiTexCoord4f_client_proc_t glMultiTexCoord4f;
- glNormal3f_client_proc_t glNormal3f;
- glOrthof_client_proc_t glOrthof;
- glPointParameterf_client_proc_t glPointParameterf;
- glPointParameterfv_client_proc_t glPointParameterfv;
- glPointSize_client_proc_t glPointSize;
- glPolygonOffset_client_proc_t glPolygonOffset;
- glRotatef_client_proc_t glRotatef;
- glScalef_client_proc_t glScalef;
- glTexEnvf_client_proc_t glTexEnvf;
- glTexEnvfv_client_proc_t glTexEnvfv;
- glTexParameterf_client_proc_t glTexParameterf;
- glTexParameterfv_client_proc_t glTexParameterfv;
- glTranslatef_client_proc_t glTranslatef;
- glActiveTexture_client_proc_t glActiveTexture;
- glAlphaFuncx_client_proc_t glAlphaFuncx;
- glBindBuffer_client_proc_t glBindBuffer;
- glBindTexture_client_proc_t glBindTexture;
- glBlendFunc_client_proc_t glBlendFunc;
- glBufferData_client_proc_t glBufferData;
- glBufferSubData_client_proc_t glBufferSubData;
- glClear_client_proc_t glClear;
- glClearColorx_client_proc_t glClearColorx;
- glClearDepthx_client_proc_t glClearDepthx;
- glClearStencil_client_proc_t glClearStencil;
- glClientActiveTexture_client_proc_t glClientActiveTexture;
- glColor4ub_client_proc_t glColor4ub;
- glColor4x_client_proc_t glColor4x;
- glColorMask_client_proc_t glColorMask;
- glColorPointer_client_proc_t glColorPointer;
- glCompressedTexImage2D_client_proc_t glCompressedTexImage2D;
- glCompressedTexSubImage2D_client_proc_t glCompressedTexSubImage2D;
- glCopyTexImage2D_client_proc_t glCopyTexImage2D;
- glCopyTexSubImage2D_client_proc_t glCopyTexSubImage2D;
- glCullFace_client_proc_t glCullFace;
- glDeleteBuffers_client_proc_t glDeleteBuffers;
- glDeleteTextures_client_proc_t glDeleteTextures;
- glDepthFunc_client_proc_t glDepthFunc;
- glDepthMask_client_proc_t glDepthMask;
- glDepthRangex_client_proc_t glDepthRangex;
- glDisable_client_proc_t glDisable;
- glDisableClientState_client_proc_t glDisableClientState;
- glDrawArrays_client_proc_t glDrawArrays;
- glDrawElements_client_proc_t glDrawElements;
- glEnable_client_proc_t glEnable;
- glEnableClientState_client_proc_t glEnableClientState;
- glFinish_client_proc_t glFinish;
- glFlush_client_proc_t glFlush;
- glFogx_client_proc_t glFogx;
- glFogxv_client_proc_t glFogxv;
- glFrontFace_client_proc_t glFrontFace;
- glFrustumx_client_proc_t glFrustumx;
- glGetBooleanv_client_proc_t glGetBooleanv;
- glGetBufferParameteriv_client_proc_t glGetBufferParameteriv;
- glClipPlanex_client_proc_t glClipPlanex;
- glGenBuffers_client_proc_t glGenBuffers;
- glGenTextures_client_proc_t glGenTextures;
- glGetError_client_proc_t glGetError;
- glGetFixedv_client_proc_t glGetFixedv;
- glGetIntegerv_client_proc_t glGetIntegerv;
- glGetLightxv_client_proc_t glGetLightxv;
- glGetMaterialxv_client_proc_t glGetMaterialxv;
- glGetPointerv_client_proc_t glGetPointerv;
- glGetString_client_proc_t glGetString;
- glGetTexEnviv_client_proc_t glGetTexEnviv;
- glGetTexEnvxv_client_proc_t glGetTexEnvxv;
- glGetTexParameteriv_client_proc_t glGetTexParameteriv;
- glGetTexParameterxv_client_proc_t glGetTexParameterxv;
- glHint_client_proc_t glHint;
- glIsBuffer_client_proc_t glIsBuffer;
- glIsEnabled_client_proc_t glIsEnabled;
- glIsTexture_client_proc_t glIsTexture;
- glLightModelx_client_proc_t glLightModelx;
- glLightModelxv_client_proc_t glLightModelxv;
- glLightx_client_proc_t glLightx;
- glLightxv_client_proc_t glLightxv;
- glLineWidthx_client_proc_t glLineWidthx;
- glLoadIdentity_client_proc_t glLoadIdentity;
- glLoadMatrixx_client_proc_t glLoadMatrixx;
- glLogicOp_client_proc_t glLogicOp;
- glMaterialx_client_proc_t glMaterialx;
- glMaterialxv_client_proc_t glMaterialxv;
- glMatrixMode_client_proc_t glMatrixMode;
- glMultMatrixx_client_proc_t glMultMatrixx;
- glMultiTexCoord4x_client_proc_t glMultiTexCoord4x;
- glNormal3x_client_proc_t glNormal3x;
- glNormalPointer_client_proc_t glNormalPointer;
- glOrthox_client_proc_t glOrthox;
- glPixelStorei_client_proc_t glPixelStorei;
- glPointParameterx_client_proc_t glPointParameterx;
- glPointParameterxv_client_proc_t glPointParameterxv;
- glPointSizex_client_proc_t glPointSizex;
- glPolygonOffsetx_client_proc_t glPolygonOffsetx;
- glPopMatrix_client_proc_t glPopMatrix;
- glPushMatrix_client_proc_t glPushMatrix;
- glReadPixels_client_proc_t glReadPixels;
- glRotatex_client_proc_t glRotatex;
- glSampleCoverage_client_proc_t glSampleCoverage;
- glSampleCoveragex_client_proc_t glSampleCoveragex;
- glScalex_client_proc_t glScalex;
- glScissor_client_proc_t glScissor;
- glShadeModel_client_proc_t glShadeModel;
- glStencilFunc_client_proc_t glStencilFunc;
- glStencilMask_client_proc_t glStencilMask;
- glStencilOp_client_proc_t glStencilOp;
- glTexCoordPointer_client_proc_t glTexCoordPointer;
- glTexEnvi_client_proc_t glTexEnvi;
- glTexEnvx_client_proc_t glTexEnvx;
- glTexEnviv_client_proc_t glTexEnviv;
- glTexEnvxv_client_proc_t glTexEnvxv;
- glTexImage2D_client_proc_t glTexImage2D;
- glTexParameteri_client_proc_t glTexParameteri;
- glTexParameterx_client_proc_t glTexParameterx;
- glTexParameteriv_client_proc_t glTexParameteriv;
- glTexParameterxv_client_proc_t glTexParameterxv;
- glTexSubImage2D_client_proc_t glTexSubImage2D;
- glTranslatex_client_proc_t glTranslatex;
- glVertexPointer_client_proc_t glVertexPointer;
- glViewport_client_proc_t glViewport;
- glPointSizePointerOES_client_proc_t glPointSizePointerOES;
- glVertexPointerOffset_client_proc_t glVertexPointerOffset;
- glColorPointerOffset_client_proc_t glColorPointerOffset;
- glNormalPointerOffset_client_proc_t glNormalPointerOffset;
- glPointSizePointerOffset_client_proc_t glPointSizePointerOffset;
- glTexCoordPointerOffset_client_proc_t glTexCoordPointerOffset;
- glWeightPointerOffset_client_proc_t glWeightPointerOffset;
- glMatrixIndexPointerOffset_client_proc_t glMatrixIndexPointerOffset;
- glVertexPointerData_client_proc_t glVertexPointerData;
- glColorPointerData_client_proc_t glColorPointerData;
- glNormalPointerData_client_proc_t glNormalPointerData;
- glTexCoordPointerData_client_proc_t glTexCoordPointerData;
- glPointSizePointerData_client_proc_t glPointSizePointerData;
- glWeightPointerData_client_proc_t glWeightPointerData;
- glMatrixIndexPointerData_client_proc_t glMatrixIndexPointerData;
- glDrawElementsOffset_client_proc_t glDrawElementsOffset;
- glDrawElementsData_client_proc_t glDrawElementsData;
- glGetCompressedTextureFormats_client_proc_t glGetCompressedTextureFormats;
- glFinishRoundTrip_client_proc_t glFinishRoundTrip;
- glBlendEquationSeparateOES_client_proc_t glBlendEquationSeparateOES;
- glBlendFuncSeparateOES_client_proc_t glBlendFuncSeparateOES;
- glBlendEquationOES_client_proc_t glBlendEquationOES;
- glDrawTexsOES_client_proc_t glDrawTexsOES;
- glDrawTexiOES_client_proc_t glDrawTexiOES;
- glDrawTexxOES_client_proc_t glDrawTexxOES;
- glDrawTexsvOES_client_proc_t glDrawTexsvOES;
- glDrawTexivOES_client_proc_t glDrawTexivOES;
- glDrawTexxvOES_client_proc_t glDrawTexxvOES;
- glDrawTexfOES_client_proc_t glDrawTexfOES;
- glDrawTexfvOES_client_proc_t glDrawTexfvOES;
- glEGLImageTargetTexture2DOES_client_proc_t glEGLImageTargetTexture2DOES;
- glEGLImageTargetRenderbufferStorageOES_client_proc_t glEGLImageTargetRenderbufferStorageOES;
- glAlphaFuncxOES_client_proc_t glAlphaFuncxOES;
- glClearColorxOES_client_proc_t glClearColorxOES;
- glClearDepthxOES_client_proc_t glClearDepthxOES;
- glClipPlanexOES_client_proc_t glClipPlanexOES;
- glClipPlanexIMG_client_proc_t glClipPlanexIMG;
- glColor4xOES_client_proc_t glColor4xOES;
- glDepthRangexOES_client_proc_t glDepthRangexOES;
- glFogxOES_client_proc_t glFogxOES;
- glFogxvOES_client_proc_t glFogxvOES;
- glFrustumxOES_client_proc_t glFrustumxOES;
- glGetClipPlanexOES_client_proc_t glGetClipPlanexOES;
- glGetClipPlanex_client_proc_t glGetClipPlanex;
- glGetFixedvOES_client_proc_t glGetFixedvOES;
- glGetLightxvOES_client_proc_t glGetLightxvOES;
- glGetMaterialxvOES_client_proc_t glGetMaterialxvOES;
- glGetTexEnvxvOES_client_proc_t glGetTexEnvxvOES;
- glGetTexParameterxvOES_client_proc_t glGetTexParameterxvOES;
- glLightModelxOES_client_proc_t glLightModelxOES;
- glLightModelxvOES_client_proc_t glLightModelxvOES;
- glLightxOES_client_proc_t glLightxOES;
- glLightxvOES_client_proc_t glLightxvOES;
- glLineWidthxOES_client_proc_t glLineWidthxOES;
- glLoadMatrixxOES_client_proc_t glLoadMatrixxOES;
- glMaterialxOES_client_proc_t glMaterialxOES;
- glMaterialxvOES_client_proc_t glMaterialxvOES;
- glMultMatrixxOES_client_proc_t glMultMatrixxOES;
- glMultiTexCoord4xOES_client_proc_t glMultiTexCoord4xOES;
- glNormal3xOES_client_proc_t glNormal3xOES;
- glOrthoxOES_client_proc_t glOrthoxOES;
- glPointParameterxOES_client_proc_t glPointParameterxOES;
- glPointParameterxvOES_client_proc_t glPointParameterxvOES;
- glPointSizexOES_client_proc_t glPointSizexOES;
- glPolygonOffsetxOES_client_proc_t glPolygonOffsetxOES;
- glRotatexOES_client_proc_t glRotatexOES;
- glSampleCoveragexOES_client_proc_t glSampleCoveragexOES;
- glScalexOES_client_proc_t glScalexOES;
- glTexEnvxOES_client_proc_t glTexEnvxOES;
- glTexEnvxvOES_client_proc_t glTexEnvxvOES;
- glTexParameterxOES_client_proc_t glTexParameterxOES;
- glTexParameterxvOES_client_proc_t glTexParameterxvOES;
- glTranslatexOES_client_proc_t glTranslatexOES;
- glIsRenderbufferOES_client_proc_t glIsRenderbufferOES;
- glBindRenderbufferOES_client_proc_t glBindRenderbufferOES;
- glDeleteRenderbuffersOES_client_proc_t glDeleteRenderbuffersOES;
- glGenRenderbuffersOES_client_proc_t glGenRenderbuffersOES;
- glRenderbufferStorageOES_client_proc_t glRenderbufferStorageOES;
- glGetRenderbufferParameterivOES_client_proc_t glGetRenderbufferParameterivOES;
- glIsFramebufferOES_client_proc_t glIsFramebufferOES;
- glBindFramebufferOES_client_proc_t glBindFramebufferOES;
- glDeleteFramebuffersOES_client_proc_t glDeleteFramebuffersOES;
- glGenFramebuffersOES_client_proc_t glGenFramebuffersOES;
- glCheckFramebufferStatusOES_client_proc_t glCheckFramebufferStatusOES;
- glFramebufferRenderbufferOES_client_proc_t glFramebufferRenderbufferOES;
- glFramebufferTexture2DOES_client_proc_t glFramebufferTexture2DOES;
- glGetFramebufferAttachmentParameterivOES_client_proc_t glGetFramebufferAttachmentParameterivOES;
- glGenerateMipmapOES_client_proc_t glGenerateMipmapOES;
- glMapBufferOES_client_proc_t glMapBufferOES;
- glUnmapBufferOES_client_proc_t glUnmapBufferOES;
- glGetBufferPointervOES_client_proc_t glGetBufferPointervOES;
- glCurrentPaletteMatrixOES_client_proc_t glCurrentPaletteMatrixOES;
- glLoadPaletteFromModelViewMatrixOES_client_proc_t glLoadPaletteFromModelViewMatrixOES;
- glMatrixIndexPointerOES_client_proc_t glMatrixIndexPointerOES;
- glWeightPointerOES_client_proc_t glWeightPointerOES;
- glQueryMatrixxOES_client_proc_t glQueryMatrixxOES;
- glDepthRangefOES_client_proc_t glDepthRangefOES;
- glFrustumfOES_client_proc_t glFrustumfOES;
- glOrthofOES_client_proc_t glOrthofOES;
- glClipPlanefOES_client_proc_t glClipPlanefOES;
- glClipPlanefIMG_client_proc_t glClipPlanefIMG;
- glGetClipPlanefOES_client_proc_t glGetClipPlanefOES;
- glClearDepthfOES_client_proc_t glClearDepthfOES;
- glTexGenfOES_client_proc_t glTexGenfOES;
- glTexGenfvOES_client_proc_t glTexGenfvOES;
- glTexGeniOES_client_proc_t glTexGeniOES;
- glTexGenivOES_client_proc_t glTexGenivOES;
- glTexGenxOES_client_proc_t glTexGenxOES;
- glTexGenxvOES_client_proc_t glTexGenxvOES;
- glGetTexGenfvOES_client_proc_t glGetTexGenfvOES;
- glGetTexGenivOES_client_proc_t glGetTexGenivOES;
- glGetTexGenxvOES_client_proc_t glGetTexGenxvOES;
- glBindVertexArrayOES_client_proc_t glBindVertexArrayOES;
- glDeleteVertexArraysOES_client_proc_t glDeleteVertexArraysOES;
- glGenVertexArraysOES_client_proc_t glGenVertexArraysOES;
- glIsVertexArrayOES_client_proc_t glIsVertexArrayOES;
- glDiscardFramebufferEXT_client_proc_t glDiscardFramebufferEXT;
- glMultiDrawArraysEXT_client_proc_t glMultiDrawArraysEXT;
- glMultiDrawElementsEXT_client_proc_t glMultiDrawElementsEXT;
- glMultiDrawArraysSUN_client_proc_t glMultiDrawArraysSUN;
- glMultiDrawElementsSUN_client_proc_t glMultiDrawElementsSUN;
- glRenderbufferStorageMultisampleIMG_client_proc_t glRenderbufferStorageMultisampleIMG;
- glFramebufferTexture2DMultisampleIMG_client_proc_t glFramebufferTexture2DMultisampleIMG;
- glDeleteFencesNV_client_proc_t glDeleteFencesNV;
- glGenFencesNV_client_proc_t glGenFencesNV;
- glIsFenceNV_client_proc_t glIsFenceNV;
- glTestFenceNV_client_proc_t glTestFenceNV;
- glGetFenceivNV_client_proc_t glGetFenceivNV;
- glFinishFenceNV_client_proc_t glFinishFenceNV;
- glSetFenceNV_client_proc_t glSetFenceNV;
- glGetDriverControlsQCOM_client_proc_t glGetDriverControlsQCOM;
- glGetDriverControlStringQCOM_client_proc_t glGetDriverControlStringQCOM;
- glEnableDriverControlQCOM_client_proc_t glEnableDriverControlQCOM;
- glDisableDriverControlQCOM_client_proc_t glDisableDriverControlQCOM;
- glExtGetTexturesQCOM_client_proc_t glExtGetTexturesQCOM;
- glExtGetBuffersQCOM_client_proc_t glExtGetBuffersQCOM;
- glExtGetRenderbuffersQCOM_client_proc_t glExtGetRenderbuffersQCOM;
- glExtGetFramebuffersQCOM_client_proc_t glExtGetFramebuffersQCOM;
- glExtGetTexLevelParameterivQCOM_client_proc_t glExtGetTexLevelParameterivQCOM;
- glExtTexObjectStateOverrideiQCOM_client_proc_t glExtTexObjectStateOverrideiQCOM;
- glExtGetTexSubImageQCOM_client_proc_t glExtGetTexSubImageQCOM;
- glExtGetBufferPointervQCOM_client_proc_t glExtGetBufferPointervQCOM;
- glExtGetShadersQCOM_client_proc_t glExtGetShadersQCOM;
- glExtGetProgramsQCOM_client_proc_t glExtGetProgramsQCOM;
- glExtIsProgramBinaryQCOM_client_proc_t glExtIsProgramBinaryQCOM;
- glExtGetProgramBinarySourceQCOM_client_proc_t glExtGetProgramBinarySourceQCOM;
- glStartTilingQCOM_client_proc_t glStartTilingQCOM;
- glEndTilingQCOM_client_proc_t glEndTilingQCOM;
- virtual ~gl_client_context_t() {}
-
- typedef gl_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
- static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
- int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
- virtual void setError(unsigned int error){ (void)error; };
- virtual unsigned int getError(){ return 0; };
-};
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __gl_client_proc_t_h
-#define __gl_client_proc_t_h
-
-
-
-#include "gl_types.h"
-#ifndef gl_APIENTRY
-#define gl_APIENTRY
-#endif
-typedef void (gl_APIENTRY *glAlphaFunc_client_proc_t) (void * ctx, GLenum, GLclampf);
-typedef void (gl_APIENTRY *glClearColor_client_proc_t) (void * ctx, GLclampf, GLclampf, GLclampf, GLclampf);
-typedef void (gl_APIENTRY *glClearDepthf_client_proc_t) (void * ctx, GLclampf);
-typedef void (gl_APIENTRY *glClipPlanef_client_proc_t) (void * ctx, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glColor4f_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glDepthRangef_client_proc_t) (void * ctx, GLclampf, GLclampf);
-typedef void (gl_APIENTRY *glFogf_client_proc_t) (void * ctx, GLenum, GLfloat);
-typedef void (gl_APIENTRY *glFogfv_client_proc_t) (void * ctx, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glFrustumf_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glGetClipPlanef_client_proc_t) (void * ctx, GLenum, GLfloat*);
-typedef void (gl_APIENTRY *glGetFloatv_client_proc_t) (void * ctx, GLenum, GLfloat*);
-typedef void (gl_APIENTRY *glGetLightfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
-typedef void (gl_APIENTRY *glGetMaterialfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
-typedef void (gl_APIENTRY *glGetTexEnvfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
-typedef void (gl_APIENTRY *glGetTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
-typedef void (gl_APIENTRY *glLightModelf_client_proc_t) (void * ctx, GLenum, GLfloat);
-typedef void (gl_APIENTRY *glLightModelfv_client_proc_t) (void * ctx, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glLightf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
-typedef void (gl_APIENTRY *glLightfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glLineWidth_client_proc_t) (void * ctx, GLfloat);
-typedef void (gl_APIENTRY *glLoadMatrixf_client_proc_t) (void * ctx, const GLfloat*);
-typedef void (gl_APIENTRY *glMaterialf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
-typedef void (gl_APIENTRY *glMaterialfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glMultMatrixf_client_proc_t) (void * ctx, const GLfloat*);
-typedef void (gl_APIENTRY *glMultiTexCoord4f_client_proc_t) (void * ctx, GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glNormal3f_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glOrthof_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glPointParameterf_client_proc_t) (void * ctx, GLenum, GLfloat);
-typedef void (gl_APIENTRY *glPointParameterfv_client_proc_t) (void * ctx, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glPointSize_client_proc_t) (void * ctx, GLfloat);
-typedef void (gl_APIENTRY *glPolygonOffset_client_proc_t) (void * ctx, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glRotatef_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glScalef_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glTexEnvf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
-typedef void (gl_APIENTRY *glTexEnvfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glTexParameterf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
-typedef void (gl_APIENTRY *glTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glTranslatef_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glActiveTexture_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glAlphaFuncx_client_proc_t) (void * ctx, GLenum, GLclampx);
-typedef void (gl_APIENTRY *glBindBuffer_client_proc_t) (void * ctx, GLenum, GLuint);
-typedef void (gl_APIENTRY *glBindTexture_client_proc_t) (void * ctx, GLenum, GLuint);
-typedef void (gl_APIENTRY *glBlendFunc_client_proc_t) (void * ctx, GLenum, GLenum);
-typedef void (gl_APIENTRY *glBufferData_client_proc_t) (void * ctx, GLenum, GLsizeiptr, const GLvoid*, GLenum);
-typedef void (gl_APIENTRY *glBufferSubData_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, const GLvoid*);
-typedef void (gl_APIENTRY *glClear_client_proc_t) (void * ctx, GLbitfield);
-typedef void (gl_APIENTRY *glClearColorx_client_proc_t) (void * ctx, GLclampx, GLclampx, GLclampx, GLclampx);
-typedef void (gl_APIENTRY *glClearDepthx_client_proc_t) (void * ctx, GLclampx);
-typedef void (gl_APIENTRY *glClearStencil_client_proc_t) (void * ctx, GLint);
-typedef void (gl_APIENTRY *glClientActiveTexture_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glColor4ub_client_proc_t) (void * ctx, GLubyte, GLubyte, GLubyte, GLubyte);
-typedef void (gl_APIENTRY *glColor4x_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glColorMask_client_proc_t) (void * ctx, GLboolean, GLboolean, GLboolean, GLboolean);
-typedef void (gl_APIENTRY *glColorPointer_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
-typedef void (gl_APIENTRY *glCompressedTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
-typedef void (gl_APIENTRY *glCompressedTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
-typedef void (gl_APIENTRY *glCopyTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
-typedef void (gl_APIENTRY *glCopyTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-typedef void (gl_APIENTRY *glCullFace_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glDeleteBuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl_APIENTRY *glDeleteTextures_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl_APIENTRY *glDepthFunc_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glDepthMask_client_proc_t) (void * ctx, GLboolean);
-typedef void (gl_APIENTRY *glDepthRangex_client_proc_t) (void * ctx, GLclampx, GLclampx);
-typedef void (gl_APIENTRY *glDisable_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glDisableClientState_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glDrawArrays_client_proc_t) (void * ctx, GLenum, GLint, GLsizei);
-typedef void (gl_APIENTRY *glDrawElements_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const GLvoid*);
-typedef void (gl_APIENTRY *glEnable_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glEnableClientState_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glFinish_client_proc_t) (void * ctx);
-typedef void (gl_APIENTRY *glFlush_client_proc_t) (void * ctx);
-typedef void (gl_APIENTRY *glFogx_client_proc_t) (void * ctx, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glFogxv_client_proc_t) (void * ctx, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glFrontFace_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glFrustumx_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glGetBooleanv_client_proc_t) (void * ctx, GLenum, GLboolean*);
-typedef void (gl_APIENTRY *glGetBufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
-typedef void (gl_APIENTRY *glClipPlanex_client_proc_t) (void * ctx, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glGenBuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef void (gl_APIENTRY *glGenTextures_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef GLenum (gl_APIENTRY *glGetError_client_proc_t) (void * ctx);
-typedef void (gl_APIENTRY *glGetFixedv_client_proc_t) (void * ctx, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glGetIntegerv_client_proc_t) (void * ctx, GLenum, GLint*);
-typedef void (gl_APIENTRY *glGetLightxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glGetMaterialxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glGetPointerv_client_proc_t) (void * ctx, GLenum, GLvoid**);
-typedef const GLubyte* (gl_APIENTRY *glGetString_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glGetTexEnviv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
-typedef void (gl_APIENTRY *glGetTexEnvxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glGetTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
-typedef void (gl_APIENTRY *glGetTexParameterxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glHint_client_proc_t) (void * ctx, GLenum, GLenum);
-typedef GLboolean (gl_APIENTRY *glIsBuffer_client_proc_t) (void * ctx, GLuint);
-typedef GLboolean (gl_APIENTRY *glIsEnabled_client_proc_t) (void * ctx, GLenum);
-typedef GLboolean (gl_APIENTRY *glIsTexture_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glLightModelx_client_proc_t) (void * ctx, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glLightModelxv_client_proc_t) (void * ctx, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glLightx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glLightxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glLineWidthx_client_proc_t) (void * ctx, GLfixed);
-typedef void (gl_APIENTRY *glLoadIdentity_client_proc_t) (void * ctx);
-typedef void (gl_APIENTRY *glLoadMatrixx_client_proc_t) (void * ctx, const GLfixed*);
-typedef void (gl_APIENTRY *glLogicOp_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glMaterialx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glMaterialxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glMatrixMode_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glMultMatrixx_client_proc_t) (void * ctx, const GLfixed*);
-typedef void (gl_APIENTRY *glMultiTexCoord4x_client_proc_t) (void * ctx, GLenum, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glNormal3x_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glNormalPointer_client_proc_t) (void * ctx, GLenum, GLsizei, const GLvoid*);
-typedef void (gl_APIENTRY *glOrthox_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glPixelStorei_client_proc_t) (void * ctx, GLenum, GLint);
-typedef void (gl_APIENTRY *glPointParameterx_client_proc_t) (void * ctx, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glPointParameterxv_client_proc_t) (void * ctx, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glPointSizex_client_proc_t) (void * ctx, GLfixed);
-typedef void (gl_APIENTRY *glPolygonOffsetx_client_proc_t) (void * ctx, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glPopMatrix_client_proc_t) (void * ctx);
-typedef void (gl_APIENTRY *glPushMatrix_client_proc_t) (void * ctx);
-typedef void (gl_APIENTRY *glReadPixels_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
-typedef void (gl_APIENTRY *glRotatex_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glSampleCoverage_client_proc_t) (void * ctx, GLclampf, GLboolean);
-typedef void (gl_APIENTRY *glSampleCoveragex_client_proc_t) (void * ctx, GLclampx, GLboolean);
-typedef void (gl_APIENTRY *glScalex_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glScissor_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
-typedef void (gl_APIENTRY *glShadeModel_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glStencilFunc_client_proc_t) (void * ctx, GLenum, GLint, GLuint);
-typedef void (gl_APIENTRY *glStencilMask_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glStencilOp_client_proc_t) (void * ctx, GLenum, GLenum, GLenum);
-typedef void (gl_APIENTRY *glTexCoordPointer_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
-typedef void (gl_APIENTRY *glTexEnvi_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
-typedef void (gl_APIENTRY *glTexEnvx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glTexEnviv_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
-typedef void (gl_APIENTRY *glTexEnvxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
-typedef void (gl_APIENTRY *glTexParameteri_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
-typedef void (gl_APIENTRY *glTexParameterx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
-typedef void (gl_APIENTRY *glTexParameterxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
-typedef void (gl_APIENTRY *glTranslatex_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glVertexPointer_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
-typedef void (gl_APIENTRY *glViewport_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
-typedef void (gl_APIENTRY *glPointSizePointerOES_client_proc_t) (void * ctx, GLenum, GLsizei, const GLvoid*);
-typedef void (gl_APIENTRY *glVertexPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
-typedef void (gl_APIENTRY *glColorPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
-typedef void (gl_APIENTRY *glNormalPointerOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLuint);
-typedef void (gl_APIENTRY *glPointSizePointerOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLuint);
-typedef void (gl_APIENTRY *glTexCoordPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
-typedef void (gl_APIENTRY *glWeightPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
-typedef void (gl_APIENTRY *glMatrixIndexPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
-typedef void (gl_APIENTRY *glVertexPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
-typedef void (gl_APIENTRY *glColorPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
-typedef void (gl_APIENTRY *glNormalPointerData_client_proc_t) (void * ctx, GLenum, GLsizei, void*, GLuint);
-typedef void (gl_APIENTRY *glTexCoordPointerData_client_proc_t) (void * ctx, GLint, GLint, GLenum, GLsizei, void*, GLuint);
-typedef void (gl_APIENTRY *glPointSizePointerData_client_proc_t) (void * ctx, GLenum, GLsizei, void*, GLuint);
-typedef void (gl_APIENTRY *glWeightPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
-typedef void (gl_APIENTRY *glMatrixIndexPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
-typedef void (gl_APIENTRY *glDrawElementsOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLuint);
-typedef void (gl_APIENTRY *glDrawElementsData_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, void*, GLuint);
-typedef void (gl_APIENTRY *glGetCompressedTextureFormats_client_proc_t) (void * ctx, int, GLint*);
-typedef int (gl_APIENTRY *glFinishRoundTrip_client_proc_t) (void * ctx);
-typedef void (gl_APIENTRY *glBlendEquationSeparateOES_client_proc_t) (void * ctx, GLenum, GLenum);
-typedef void (gl_APIENTRY *glBlendFuncSeparateOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLenum);
-typedef void (gl_APIENTRY *glBlendEquationOES_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glDrawTexsOES_client_proc_t) (void * ctx, GLshort, GLshort, GLshort, GLshort, GLshort);
-typedef void (gl_APIENTRY *glDrawTexiOES_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint, GLint);
-typedef void (gl_APIENTRY *glDrawTexxOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glDrawTexsvOES_client_proc_t) (void * ctx, const GLshort*);
-typedef void (gl_APIENTRY *glDrawTexivOES_client_proc_t) (void * ctx, const GLint*);
-typedef void (gl_APIENTRY *glDrawTexxvOES_client_proc_t) (void * ctx, const GLfixed*);
-typedef void (gl_APIENTRY *glDrawTexfOES_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glDrawTexfvOES_client_proc_t) (void * ctx, const GLfloat*);
-typedef void (gl_APIENTRY *glEGLImageTargetTexture2DOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
-typedef void (gl_APIENTRY *glEGLImageTargetRenderbufferStorageOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
-typedef void (gl_APIENTRY *glAlphaFuncxOES_client_proc_t) (void * ctx, GLenum, GLclampx);
-typedef void (gl_APIENTRY *glClearColorxOES_client_proc_t) (void * ctx, GLclampx, GLclampx, GLclampx, GLclampx);
-typedef void (gl_APIENTRY *glClearDepthxOES_client_proc_t) (void * ctx, GLclampx);
-typedef void (gl_APIENTRY *glClipPlanexOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glClipPlanexIMG_client_proc_t) (void * ctx, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glColor4xOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glDepthRangexOES_client_proc_t) (void * ctx, GLclampx, GLclampx);
-typedef void (gl_APIENTRY *glFogxOES_client_proc_t) (void * ctx, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glFogxvOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glFrustumxOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glGetClipPlanexOES_client_proc_t) (void * ctx, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glGetClipPlanex_client_proc_t) (void * ctx, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glGetFixedvOES_client_proc_t) (void * ctx, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glGetLightxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glGetMaterialxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glGetTexEnvxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glGetTexParameterxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glLightModelxOES_client_proc_t) (void * ctx, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glLightModelxvOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glLightxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glLightxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glLineWidthxOES_client_proc_t) (void * ctx, GLfixed);
-typedef void (gl_APIENTRY *glLoadMatrixxOES_client_proc_t) (void * ctx, const GLfixed*);
-typedef void (gl_APIENTRY *glMaterialxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glMaterialxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glMultMatrixxOES_client_proc_t) (void * ctx, const GLfixed*);
-typedef void (gl_APIENTRY *glMultiTexCoord4xOES_client_proc_t) (void * ctx, GLenum, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glNormal3xOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glOrthoxOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glPointParameterxOES_client_proc_t) (void * ctx, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glPointParameterxvOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glPointSizexOES_client_proc_t) (void * ctx, GLfixed);
-typedef void (gl_APIENTRY *glPolygonOffsetxOES_client_proc_t) (void * ctx, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glRotatexOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glSampleCoveragexOES_client_proc_t) (void * ctx, GLclampx, GLboolean);
-typedef void (gl_APIENTRY *glScalexOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
-typedef void (gl_APIENTRY *glTexEnvxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glTexEnvxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glTexParameterxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glTexParameterxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glTranslatexOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
-typedef GLboolean (gl_APIENTRY *glIsRenderbufferOES_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glBindRenderbufferOES_client_proc_t) (void * ctx, GLenum, GLuint);
-typedef void (gl_APIENTRY *glDeleteRenderbuffersOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl_APIENTRY *glGenRenderbuffersOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef void (gl_APIENTRY *glRenderbufferStorageOES_client_proc_t) (void * ctx, GLenum, GLenum, GLsizei, GLsizei);
-typedef void (gl_APIENTRY *glGetRenderbufferParameterivOES_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
-typedef GLboolean (gl_APIENTRY *glIsFramebufferOES_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glBindFramebufferOES_client_proc_t) (void * ctx, GLenum, GLuint);
-typedef void (gl_APIENTRY *glDeleteFramebuffersOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl_APIENTRY *glGenFramebuffersOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef GLenum (gl_APIENTRY *glCheckFramebufferStatusOES_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glFramebufferRenderbufferOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint);
-typedef void (gl_APIENTRY *glFramebufferTexture2DOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint);
-typedef void (gl_APIENTRY *glGetFramebufferAttachmentParameterivOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLint*);
-typedef void (gl_APIENTRY *glGenerateMipmapOES_client_proc_t) (void * ctx, GLenum);
-typedef void* (gl_APIENTRY *glMapBufferOES_client_proc_t) (void * ctx, GLenum, GLenum);
-typedef GLboolean (gl_APIENTRY *glUnmapBufferOES_client_proc_t) (void * ctx, GLenum);
-typedef void (gl_APIENTRY *glGetBufferPointervOES_client_proc_t) (void * ctx, GLenum, GLenum, GLvoid**);
-typedef void (gl_APIENTRY *glCurrentPaletteMatrixOES_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glLoadPaletteFromModelViewMatrixOES_client_proc_t) (void * ctx);
-typedef void (gl_APIENTRY *glMatrixIndexPointerOES_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
-typedef void (gl_APIENTRY *glWeightPointerOES_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
-typedef GLbitfield (gl_APIENTRY *glQueryMatrixxOES_client_proc_t) (void * ctx, GLfixed*, GLint*);
-typedef void (gl_APIENTRY *glDepthRangefOES_client_proc_t) (void * ctx, GLclampf, GLclampf);
-typedef void (gl_APIENTRY *glFrustumfOES_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glOrthofOES_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (gl_APIENTRY *glClipPlanefOES_client_proc_t) (void * ctx, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glClipPlanefIMG_client_proc_t) (void * ctx, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glGetClipPlanefOES_client_proc_t) (void * ctx, GLenum, GLfloat*);
-typedef void (gl_APIENTRY *glClearDepthfOES_client_proc_t) (void * ctx, GLclampf);
-typedef void (gl_APIENTRY *glTexGenfOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
-typedef void (gl_APIENTRY *glTexGenfvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
-typedef void (gl_APIENTRY *glTexGeniOES_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
-typedef void (gl_APIENTRY *glTexGenivOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
-typedef void (gl_APIENTRY *glTexGenxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
-typedef void (gl_APIENTRY *glTexGenxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
-typedef void (gl_APIENTRY *glGetTexGenfvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
-typedef void (gl_APIENTRY *glGetTexGenivOES_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
-typedef void (gl_APIENTRY *glGetTexGenxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
-typedef void (gl_APIENTRY *glBindVertexArrayOES_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glDeleteVertexArraysOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl_APIENTRY *glGenVertexArraysOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef GLboolean (gl_APIENTRY *glIsVertexArrayOES_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glDiscardFramebufferEXT_client_proc_t) (void * ctx, GLenum, GLsizei, const GLenum*);
-typedef void (gl_APIENTRY *glMultiDrawArraysEXT_client_proc_t) (void * ctx, GLenum, const GLint*, const GLsizei*, GLsizei);
-typedef void (gl_APIENTRY *glMultiDrawElementsEXT_client_proc_t) (void * ctx, GLenum, const GLsizei*, GLenum, const GLvoid* const*, GLsizei);
-typedef void (gl_APIENTRY *glMultiDrawArraysSUN_client_proc_t) (void * ctx, GLenum, GLint*, GLsizei*, GLsizei);
-typedef void (gl_APIENTRY *glMultiDrawElementsSUN_client_proc_t) (void * ctx, GLenum, const GLsizei*, GLenum, const GLvoid**, GLsizei);
-typedef void (gl_APIENTRY *glRenderbufferStorageMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei);
-typedef void (gl_APIENTRY *glFramebufferTexture2DMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
-typedef void (gl_APIENTRY *glDeleteFencesNV_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl_APIENTRY *glGenFencesNV_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef GLboolean (gl_APIENTRY *glIsFenceNV_client_proc_t) (void * ctx, GLuint);
-typedef GLboolean (gl_APIENTRY *glTestFenceNV_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glGetFenceivNV_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
-typedef void (gl_APIENTRY *glFinishFenceNV_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glSetFenceNV_client_proc_t) (void * ctx, GLuint, GLenum);
-typedef void (gl_APIENTRY *glGetDriverControlsQCOM_client_proc_t) (void * ctx, GLint*, GLsizei, GLuint*);
-typedef void (gl_APIENTRY *glGetDriverControlStringQCOM_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
-typedef void (gl_APIENTRY *glEnableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glDisableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glExtGetTexturesQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef void (gl_APIENTRY *glExtGetBuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef void (gl_APIENTRY *glExtGetRenderbuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef void (gl_APIENTRY *glExtGetFramebuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef void (gl_APIENTRY *glExtGetTexLevelParameterivQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLint, GLenum, GLint*);
-typedef void (gl_APIENTRY *glExtTexObjectStateOverrideiQCOM_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
-typedef void (gl_APIENTRY *glExtGetTexSubImageQCOM_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
-typedef void (gl_APIENTRY *glExtGetBufferPointervQCOM_client_proc_t) (void * ctx, GLenum, GLvoid**);
-typedef void (gl_APIENTRY *glExtGetShadersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef void (gl_APIENTRY *glExtGetProgramsQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef GLboolean (gl_APIENTRY *glExtIsProgramBinaryQCOM_client_proc_t) (void * ctx, GLuint);
-typedef void (gl_APIENTRY *glExtGetProgramBinarySourceQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLchar*, GLint*);
-typedef void (gl_APIENTRY *glStartTilingQCOM_client_proc_t) (void * ctx, GLuint, GLuint, GLuint, GLuint, GLbitfield);
-typedef void (gl_APIENTRY *glEndTilingQCOM_client_proc_t) (void * ctx, GLbitfield);
-
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-
-
-#include <memory>
-#include <string.h>
-#include "gl_opcodes.h"
-
-#include "gl_enc.h"
-
-
-#include <stdio.h>
-
-namespace {
-
-void enc_unsupported()
-{
- ALOGE("Function is unsupported\n");
-}
-
-void glAlphaFunc_enc(void *self , GLenum func, GLclampf ref)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glAlphaFunc;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &func, 4); ptr += 4;
- memcpy(ptr, &ref, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClearColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearColor;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 4); ptr += 4;
- memcpy(ptr, &green, 4); ptr += 4;
- memcpy(ptr, &blue, 4); ptr += 4;
- memcpy(ptr, &alpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClearDepthf_enc(void *self , GLclampf depth)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearDepthf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &depth, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClipPlanef_enc(void *self , GLenum plane, const GLfloat* equation)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_equation = (4 * sizeof(float));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClipPlanef;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &plane, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_equation; ptr += 4;
- memcpy(ptr, equation, __size_equation);ptr += __size_equation;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glColor4f_enc(void *self , GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glColor4f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 4); ptr += 4;
- memcpy(ptr, &green, 4); ptr += 4;
- memcpy(ptr, &blue, 4); ptr += 4;
- memcpy(ptr, &alpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDepthRangef_enc(void *self , GLclampf zNear, GLclampf zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDepthRangef;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFogf_enc(void *self , GLenum pname, GLfloat param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFogf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFogfv_enc(void *self , GLenum pname, const GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFogfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFrustumf_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFrustumf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &left, 4); ptr += 4;
- memcpy(ptr, &right, 4); ptr += 4;
- memcpy(ptr, &bottom, 4); ptr += 4;
- memcpy(ptr, &top, 4); ptr += 4;
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetClipPlanef_enc(void *self , GLenum pname, GLfloat* eqn)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_eqn = (4 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_eqn + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetClipPlanef;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_eqn; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(eqn, __size_eqn);
- if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetClipPlanef: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetFloatv_enc(void *self , GLenum pname, GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetFloatv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetFloatv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetLightfv_enc(void *self , GLenum light, GLenum pname, GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetLightfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &light, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetLightfv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetMaterialfv_enc(void *self , GLenum face, GLenum pname, GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetMaterialfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetMaterialfv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetTexEnvfv_enc(void *self , GLenum env, GLenum pname, GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexEnvfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &env, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetTexEnvfv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetTexParameterfv_enc(void *self , GLenum target, GLenum pname, GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetTexParameterfv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glLightModelf_enc(void *self , GLenum pname, GLfloat param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightModelf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLightModelfv_enc(void *self , GLenum pname, const GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightModelfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLightf_enc(void *self , GLenum light, GLenum pname, GLfloat param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &light, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLightfv_enc(void *self , GLenum light, GLenum pname, const GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &light, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLineWidth_enc(void *self , GLfloat width)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLineWidth;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &width, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLoadMatrixf_enc(void *self , const GLfloat* m)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_m = (16 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLoadMatrixf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_m; ptr += 4;
- memcpy(ptr, m, __size_m);ptr += __size_m;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMaterialf_enc(void *self , GLenum face, GLenum pname, GLfloat param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMaterialf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMaterialfv_enc(void *self , GLenum face, GLenum pname, const GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMaterialfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMultMatrixf_enc(void *self , const GLfloat* m)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_m = (16 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMultMatrixf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_m; ptr += 4;
- memcpy(ptr, m, __size_m);ptr += __size_m;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMultiTexCoord4f_enc(void *self , GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMultiTexCoord4f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &s, 4); ptr += 4;
- memcpy(ptr, &t, 4); ptr += 4;
- memcpy(ptr, &r, 4); ptr += 4;
- memcpy(ptr, &q, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glNormal3f_enc(void *self , GLfloat nx, GLfloat ny, GLfloat nz)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glNormal3f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &nx, 4); ptr += 4;
- memcpy(ptr, &ny, 4); ptr += 4;
- memcpy(ptr, &nz, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glOrthof_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glOrthof;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &left, 4); ptr += 4;
- memcpy(ptr, &right, 4); ptr += 4;
- memcpy(ptr, &bottom, 4); ptr += 4;
- memcpy(ptr, &top, 4); ptr += 4;
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointParameterf_enc(void *self , GLenum pname, GLfloat param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointParameterfv_enc(void *self , GLenum pname, const GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointSize_enc(void *self , GLfloat size)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointSize;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPolygonOffset_enc(void *self , GLfloat factor, GLfloat units)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPolygonOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &factor, 4); ptr += 4;
- memcpy(ptr, &units, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glRotatef_enc(void *self , GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glRotatef;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &angle, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glScalef_enc(void *self , GLfloat x, GLfloat y, GLfloat z)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glScalef;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexEnvf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexEnvf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexEnvfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexEnvfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexParameterf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexParameterfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTranslatef_enc(void *self , GLfloat x, GLfloat y, GLfloat z)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTranslatef;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glActiveTexture_enc(void *self , GLenum texture)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &texture, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glAlphaFuncx_enc(void *self , GLenum func, GLclampx ref)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glAlphaFuncx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &func, 4); ptr += 4;
- memcpy(ptr, &ref, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBindBuffer_enc(void *self , GLenum target, GLuint buffer)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &buffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBindTexture_enc(void *self , GLenum target, GLuint texture)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindTexture;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &texture, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBlendFunc_enc(void *self , GLenum sfactor, GLenum dfactor)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBlendFunc;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &sfactor, 4); ptr += 4;
- memcpy(ptr, &dfactor, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBufferData_enc(void *self , GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = ((data != NULL) ? size : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBufferData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &size, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
- memcpy(ptr, &usage, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBufferSubData_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = ((data != NULL) ? size : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBufferSubData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
- memcpy(ptr, &size, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClear_enc(void *self , GLbitfield mask)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClear;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mask, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClearColorx_enc(void *self , GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearColorx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 4); ptr += 4;
- memcpy(ptr, &green, 4); ptr += 4;
- memcpy(ptr, &blue, 4); ptr += 4;
- memcpy(ptr, &alpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClearDepthx_enc(void *self , GLclampx depth)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearDepthx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &depth, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClearStencil_enc(void *self , GLint s)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearStencil;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &s, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClientActiveTexture_enc(void *self , GLenum texture)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClientActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &texture, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glColor4ub_enc(void *self , GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 1 + 1 + 1 + 1;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glColor4ub;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 1); ptr += 1;
- memcpy(ptr, &green, 1); ptr += 1;
- memcpy(ptr, &blue, 1); ptr += 1;
- memcpy(ptr, &alpha, 1); ptr += 1;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glColor4x_enc(void *self , GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glColor4x;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 4); ptr += 4;
- memcpy(ptr, &green, 4); ptr += 4;
- memcpy(ptr, &blue, 4); ptr += 4;
- memcpy(ptr, &alpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glColorMask_enc(void *self , GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 1 + 1 + 1 + 1;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glColorMask;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 1); ptr += 1;
- memcpy(ptr, &green, 1); ptr += 1;
- memcpy(ptr, &blue, 1); ptr += 1;
- memcpy(ptr, &alpha, 1); ptr += 1;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glCompressedTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = ((data != NULL) ? imageSize : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCompressedTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &border, 4); ptr += 4;
- memcpy(ptr, &imageSize, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glCompressedTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = ((data != NULL) ? imageSize : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCompressedTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &xoffset, 4); ptr += 4;
- memcpy(ptr, &yoffset, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &imageSize, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glCopyTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCopyTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &border, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glCopyTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCopyTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &xoffset, 4); ptr += 4;
- memcpy(ptr, &yoffset, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glCullFace_enc(void *self , GLenum mode)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCullFace;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteBuffers_enc(void *self , GLsizei n, const GLuint* buffers)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_buffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_buffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_buffers; ptr += 4;
- memcpy(ptr, buffers, __size_buffers);ptr += __size_buffers;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteTextures_enc(void *self , GLsizei n, const GLuint* textures)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_textures = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_textures + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteTextures;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_textures; ptr += 4;
- memcpy(ptr, textures, __size_textures);ptr += __size_textures;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDepthFunc_enc(void *self , GLenum func)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDepthFunc;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &func, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDepthMask_enc(void *self , GLboolean flag)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 1;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDepthMask;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &flag, 1); ptr += 1;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDepthRangex_enc(void *self , GLclampx zNear, GLclampx zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDepthRangex;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDisable_enc(void *self , GLenum cap)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDisable;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &cap, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDisableClientState_enc(void *self , GLenum array)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDisableClientState;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &array, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawArrays_enc(void *self , GLenum mode, GLint first, GLsizei count)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawArrays;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
- memcpy(ptr, &first, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glEnable_enc(void *self , GLenum cap)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glEnable;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &cap, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glEnableClientState_enc(void *self , GLenum array)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glEnableClientState;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &array, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFinish_enc(void *self )
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFinish;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFlush_enc(void *self )
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFlush;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFogx_enc(void *self , GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFogx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFogxv_enc(void *self , GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFogxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFrontFace_enc(void *self , GLenum mode)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFrontFace;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFrustumx_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFrustumx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &left, 4); ptr += 4;
- memcpy(ptr, &right, 4); ptr += 4;
- memcpy(ptr, &bottom, 4); ptr += 4;
- memcpy(ptr, &top, 4); ptr += 4;
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetBooleanv_enc(void *self , GLenum pname, GLboolean* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLboolean));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetBooleanv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetBooleanv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetBufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetBufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetBufferParameteriv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glClipPlanex_enc(void *self , GLenum pname, const GLfixed* eqn)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_eqn = (4 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_eqn + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClipPlanex;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_eqn; ptr += 4;
- memcpy(ptr, eqn, __size_eqn);ptr += __size_eqn;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGenBuffers_enc(void *self , GLsizei n, GLuint* buffers)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_buffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_buffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_buffers; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(buffers, __size_buffers);
- if (useChecksum) checksumCalculator->addBuffer(buffers, __size_buffers);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGenBuffers: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGenTextures_enc(void *self , GLsizei n, GLuint* textures)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_textures = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_textures + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenTextures;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_textures; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(textures, __size_textures);
- if (useChecksum) checksumCalculator->addBuffer(textures, __size_textures);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGenTextures: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-GLenum glGetError_enc(void *self )
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetError;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLenum retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetError: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glGetFixedv_enc(void *self , GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetFixedv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetFixedv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetIntegerv_enc(void *self , GLenum pname, GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetIntegerv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetIntegerv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetLightxv_enc(void *self , GLenum light, GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetLightxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &light, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetLightxv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetMaterialxv_enc(void *self , GLenum face, GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetMaterialxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetMaterialxv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetTexEnviv_enc(void *self , GLenum env, GLenum pname, GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexEnviv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &env, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetTexEnviv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetTexEnvxv_enc(void *self , GLenum env, GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexEnvxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &env, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetTexEnvxv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetTexParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetTexParameteriv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetTexParameterxv_enc(void *self , GLenum target, GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetTexParameterxv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glHint_enc(void *self , GLenum target, GLenum mode)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glHint;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &mode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-GLboolean glIsBuffer_enc(void *self , GLuint buffer)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &buffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsBuffer: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-GLboolean glIsEnabled_enc(void *self , GLenum cap)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsEnabled;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &cap, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsEnabled: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-GLboolean glIsTexture_enc(void *self , GLuint texture)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsTexture;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &texture, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsTexture: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glLightModelx_enc(void *self , GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightModelx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLightModelxv_enc(void *self , GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightModelxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLightx_enc(void *self , GLenum light, GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &light, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLightxv_enc(void *self , GLenum light, GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &light, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLineWidthx_enc(void *self , GLfixed width)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLineWidthx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &width, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLoadIdentity_enc(void *self )
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLoadIdentity;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLoadMatrixx_enc(void *self , const GLfixed* m)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_m = (16 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLoadMatrixx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_m; ptr += 4;
- memcpy(ptr, m, __size_m);ptr += __size_m;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLogicOp_enc(void *self , GLenum opcode)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLogicOp;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &opcode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMaterialx_enc(void *self , GLenum face, GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMaterialx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMaterialxv_enc(void *self , GLenum face, GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMaterialxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMatrixMode_enc(void *self , GLenum mode)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMatrixMode;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMultMatrixx_enc(void *self , const GLfixed* m)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_m = (16 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMultMatrixx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_m; ptr += 4;
- memcpy(ptr, m, __size_m);ptr += __size_m;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMultiTexCoord4x_enc(void *self , GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMultiTexCoord4x;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &s, 4); ptr += 4;
- memcpy(ptr, &t, 4); ptr += 4;
- memcpy(ptr, &r, 4); ptr += 4;
- memcpy(ptr, &q, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glNormal3x_enc(void *self , GLfixed nx, GLfixed ny, GLfixed nz)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glNormal3x;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &nx, 4); ptr += 4;
- memcpy(ptr, &ny, 4); ptr += 4;
- memcpy(ptr, &nz, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glOrthox_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glOrthox;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &left, 4); ptr += 4;
- memcpy(ptr, &right, 4); ptr += 4;
- memcpy(ptr, &bottom, 4); ptr += 4;
- memcpy(ptr, &top, 4); ptr += 4;
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPixelStorei_enc(void *self , GLenum pname, GLint param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPixelStorei;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointParameterx_enc(void *self , GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointParameterx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointParameterxv_enc(void *self , GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointSizex_enc(void *self , GLfixed size)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointSizex;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPolygonOffsetx_enc(void *self , GLfixed factor, GLfixed units)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPolygonOffsetx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &factor, 4); ptr += 4;
- memcpy(ptr, &units, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPopMatrix_enc(void *self )
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPopMatrix;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPushMatrix_enc(void *self )
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPushMatrix;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glReadPixels_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_pixels = glesv1_enc::pixelDataSize(self, width, height, format, type, 1);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glReadPixels;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_pixels; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(pixels, __size_pixels);
- if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glReadPixels: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glRotatex_enc(void *self , GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glRotatex;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &angle, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glSampleCoverage_enc(void *self , GLclampf value, GLboolean invert)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 1;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glSampleCoverage;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &value, 4); ptr += 4;
- memcpy(ptr, &invert, 1); ptr += 1;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glSampleCoveragex_enc(void *self , GLclampx value, GLboolean invert)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 1;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glSampleCoveragex;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &value, 4); ptr += 4;
- memcpy(ptr, &invert, 1); ptr += 1;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glScalex_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glScalex;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glScissor_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glScissor;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glShadeModel_enc(void *self , GLenum mode)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glShadeModel;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glStencilFunc_enc(void *self , GLenum func, GLint ref, GLuint mask)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glStencilFunc;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &func, 4); ptr += 4;
- memcpy(ptr, &ref, 4); ptr += 4;
- memcpy(ptr, &mask, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glStencilMask_enc(void *self , GLuint mask)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glStencilMask;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mask, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glStencilOp_enc(void *self , GLenum fail, GLenum zfail, GLenum zpass)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glStencilOp;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &fail, 4); ptr += 4;
- memcpy(ptr, &zfail, 4); ptr += 4;
- memcpy(ptr, &zpass, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexEnvi_enc(void *self , GLenum target, GLenum pname, GLint param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexEnvi;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexEnvx_enc(void *self , GLenum target, GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexEnvx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexEnviv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexEnviv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexEnvxv_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexEnvxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexImage2D_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_pixels = ((pixels != NULL) ? glesv1_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &border, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_pixels,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
- if (pixels != NULL) {
- stream->writeFully(pixels, __size_pixels);
- if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glTexParameteri_enc(void *self , GLenum target, GLenum pname, GLint param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexParameterx_enc(void *self , GLenum target, GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameterx;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexParameteriv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexParameterxv_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_pixels = ((pixels != NULL) ? glesv1_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &xoffset, 4); ptr += 4;
- memcpy(ptr, &yoffset, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_pixels,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
- if (pixels != NULL) {
- stream->writeFully(pixels, __size_pixels);
- if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glTranslatex_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTranslatex;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glViewport_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glViewport;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glColorPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glColorPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glNormalPointerOffset_enc(void *self , GLenum type, GLsizei stride, GLuint offset)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glNormalPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointSizePointerOffset_enc(void *self , GLenum type, GLsizei stride, GLuint offset)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointSizePointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexCoordPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexCoordPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glWeightPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glWeightPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMatrixIndexPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMatrixIndexPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = datalen;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
- memcpy(ptr, &datalen, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glColorPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = datalen;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glColorPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
- memcpy(ptr, &datalen, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glNormalPointerData_enc(void *self , GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = datalen;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glNormalPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, 3, type, stride, datalen);ptr += __size_data;
- memcpy(ptr, &datalen, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexCoordPointerData_enc(void *self , GLint unit, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = datalen;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexCoordPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &unit, 4); ptr += 4;
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
- memcpy(ptr, &datalen, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointSizePointerData_enc(void *self , GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = datalen;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointSizePointerData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, 1, type, stride, datalen);ptr += __size_data;
- memcpy(ptr, &datalen, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glWeightPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = datalen;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glWeightPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen);ptr += __size_data;
- memcpy(ptr, &datalen, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMatrixIndexPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = datalen;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMatrixIndexPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &stride, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen);ptr += __size_data;
- memcpy(ptr, &datalen, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawElementsOffset_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawElementsOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawElementsData_enc(void *self , GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = datalen;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawElementsData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- memcpy(ptr, data, __size_data);ptr += __size_data;
- memcpy(ptr, &datalen, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetCompressedTextureFormats_enc(void *self , int count, GLint* formats)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_formats = (count * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_formats + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetCompressedTextureFormats;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &count, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_formats; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(formats, __size_formats);
- if (useChecksum) checksumCalculator->addBuffer(formats, __size_formats);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetCompressedTextureFormats: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-int glFinishRoundTrip_enc(void *self )
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFinishRoundTrip;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- int retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glFinishRoundTrip: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glBlendEquationSeparateOES_enc(void *self , GLenum modeRGB, GLenum modeAlpha)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBlendEquationSeparateOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &modeRGB, 4); ptr += 4;
- memcpy(ptr, &modeAlpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBlendFuncSeparateOES_enc(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBlendFuncSeparateOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &srcRGB, 4); ptr += 4;
- memcpy(ptr, &dstRGB, 4); ptr += 4;
- memcpy(ptr, &srcAlpha, 4); ptr += 4;
- memcpy(ptr, &dstAlpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBlendEquationOES_enc(void *self , GLenum mode)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBlendEquationOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawTexsOES_enc(void *self , GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 2 + 2 + 2 + 2 + 2;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawTexsOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 2); ptr += 2;
- memcpy(ptr, &y, 2); ptr += 2;
- memcpy(ptr, &z, 2); ptr += 2;
- memcpy(ptr, &width, 2); ptr += 2;
- memcpy(ptr, &height, 2); ptr += 2;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawTexiOES_enc(void *self , GLint x, GLint y, GLint z, GLint width, GLint height)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawTexiOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawTexxOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawTexxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawTexsvOES_enc(void *self , const GLshort* coords)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_coords = (5 * sizeof(GLshort));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawTexsvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_coords; ptr += 4;
- memcpy(ptr, coords, __size_coords);ptr += __size_coords;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawTexivOES_enc(void *self , const GLint* coords)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_coords = (5 * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawTexivOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_coords; ptr += 4;
- memcpy(ptr, coords, __size_coords);ptr += __size_coords;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawTexxvOES_enc(void *self , const GLfixed* coords)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_coords = (5 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawTexxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_coords; ptr += 4;
- memcpy(ptr, coords, __size_coords);ptr += __size_coords;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawTexfOES_enc(void *self , GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawTexfOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawTexfvOES_enc(void *self , const GLfloat* coords)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_coords = (5 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawTexfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_coords; ptr += 4;
- memcpy(ptr, coords, __size_coords);ptr += __size_coords;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glEGLImageTargetTexture2DOES_enc(void *self , GLenum target, GLeglImageOES image)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glEGLImageTargetTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &image, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glEGLImageTargetRenderbufferStorageOES_enc(void *self , GLenum target, GLeglImageOES image)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glEGLImageTargetRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &image, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glAlphaFuncxOES_enc(void *self , GLenum func, GLclampx ref)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glAlphaFuncxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &func, 4); ptr += 4;
- memcpy(ptr, &ref, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClearColorxOES_enc(void *self , GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearColorxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 4); ptr += 4;
- memcpy(ptr, &green, 4); ptr += 4;
- memcpy(ptr, &blue, 4); ptr += 4;
- memcpy(ptr, &alpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClearDepthxOES_enc(void *self , GLclampx depth)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearDepthxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &depth, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClipPlanexOES_enc(void *self , GLenum plane, const GLfixed* equation)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_equation = (4 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClipPlanexOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &plane, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_equation; ptr += 4;
- memcpy(ptr, equation, __size_equation);ptr += __size_equation;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClipPlanexIMG_enc(void *self , GLenum plane, const GLfixed* equation)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_equation = (4 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClipPlanexIMG;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &plane, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_equation; ptr += 4;
- memcpy(ptr, equation, __size_equation);ptr += __size_equation;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glColor4xOES_enc(void *self , GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glColor4xOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 4); ptr += 4;
- memcpy(ptr, &green, 4); ptr += 4;
- memcpy(ptr, &blue, 4); ptr += 4;
- memcpy(ptr, &alpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDepthRangexOES_enc(void *self , GLclampx zNear, GLclampx zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDepthRangexOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFogxOES_enc(void *self , GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFogxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFogxvOES_enc(void *self , GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFogxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFrustumxOES_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFrustumxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &left, 4); ptr += 4;
- memcpy(ptr, &right, 4); ptr += 4;
- memcpy(ptr, &bottom, 4); ptr += 4;
- memcpy(ptr, &top, 4); ptr += 4;
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetClipPlanexOES_enc(void *self , GLenum pname, GLfixed* eqn)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_eqn = (4 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_eqn + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetClipPlanexOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_eqn; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(eqn, __size_eqn);
- if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetClipPlanexOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetClipPlanex_enc(void *self , GLenum pname, GLfixed* eqn)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_eqn = (4 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_eqn + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetClipPlanex;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_eqn; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(eqn, __size_eqn);
- if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetClipPlanex: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetFixedvOES_enc(void *self , GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetFixedvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetFixedvOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetLightxvOES_enc(void *self , GLenum light, GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetLightxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &light, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetLightxvOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetMaterialxvOES_enc(void *self , GLenum face, GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetMaterialxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetMaterialxvOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetTexEnvxvOES_enc(void *self , GLenum env, GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexEnvxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &env, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetTexEnvxvOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetTexParameterxvOES_enc(void *self , GLenum target, GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetTexParameterxvOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glLightModelxOES_enc(void *self , GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightModelxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLightModelxvOES_enc(void *self , GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightModelxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLightxOES_enc(void *self , GLenum light, GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &light, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLightxvOES_enc(void *self , GLenum light, GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLightxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &light, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLineWidthxOES_enc(void *self , GLfixed width)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLineWidthxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &width, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLoadMatrixxOES_enc(void *self , const GLfixed* m)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_m = (16 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLoadMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_m; ptr += 4;
- memcpy(ptr, m, __size_m);ptr += __size_m;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMaterialxOES_enc(void *self , GLenum face, GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMaterialxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMaterialxvOES_enc(void *self , GLenum face, GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMaterialxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMultMatrixxOES_enc(void *self , const GLfixed* m)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_m = (16 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMultMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_m; ptr += 4;
- memcpy(ptr, m, __size_m);ptr += __size_m;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glMultiTexCoord4xOES_enc(void *self , GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glMultiTexCoord4xOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &s, 4); ptr += 4;
- memcpy(ptr, &t, 4); ptr += 4;
- memcpy(ptr, &r, 4); ptr += 4;
- memcpy(ptr, &q, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glNormal3xOES_enc(void *self , GLfixed nx, GLfixed ny, GLfixed nz)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glNormal3xOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &nx, 4); ptr += 4;
- memcpy(ptr, &ny, 4); ptr += 4;
- memcpy(ptr, &nz, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glOrthoxOES_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glOrthoxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &left, 4); ptr += 4;
- memcpy(ptr, &right, 4); ptr += 4;
- memcpy(ptr, &bottom, 4); ptr += 4;
- memcpy(ptr, &top, 4); ptr += 4;
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointParameterxOES_enc(void *self , GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointParameterxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointParameterxvOES_enc(void *self , GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPointSizexOES_enc(void *self , GLfixed size)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPointSizexOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &size, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPolygonOffsetxOES_enc(void *self , GLfixed factor, GLfixed units)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPolygonOffsetxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &factor, 4); ptr += 4;
- memcpy(ptr, &units, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glRotatexOES_enc(void *self , GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glRotatexOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &angle, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glSampleCoveragexOES_enc(void *self , GLclampx value, GLboolean invert)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 1;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glSampleCoveragexOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &value, 4); ptr += 4;
- memcpy(ptr, &invert, 1); ptr += 1;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glScalexOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glScalexOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexEnvxOES_enc(void *self , GLenum target, GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexEnvxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexEnvxvOES_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexEnvxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexParameterxOES_enc(void *self , GLenum target, GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameterxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexParameterxvOES_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTranslatexOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTranslatexOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-GLboolean glIsRenderbufferOES_enc(void *self , GLuint renderbuffer)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &renderbuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsRenderbufferOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glBindRenderbufferOES_enc(void *self , GLenum target, GLuint renderbuffer)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &renderbuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteRenderbuffersOES_enc(void *self , GLsizei n, const GLuint* renderbuffers)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_renderbuffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_renderbuffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteRenderbuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
- memcpy(ptr, renderbuffers, __size_renderbuffers);ptr += __size_renderbuffers;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGenRenderbuffersOES_enc(void *self , GLsizei n, GLuint* renderbuffers)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_renderbuffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_renderbuffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenRenderbuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(renderbuffers, __size_renderbuffers);
- if (useChecksum) checksumCalculator->addBuffer(renderbuffers, __size_renderbuffers);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGenRenderbuffersOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glRenderbufferStorageOES_enc(void *self , GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetRenderbufferParameterivOES_enc(void *self , GLenum target, GLenum pname, GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetRenderbufferParameterivOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetRenderbufferParameterivOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-GLboolean glIsFramebufferOES_enc(void *self , GLuint framebuffer)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsFramebufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &framebuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsFramebufferOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glBindFramebufferOES_enc(void *self , GLenum target, GLuint framebuffer)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindFramebufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &framebuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteFramebuffersOES_enc(void *self , GLsizei n, const GLuint* framebuffers)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_framebuffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_framebuffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteFramebuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
- memcpy(ptr, framebuffers, __size_framebuffers);ptr += __size_framebuffers;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGenFramebuffersOES_enc(void *self , GLsizei n, GLuint* framebuffers)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_framebuffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_framebuffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenFramebuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(framebuffers, __size_framebuffers);
- if (useChecksum) checksumCalculator->addBuffer(framebuffers, __size_framebuffers);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGenFramebuffersOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-GLenum glCheckFramebufferStatusOES_enc(void *self , GLenum target)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCheckFramebufferStatusOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLenum retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glCheckFramebufferStatusOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glFramebufferRenderbufferOES_enc(void *self , GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFramebufferRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &attachment, 4); ptr += 4;
- memcpy(ptr, &renderbuffertarget, 4); ptr += 4;
- memcpy(ptr, &renderbuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFramebufferTexture2DOES_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFramebufferTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &attachment, 4); ptr += 4;
- memcpy(ptr, &textarget, 4); ptr += 4;
- memcpy(ptr, &texture, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetFramebufferAttachmentParameterivOES_enc(void *self , GLenum target, GLenum attachment, GLenum pname, GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetFramebufferAttachmentParameterivOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &attachment, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetFramebufferAttachmentParameterivOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGenerateMipmapOES_enc(void *self , GLenum target)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenerateMipmapOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-GLboolean glUnmapBufferOES_enc(void *self , GLenum target)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUnmapBufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glUnmapBufferOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glCurrentPaletteMatrixOES_enc(void *self , GLuint matrixpaletteindex)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCurrentPaletteMatrixOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &matrixpaletteindex, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLoadPaletteFromModelViewMatrixOES_enc(void *self )
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLoadPaletteFromModelViewMatrixOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-GLbitfield glQueryMatrixxOES_enc(void *self , GLfixed* mantissa, GLint* exponent)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_mantissa = (16 * sizeof(GLfixed));
- const unsigned int __size_exponent = (16 * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_mantissa + __size_exponent + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glQueryMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_mantissa; ptr += 4;
- *(unsigned int *)(ptr) = __size_exponent; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(mantissa, __size_mantissa);
- if (useChecksum) checksumCalculator->addBuffer(mantissa, __size_mantissa);
- stream->readback(exponent, __size_exponent);
- if (useChecksum) checksumCalculator->addBuffer(exponent, __size_exponent);
-
- GLbitfield retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glQueryMatrixxOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glDepthRangefOES_enc(void *self , GLclampf zNear, GLclampf zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDepthRangefOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFrustumfOES_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFrustumfOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &left, 4); ptr += 4;
- memcpy(ptr, &right, 4); ptr += 4;
- memcpy(ptr, &bottom, 4); ptr += 4;
- memcpy(ptr, &top, 4); ptr += 4;
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glOrthofOES_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glOrthofOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &left, 4); ptr += 4;
- memcpy(ptr, &right, 4); ptr += 4;
- memcpy(ptr, &bottom, 4); ptr += 4;
- memcpy(ptr, &top, 4); ptr += 4;
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClipPlanefOES_enc(void *self , GLenum plane, const GLfloat* equation)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_equation = (4 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClipPlanefOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &plane, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_equation; ptr += 4;
- memcpy(ptr, equation, __size_equation);ptr += __size_equation;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClipPlanefIMG_enc(void *self , GLenum plane, const GLfloat* equation)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_equation = (4 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClipPlanefIMG;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &plane, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_equation; ptr += 4;
- memcpy(ptr, equation, __size_equation);ptr += __size_equation;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetClipPlanefOES_enc(void *self , GLenum pname, GLfloat* eqn)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_eqn = (4 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_eqn + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetClipPlanefOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_eqn; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(eqn, __size_eqn);
- if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetClipPlanefOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glClearDepthfOES_enc(void *self , GLclampf depth)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearDepthfOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &depth, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexGenfOES_enc(void *self , GLenum coord, GLenum pname, GLfloat param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexGenfOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &coord, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexGenfvOES_enc(void *self , GLenum coord, GLenum pname, const GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexGenfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &coord, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexGeniOES_enc(void *self , GLenum coord, GLenum pname, GLint param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexGeniOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &coord, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexGenivOES_enc(void *self , GLenum coord, GLenum pname, const GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexGenivOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &coord, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexGenxOES_enc(void *self , GLenum coord, GLenum pname, GLfixed param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexGenxOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &coord, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexGenxvOES_enc(void *self , GLenum coord, GLenum pname, const GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexGenxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &coord, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetTexGenfvOES_enc(void *self , GLenum coord, GLenum pname, GLfloat* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexGenfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &coord, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetTexGenivOES_enc(void *self , GLenum coord, GLenum pname, GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexGenivOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &coord, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetTexGenxvOES_enc(void *self , GLenum coord, GLenum pname, GLfixed* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfixed));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexGenxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &coord, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBindVertexArrayOES_enc(void *self , GLuint array)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &array, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteVertexArraysOES_enc(void *self , GLsizei n, const GLuint* arrays)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_arrays = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_arrays + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_arrays; ptr += 4;
- memcpy(ptr, arrays, __size_arrays);ptr += __size_arrays;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGenVertexArraysOES_enc(void *self , GLsizei n, GLuint* arrays)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_arrays = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_arrays + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_arrays; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(arrays, __size_arrays);
- if (useChecksum) checksumCalculator->addBuffer(arrays, __size_arrays);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGenVertexArraysOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-GLboolean glIsVertexArrayOES_enc(void *self , GLuint array)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &array, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsVertexArrayOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glDiscardFramebufferEXT_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_attachments = (numAttachments * sizeof(const GLenum));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_attachments + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDiscardFramebufferEXT;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &numAttachments, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_attachments; ptr += 4;
- memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glRenderbufferStorageMultisampleIMG_enc(void *self , GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glRenderbufferStorageMultisampleIMG;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &samples, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFramebufferTexture2DMultisampleIMG_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFramebufferTexture2DMultisampleIMG;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &attachment, 4); ptr += 4;
- memcpy(ptr, &textarget, 4); ptr += 4;
- memcpy(ptr, &texture, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &samples, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteFencesNV_enc(void *self , GLsizei n, const GLuint* fences)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_fences = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_fences + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteFencesNV;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_fences; ptr += 4;
- memcpy(ptr, fences, __size_fences);ptr += __size_fences;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGenFencesNV_enc(void *self , GLsizei n, GLuint* fences)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_fences = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_fences + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenFencesNV;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_fences; ptr += 4;
- memcpy(ptr, fences, __size_fences);ptr += __size_fences;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-GLboolean glIsFenceNV_enc(void *self , GLuint fence)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &fence, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsFenceNV: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-GLboolean glTestFenceNV_enc(void *self , GLuint fence)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTestFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &fence, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glTestFenceNV: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glGetFenceivNV_enc(void *self , GLuint fence, GLenum pname, GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetFenceivNV;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &fence, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetFenceivNV: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glFinishFenceNV_enc(void *self , GLuint fence)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFinishFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &fence, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glSetFenceNV_enc(void *self , GLuint fence, GLenum condition)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glSetFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &fence, 4); ptr += 4;
- memcpy(ptr, &condition, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetDriverControlsQCOM_enc(void *self , GLint* num, GLsizei size, GLuint* driverControls)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_num = (1 * sizeof(GLint));
- const unsigned int __size_driverControls = (size * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_num + 4 + __size_driverControls + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetDriverControlsQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_num; ptr += 4;
- memcpy(ptr, &size, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_driverControls; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(num, __size_num);
- if (useChecksum) checksumCalculator->addBuffer(num, __size_num);
- stream->readback(driverControls, __size_driverControls);
- if (useChecksum) checksumCalculator->addBuffer(driverControls, __size_driverControls);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetDriverControlsQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetDriverControlStringQCOM_enc(void *self , GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_length = (1 * sizeof(GLsizei));
- const unsigned int __size_driverControlString = (1 * sizeof(GLchar));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_length + __size_driverControlString + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetDriverControlStringQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &driverControl, 4); ptr += 4;
- memcpy(ptr, &bufSize, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_length; ptr += 4;
- *(unsigned int *)(ptr) = __size_driverControlString; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(length, __size_length);
- if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
- stream->readback(driverControlString, __size_driverControlString);
- if (useChecksum) checksumCalculator->addBuffer(driverControlString, __size_driverControlString);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetDriverControlStringQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glEnableDriverControlQCOM_enc(void *self , GLuint driverControl)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glEnableDriverControlQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &driverControl, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDisableDriverControlQCOM_enc(void *self , GLuint driverControl)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDisableDriverControlQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &driverControl, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glExtGetTexturesQCOM_enc(void *self , GLuint* textures, GLint maxTextures, GLint* numTextures)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_textures = (maxTextures * sizeof(GLuint));
- const unsigned int __size_numTextures = (1 * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_textures + 4 + __size_numTextures + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glExtGetTexturesQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_textures; ptr += 4;
- memcpy(ptr, &maxTextures, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_numTextures; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(textures, __size_textures);
- if (useChecksum) checksumCalculator->addBuffer(textures, __size_textures);
- stream->readback(numTextures, __size_numTextures);
- if (useChecksum) checksumCalculator->addBuffer(numTextures, __size_numTextures);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glExtGetTexturesQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glExtGetBuffersQCOM_enc(void *self , GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_buffers = (maxBuffers * sizeof(GLuint));
- const unsigned int __size_numBuffers = (1 * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_buffers + 4 + __size_numBuffers + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glExtGetBuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_buffers; ptr += 4;
- memcpy(ptr, &maxBuffers, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_numBuffers; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(buffers, __size_buffers);
- if (useChecksum) checksumCalculator->addBuffer(buffers, __size_buffers);
- stream->readback(numBuffers, __size_numBuffers);
- if (useChecksum) checksumCalculator->addBuffer(numBuffers, __size_numBuffers);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glExtGetBuffersQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glExtGetRenderbuffersQCOM_enc(void *self , GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_renderbuffers = (maxRenderbuffers * sizeof(GLuint));
- const unsigned int __size_numRenderbuffers = (1 * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_renderbuffers + 4 + __size_numRenderbuffers + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glExtGetRenderbuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
- memcpy(ptr, &maxRenderbuffers, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_numRenderbuffers; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(renderbuffers, __size_renderbuffers);
- if (useChecksum) checksumCalculator->addBuffer(renderbuffers, __size_renderbuffers);
- stream->readback(numRenderbuffers, __size_numRenderbuffers);
- if (useChecksum) checksumCalculator->addBuffer(numRenderbuffers, __size_numRenderbuffers);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glExtGetRenderbuffersQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glExtGetFramebuffersQCOM_enc(void *self , GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_framebuffers = (maxFramebuffers * sizeof(GLuint));
- const unsigned int __size_numFramebuffers = (1 * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_framebuffers + 4 + __size_numFramebuffers + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glExtGetFramebuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
- memcpy(ptr, &maxFramebuffers, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_numFramebuffers; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(framebuffers, __size_framebuffers);
- if (useChecksum) checksumCalculator->addBuffer(framebuffers, __size_framebuffers);
- stream->readback(numFramebuffers, __size_numFramebuffers);
- if (useChecksum) checksumCalculator->addBuffer(numFramebuffers, __size_numFramebuffers);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glExtGetFramebuffersQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glExtGetTexLevelParameterivQCOM_enc(void *self , GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glExtGetTexLevelParameterivQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &texture, 4); ptr += 4;
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glExtGetTexLevelParameterivQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glExtTexObjectStateOverrideiQCOM_enc(void *self , GLenum target, GLenum pname, GLint param)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glExtTexObjectStateOverrideiQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glExtGetTexSubImageQCOM_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_texels = (depth * glesv1_enc::pixelDataSize(self, width, height, format, type, 0));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_texels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glExtGetTexSubImageQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &xoffset, 4); ptr += 4;
- memcpy(ptr, &yoffset, 4); ptr += 4;
- memcpy(ptr, &zoffset, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &depth, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_texels; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(texels, __size_texels);
- if (useChecksum) checksumCalculator->addBuffer(texels, __size_texels);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glExtGetTexSubImageQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glExtGetShadersQCOM_enc(void *self , GLuint* shaders, GLint maxShaders, GLint* numShaders)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_shaders = (maxShaders * sizeof(GLuint));
- const unsigned int __size_numShaders = (1 * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_shaders + 4 + __size_numShaders + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glExtGetShadersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_shaders; ptr += 4;
- memcpy(ptr, &maxShaders, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_numShaders; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(shaders, __size_shaders);
- if (useChecksum) checksumCalculator->addBuffer(shaders, __size_shaders);
- stream->readback(numShaders, __size_numShaders);
- if (useChecksum) checksumCalculator->addBuffer(numShaders, __size_numShaders);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glExtGetShadersQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glExtGetProgramsQCOM_enc(void *self , GLuint* programs, GLint maxPrograms, GLint* numPrograms)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_programs = (maxPrograms * sizeof(GLuint));
- const unsigned int __size_numPrograms = (1 * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_programs + 4 + __size_numPrograms + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glExtGetProgramsQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_programs; ptr += 4;
- memcpy(ptr, &maxPrograms, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_numPrograms; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(programs, __size_programs);
- if (useChecksum) checksumCalculator->addBuffer(programs, __size_programs);
- stream->readback(numPrograms, __size_numPrograms);
- if (useChecksum) checksumCalculator->addBuffer(numPrograms, __size_numPrograms);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glExtGetProgramsQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-GLboolean glExtIsProgramBinaryQCOM_enc(void *self , GLuint program)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glExtIsProgramBinaryQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glExtIsProgramBinaryQCOM: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glStartTilingQCOM_enc(void *self , GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glStartTilingQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &preserveMask, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glEndTilingQCOM_enc(void *self , GLbitfield preserveMask)
-{
-
- gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glEndTilingQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &preserveMask, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-} // namespace
-
-gl_encoder_context_t::gl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
-{
- m_stream = stream;
- m_checksumCalculator = checksumCalculator;
-
- this->glAlphaFunc = &glAlphaFunc_enc;
- this->glClearColor = &glClearColor_enc;
- this->glClearDepthf = &glClearDepthf_enc;
- this->glClipPlanef = &glClipPlanef_enc;
- this->glColor4f = &glColor4f_enc;
- this->glDepthRangef = &glDepthRangef_enc;
- this->glFogf = &glFogf_enc;
- this->glFogfv = &glFogfv_enc;
- this->glFrustumf = &glFrustumf_enc;
- this->glGetClipPlanef = &glGetClipPlanef_enc;
- this->glGetFloatv = &glGetFloatv_enc;
- this->glGetLightfv = &glGetLightfv_enc;
- this->glGetMaterialfv = &glGetMaterialfv_enc;
- this->glGetTexEnvfv = &glGetTexEnvfv_enc;
- this->glGetTexParameterfv = &glGetTexParameterfv_enc;
- this->glLightModelf = &glLightModelf_enc;
- this->glLightModelfv = &glLightModelfv_enc;
- this->glLightf = &glLightf_enc;
- this->glLightfv = &glLightfv_enc;
- this->glLineWidth = &glLineWidth_enc;
- this->glLoadMatrixf = &glLoadMatrixf_enc;
- this->glMaterialf = &glMaterialf_enc;
- this->glMaterialfv = &glMaterialfv_enc;
- this->glMultMatrixf = &glMultMatrixf_enc;
- this->glMultiTexCoord4f = &glMultiTexCoord4f_enc;
- this->glNormal3f = &glNormal3f_enc;
- this->glOrthof = &glOrthof_enc;
- this->glPointParameterf = &glPointParameterf_enc;
- this->glPointParameterfv = &glPointParameterfv_enc;
- this->glPointSize = &glPointSize_enc;
- this->glPolygonOffset = &glPolygonOffset_enc;
- this->glRotatef = &glRotatef_enc;
- this->glScalef = &glScalef_enc;
- this->glTexEnvf = &glTexEnvf_enc;
- this->glTexEnvfv = &glTexEnvfv_enc;
- this->glTexParameterf = &glTexParameterf_enc;
- this->glTexParameterfv = &glTexParameterfv_enc;
- this->glTranslatef = &glTranslatef_enc;
- this->glActiveTexture = &glActiveTexture_enc;
- this->glAlphaFuncx = &glAlphaFuncx_enc;
- this->glBindBuffer = &glBindBuffer_enc;
- this->glBindTexture = &glBindTexture_enc;
- this->glBlendFunc = &glBlendFunc_enc;
- this->glBufferData = &glBufferData_enc;
- this->glBufferSubData = &glBufferSubData_enc;
- this->glClear = &glClear_enc;
- this->glClearColorx = &glClearColorx_enc;
- this->glClearDepthx = &glClearDepthx_enc;
- this->glClearStencil = &glClearStencil_enc;
- this->glClientActiveTexture = &glClientActiveTexture_enc;
- this->glColor4ub = &glColor4ub_enc;
- this->glColor4x = &glColor4x_enc;
- this->glColorMask = &glColorMask_enc;
- this->glColorPointer = (glColorPointer_client_proc_t) &enc_unsupported;
- this->glCompressedTexImage2D = &glCompressedTexImage2D_enc;
- this->glCompressedTexSubImage2D = &glCompressedTexSubImage2D_enc;
- this->glCopyTexImage2D = &glCopyTexImage2D_enc;
- this->glCopyTexSubImage2D = &glCopyTexSubImage2D_enc;
- this->glCullFace = &glCullFace_enc;
- this->glDeleteBuffers = &glDeleteBuffers_enc;
- this->glDeleteTextures = &glDeleteTextures_enc;
- this->glDepthFunc = &glDepthFunc_enc;
- this->glDepthMask = &glDepthMask_enc;
- this->glDepthRangex = &glDepthRangex_enc;
- this->glDisable = &glDisable_enc;
- this->glDisableClientState = &glDisableClientState_enc;
- this->glDrawArrays = &glDrawArrays_enc;
- this->glDrawElements = (glDrawElements_client_proc_t) &enc_unsupported;
- this->glEnable = &glEnable_enc;
- this->glEnableClientState = &glEnableClientState_enc;
- this->glFinish = &glFinish_enc;
- this->glFlush = &glFlush_enc;
- this->glFogx = &glFogx_enc;
- this->glFogxv = &glFogxv_enc;
- this->glFrontFace = &glFrontFace_enc;
- this->glFrustumx = &glFrustumx_enc;
- this->glGetBooleanv = &glGetBooleanv_enc;
- this->glGetBufferParameteriv = &glGetBufferParameteriv_enc;
- this->glClipPlanex = &glClipPlanex_enc;
- this->glGenBuffers = &glGenBuffers_enc;
- this->glGenTextures = &glGenTextures_enc;
- this->glGetError = &glGetError_enc;
- this->glGetFixedv = &glGetFixedv_enc;
- this->glGetIntegerv = &glGetIntegerv_enc;
- this->glGetLightxv = &glGetLightxv_enc;
- this->glGetMaterialxv = &glGetMaterialxv_enc;
- this->glGetPointerv = (glGetPointerv_client_proc_t) &enc_unsupported;
- this->glGetString = (glGetString_client_proc_t) &enc_unsupported;
- this->glGetTexEnviv = &glGetTexEnviv_enc;
- this->glGetTexEnvxv = &glGetTexEnvxv_enc;
- this->glGetTexParameteriv = &glGetTexParameteriv_enc;
- this->glGetTexParameterxv = &glGetTexParameterxv_enc;
- this->glHint = &glHint_enc;
- this->glIsBuffer = &glIsBuffer_enc;
- this->glIsEnabled = &glIsEnabled_enc;
- this->glIsTexture = &glIsTexture_enc;
- this->glLightModelx = &glLightModelx_enc;
- this->glLightModelxv = &glLightModelxv_enc;
- this->glLightx = &glLightx_enc;
- this->glLightxv = &glLightxv_enc;
- this->glLineWidthx = &glLineWidthx_enc;
- this->glLoadIdentity = &glLoadIdentity_enc;
- this->glLoadMatrixx = &glLoadMatrixx_enc;
- this->glLogicOp = &glLogicOp_enc;
- this->glMaterialx = &glMaterialx_enc;
- this->glMaterialxv = &glMaterialxv_enc;
- this->glMatrixMode = &glMatrixMode_enc;
- this->glMultMatrixx = &glMultMatrixx_enc;
- this->glMultiTexCoord4x = &glMultiTexCoord4x_enc;
- this->glNormal3x = &glNormal3x_enc;
- this->glNormalPointer = (glNormalPointer_client_proc_t) &enc_unsupported;
- this->glOrthox = &glOrthox_enc;
- this->glPixelStorei = &glPixelStorei_enc;
- this->glPointParameterx = &glPointParameterx_enc;
- this->glPointParameterxv = &glPointParameterxv_enc;
- this->glPointSizex = &glPointSizex_enc;
- this->glPolygonOffsetx = &glPolygonOffsetx_enc;
- this->glPopMatrix = &glPopMatrix_enc;
- this->glPushMatrix = &glPushMatrix_enc;
- this->glReadPixels = &glReadPixels_enc;
- this->glRotatex = &glRotatex_enc;
- this->glSampleCoverage = &glSampleCoverage_enc;
- this->glSampleCoveragex = &glSampleCoveragex_enc;
- this->glScalex = &glScalex_enc;
- this->glScissor = &glScissor_enc;
- this->glShadeModel = &glShadeModel_enc;
- this->glStencilFunc = &glStencilFunc_enc;
- this->glStencilMask = &glStencilMask_enc;
- this->glStencilOp = &glStencilOp_enc;
- this->glTexCoordPointer = (glTexCoordPointer_client_proc_t) &enc_unsupported;
- this->glTexEnvi = &glTexEnvi_enc;
- this->glTexEnvx = &glTexEnvx_enc;
- this->glTexEnviv = &glTexEnviv_enc;
- this->glTexEnvxv = &glTexEnvxv_enc;
- this->glTexImage2D = &glTexImage2D_enc;
- this->glTexParameteri = &glTexParameteri_enc;
- this->glTexParameterx = &glTexParameterx_enc;
- this->glTexParameteriv = &glTexParameteriv_enc;
- this->glTexParameterxv = &glTexParameterxv_enc;
- this->glTexSubImage2D = &glTexSubImage2D_enc;
- this->glTranslatex = &glTranslatex_enc;
- this->glVertexPointer = (glVertexPointer_client_proc_t) &enc_unsupported;
- this->glViewport = &glViewport_enc;
- this->glPointSizePointerOES = (glPointSizePointerOES_client_proc_t) &enc_unsupported;
- this->glVertexPointerOffset = &glVertexPointerOffset_enc;
- this->glColorPointerOffset = &glColorPointerOffset_enc;
- this->glNormalPointerOffset = &glNormalPointerOffset_enc;
- this->glPointSizePointerOffset = &glPointSizePointerOffset_enc;
- this->glTexCoordPointerOffset = &glTexCoordPointerOffset_enc;
- this->glWeightPointerOffset = &glWeightPointerOffset_enc;
- this->glMatrixIndexPointerOffset = &glMatrixIndexPointerOffset_enc;
- this->glVertexPointerData = &glVertexPointerData_enc;
- this->glColorPointerData = &glColorPointerData_enc;
- this->glNormalPointerData = &glNormalPointerData_enc;
- this->glTexCoordPointerData = &glTexCoordPointerData_enc;
- this->glPointSizePointerData = &glPointSizePointerData_enc;
- this->glWeightPointerData = &glWeightPointerData_enc;
- this->glMatrixIndexPointerData = &glMatrixIndexPointerData_enc;
- this->glDrawElementsOffset = &glDrawElementsOffset_enc;
- this->glDrawElementsData = &glDrawElementsData_enc;
- this->glGetCompressedTextureFormats = &glGetCompressedTextureFormats_enc;
- this->glFinishRoundTrip = &glFinishRoundTrip_enc;
- this->glBlendEquationSeparateOES = &glBlendEquationSeparateOES_enc;
- this->glBlendFuncSeparateOES = &glBlendFuncSeparateOES_enc;
- this->glBlendEquationOES = &glBlendEquationOES_enc;
- this->glDrawTexsOES = &glDrawTexsOES_enc;
- this->glDrawTexiOES = &glDrawTexiOES_enc;
- this->glDrawTexxOES = &glDrawTexxOES_enc;
- this->glDrawTexsvOES = &glDrawTexsvOES_enc;
- this->glDrawTexivOES = &glDrawTexivOES_enc;
- this->glDrawTexxvOES = &glDrawTexxvOES_enc;
- this->glDrawTexfOES = &glDrawTexfOES_enc;
- this->glDrawTexfvOES = &glDrawTexfvOES_enc;
- this->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES_enc;
- this->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES_enc;
- this->glAlphaFuncxOES = &glAlphaFuncxOES_enc;
- this->glClearColorxOES = &glClearColorxOES_enc;
- this->glClearDepthxOES = &glClearDepthxOES_enc;
- this->glClipPlanexOES = &glClipPlanexOES_enc;
- this->glClipPlanexIMG = &glClipPlanexIMG_enc;
- this->glColor4xOES = &glColor4xOES_enc;
- this->glDepthRangexOES = &glDepthRangexOES_enc;
- this->glFogxOES = &glFogxOES_enc;
- this->glFogxvOES = &glFogxvOES_enc;
- this->glFrustumxOES = &glFrustumxOES_enc;
- this->glGetClipPlanexOES = &glGetClipPlanexOES_enc;
- this->glGetClipPlanex = &glGetClipPlanex_enc;
- this->glGetFixedvOES = &glGetFixedvOES_enc;
- this->glGetLightxvOES = &glGetLightxvOES_enc;
- this->glGetMaterialxvOES = &glGetMaterialxvOES_enc;
- this->glGetTexEnvxvOES = &glGetTexEnvxvOES_enc;
- this->glGetTexParameterxvOES = &glGetTexParameterxvOES_enc;
- this->glLightModelxOES = &glLightModelxOES_enc;
- this->glLightModelxvOES = &glLightModelxvOES_enc;
- this->glLightxOES = &glLightxOES_enc;
- this->glLightxvOES = &glLightxvOES_enc;
- this->glLineWidthxOES = &glLineWidthxOES_enc;
- this->glLoadMatrixxOES = &glLoadMatrixxOES_enc;
- this->glMaterialxOES = &glMaterialxOES_enc;
- this->glMaterialxvOES = &glMaterialxvOES_enc;
- this->glMultMatrixxOES = &glMultMatrixxOES_enc;
- this->glMultiTexCoord4xOES = &glMultiTexCoord4xOES_enc;
- this->glNormal3xOES = &glNormal3xOES_enc;
- this->glOrthoxOES = &glOrthoxOES_enc;
- this->glPointParameterxOES = &glPointParameterxOES_enc;
- this->glPointParameterxvOES = &glPointParameterxvOES_enc;
- this->glPointSizexOES = &glPointSizexOES_enc;
- this->glPolygonOffsetxOES = &glPolygonOffsetxOES_enc;
- this->glRotatexOES = &glRotatexOES_enc;
- this->glSampleCoveragexOES = &glSampleCoveragexOES_enc;
- this->glScalexOES = &glScalexOES_enc;
- this->glTexEnvxOES = &glTexEnvxOES_enc;
- this->glTexEnvxvOES = &glTexEnvxvOES_enc;
- this->glTexParameterxOES = &glTexParameterxOES_enc;
- this->glTexParameterxvOES = &glTexParameterxvOES_enc;
- this->glTranslatexOES = &glTranslatexOES_enc;
- this->glIsRenderbufferOES = &glIsRenderbufferOES_enc;
- this->glBindRenderbufferOES = &glBindRenderbufferOES_enc;
- this->glDeleteRenderbuffersOES = &glDeleteRenderbuffersOES_enc;
- this->glGenRenderbuffersOES = &glGenRenderbuffersOES_enc;
- this->glRenderbufferStorageOES = &glRenderbufferStorageOES_enc;
- this->glGetRenderbufferParameterivOES = &glGetRenderbufferParameterivOES_enc;
- this->glIsFramebufferOES = &glIsFramebufferOES_enc;
- this->glBindFramebufferOES = &glBindFramebufferOES_enc;
- this->glDeleteFramebuffersOES = &glDeleteFramebuffersOES_enc;
- this->glGenFramebuffersOES = &glGenFramebuffersOES_enc;
- this->glCheckFramebufferStatusOES = &glCheckFramebufferStatusOES_enc;
- this->glFramebufferRenderbufferOES = &glFramebufferRenderbufferOES_enc;
- this->glFramebufferTexture2DOES = &glFramebufferTexture2DOES_enc;
- this->glGetFramebufferAttachmentParameterivOES = &glGetFramebufferAttachmentParameterivOES_enc;
- this->glGenerateMipmapOES = &glGenerateMipmapOES_enc;
- this->glMapBufferOES = (glMapBufferOES_client_proc_t) &enc_unsupported;
- this->glUnmapBufferOES = &glUnmapBufferOES_enc;
- this->glGetBufferPointervOES = (glGetBufferPointervOES_client_proc_t) &enc_unsupported;
- this->glCurrentPaletteMatrixOES = &glCurrentPaletteMatrixOES_enc;
- this->glLoadPaletteFromModelViewMatrixOES = &glLoadPaletteFromModelViewMatrixOES_enc;
- this->glMatrixIndexPointerOES = (glMatrixIndexPointerOES_client_proc_t) &enc_unsupported;
- this->glWeightPointerOES = (glWeightPointerOES_client_proc_t) &enc_unsupported;
- this->glQueryMatrixxOES = &glQueryMatrixxOES_enc;
- this->glDepthRangefOES = &glDepthRangefOES_enc;
- this->glFrustumfOES = &glFrustumfOES_enc;
- this->glOrthofOES = &glOrthofOES_enc;
- this->glClipPlanefOES = &glClipPlanefOES_enc;
- this->glClipPlanefIMG = &glClipPlanefIMG_enc;
- this->glGetClipPlanefOES = &glGetClipPlanefOES_enc;
- this->glClearDepthfOES = &glClearDepthfOES_enc;
- this->glTexGenfOES = &glTexGenfOES_enc;
- this->glTexGenfvOES = &glTexGenfvOES_enc;
- this->glTexGeniOES = &glTexGeniOES_enc;
- this->glTexGenivOES = &glTexGenivOES_enc;
- this->glTexGenxOES = &glTexGenxOES_enc;
- this->glTexGenxvOES = &glTexGenxvOES_enc;
- this->glGetTexGenfvOES = &glGetTexGenfvOES_enc;
- this->glGetTexGenivOES = &glGetTexGenivOES_enc;
- this->glGetTexGenxvOES = &glGetTexGenxvOES_enc;
- this->glBindVertexArrayOES = &glBindVertexArrayOES_enc;
- this->glDeleteVertexArraysOES = &glDeleteVertexArraysOES_enc;
- this->glGenVertexArraysOES = &glGenVertexArraysOES_enc;
- this->glIsVertexArrayOES = &glIsVertexArrayOES_enc;
- this->glDiscardFramebufferEXT = &glDiscardFramebufferEXT_enc;
- this->glMultiDrawArraysEXT = (glMultiDrawArraysEXT_client_proc_t) &enc_unsupported;
- this->glMultiDrawElementsEXT = (glMultiDrawElementsEXT_client_proc_t) &enc_unsupported;
- this->glMultiDrawArraysSUN = (glMultiDrawArraysSUN_client_proc_t) &enc_unsupported;
- this->glMultiDrawElementsSUN = (glMultiDrawElementsSUN_client_proc_t) &enc_unsupported;
- this->glRenderbufferStorageMultisampleIMG = &glRenderbufferStorageMultisampleIMG_enc;
- this->glFramebufferTexture2DMultisampleIMG = &glFramebufferTexture2DMultisampleIMG_enc;
- this->glDeleteFencesNV = &glDeleteFencesNV_enc;
- this->glGenFencesNV = &glGenFencesNV_enc;
- this->glIsFenceNV = &glIsFenceNV_enc;
- this->glTestFenceNV = &glTestFenceNV_enc;
- this->glGetFenceivNV = &glGetFenceivNV_enc;
- this->glFinishFenceNV = &glFinishFenceNV_enc;
- this->glSetFenceNV = &glSetFenceNV_enc;
- this->glGetDriverControlsQCOM = &glGetDriverControlsQCOM_enc;
- this->glGetDriverControlStringQCOM = &glGetDriverControlStringQCOM_enc;
- this->glEnableDriverControlQCOM = &glEnableDriverControlQCOM_enc;
- this->glDisableDriverControlQCOM = &glDisableDriverControlQCOM_enc;
- this->glExtGetTexturesQCOM = &glExtGetTexturesQCOM_enc;
- this->glExtGetBuffersQCOM = &glExtGetBuffersQCOM_enc;
- this->glExtGetRenderbuffersQCOM = &glExtGetRenderbuffersQCOM_enc;
- this->glExtGetFramebuffersQCOM = &glExtGetFramebuffersQCOM_enc;
- this->glExtGetTexLevelParameterivQCOM = &glExtGetTexLevelParameterivQCOM_enc;
- this->glExtTexObjectStateOverrideiQCOM = &glExtTexObjectStateOverrideiQCOM_enc;
- this->glExtGetTexSubImageQCOM = &glExtGetTexSubImageQCOM_enc;
- this->glExtGetBufferPointervQCOM = (glExtGetBufferPointervQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetShadersQCOM = &glExtGetShadersQCOM_enc;
- this->glExtGetProgramsQCOM = &glExtGetProgramsQCOM_enc;
- this->glExtIsProgramBinaryQCOM = &glExtIsProgramBinaryQCOM_enc;
- this->glExtGetProgramBinarySourceQCOM = (glExtGetProgramBinarySourceQCOM_client_proc_t) &enc_unsupported;
- this->glStartTilingQCOM = &glStartTilingQCOM_enc;
- this->glEndTilingQCOM = &glEndTilingQCOM_enc;
-}
-
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-
-#ifndef GUARD_gl_encoder_context_t
-#define GUARD_gl_encoder_context_t
-
-#include "IOStream.h"
-#include "ChecksumCalculator.h"
-#include "gl_client_context.h"
-
-
-#include "glUtils.h"
-#include "GLEncoderUtils.h"
-
-struct gl_encoder_context_t : public gl_client_context_t {
-
- IOStream *m_stream;
- ChecksumCalculator *m_checksumCalculator;
-
- gl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator);
-};
-
-#endif // GUARD_gl_encoder_context_t
\ No newline at end of file
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#include <stdio.h>
-#include <stdlib.h>
-#include "gl_client_context.h"
-
-#ifndef GL_TRUE
-extern "C" {
- void glAlphaFunc(GLenum func, GLclampf ref);
- void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- void glClearDepthf(GLclampf depth);
- void glClipPlanef(GLenum plane, const GLfloat* equation);
- void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
- void glDepthRangef(GLclampf zNear, GLclampf zFar);
- void glFogf(GLenum pname, GLfloat param);
- void glFogfv(GLenum pname, const GLfloat* params);
- void glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
- void glGetClipPlanef(GLenum pname, GLfloat* eqn);
- void glGetFloatv(GLenum pname, GLfloat* params);
- void glGetLightfv(GLenum light, GLenum pname, GLfloat* params);
- void glGetMaterialfv(GLenum face, GLenum pname, GLfloat* params);
- void glGetTexEnvfv(GLenum env, GLenum pname, GLfloat* params);
- void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
- void glLightModelf(GLenum pname, GLfloat param);
- void glLightModelfv(GLenum pname, const GLfloat* params);
- void glLightf(GLenum light, GLenum pname, GLfloat param);
- void glLightfv(GLenum light, GLenum pname, const GLfloat* params);
- void glLineWidth(GLfloat width);
- void glLoadMatrixf(const GLfloat* m);
- void glMaterialf(GLenum face, GLenum pname, GLfloat param);
- void glMaterialfv(GLenum face, GLenum pname, const GLfloat* params);
- void glMultMatrixf(const GLfloat* m);
- void glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
- void glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
- void glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
- void glPointParameterf(GLenum pname, GLfloat param);
- void glPointParameterfv(GLenum pname, const GLfloat* params);
- void glPointSize(GLfloat size);
- void glPolygonOffset(GLfloat factor, GLfloat units);
- void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
- void glScalef(GLfloat x, GLfloat y, GLfloat z);
- void glTexEnvf(GLenum target, GLenum pname, GLfloat param);
- void glTexEnvfv(GLenum target, GLenum pname, const GLfloat* params);
- void glTexParameterf(GLenum target, GLenum pname, GLfloat param);
- void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
- void glTranslatef(GLfloat x, GLfloat y, GLfloat z);
- void glActiveTexture(GLenum texture);
- void glAlphaFuncx(GLenum func, GLclampx ref);
- void glBindBuffer(GLenum target, GLuint buffer);
- void glBindTexture(GLenum target, GLuint texture);
- void glBlendFunc(GLenum sfactor, GLenum dfactor);
- void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
- void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
- void glClear(GLbitfield mask);
- void glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
- void glClearDepthx(GLclampx depth);
- void glClearStencil(GLint s);
- void glClientActiveTexture(GLenum texture);
- void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
- void glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
- void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
- void glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
- void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
- void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
- void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
- void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
- void glCullFace(GLenum mode);
- void glDeleteBuffers(GLsizei n, const GLuint* buffers);
- void glDeleteTextures(GLsizei n, const GLuint* textures);
- void glDepthFunc(GLenum func);
- void glDepthMask(GLboolean flag);
- void glDepthRangex(GLclampx zNear, GLclampx zFar);
- void glDisable(GLenum cap);
- void glDisableClientState(GLenum array);
- void glDrawArrays(GLenum mode, GLint first, GLsizei count);
- void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
- void glEnable(GLenum cap);
- void glEnableClientState(GLenum array);
- void glFinish();
- void glFlush();
- void glFogx(GLenum pname, GLfixed param);
- void glFogxv(GLenum pname, const GLfixed* params);
- void glFrontFace(GLenum mode);
- void glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
- void glGetBooleanv(GLenum pname, GLboolean* params);
- void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
- void glClipPlanex(GLenum pname, const GLfixed* eqn);
- void glGenBuffers(GLsizei n, GLuint* buffers);
- void glGenTextures(GLsizei n, GLuint* textures);
- GLenum glGetError();
- void glGetFixedv(GLenum pname, GLfixed* params);
- void glGetIntegerv(GLenum pname, GLint* params);
- void glGetLightxv(GLenum light, GLenum pname, GLfixed* params);
- void glGetMaterialxv(GLenum face, GLenum pname, GLfixed* params);
- void glGetPointerv(GLenum pname, GLvoid** params);
- const GLubyte* glGetString(GLenum name);
- void glGetTexEnviv(GLenum env, GLenum pname, GLint* params);
- void glGetTexEnvxv(GLenum env, GLenum pname, GLfixed* params);
- void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
- void glGetTexParameterxv(GLenum target, GLenum pname, GLfixed* params);
- void glHint(GLenum target, GLenum mode);
- GLboolean glIsBuffer(GLuint buffer);
- GLboolean glIsEnabled(GLenum cap);
- GLboolean glIsTexture(GLuint texture);
- void glLightModelx(GLenum pname, GLfixed param);
- void glLightModelxv(GLenum pname, const GLfixed* params);
- void glLightx(GLenum light, GLenum pname, GLfixed param);
- void glLightxv(GLenum light, GLenum pname, const GLfixed* params);
- void glLineWidthx(GLfixed width);
- void glLoadIdentity();
- void glLoadMatrixx(const GLfixed* m);
- void glLogicOp(GLenum opcode);
- void glMaterialx(GLenum face, GLenum pname, GLfixed param);
- void glMaterialxv(GLenum face, GLenum pname, const GLfixed* params);
- void glMatrixMode(GLenum mode);
- void glMultMatrixx(const GLfixed* m);
- void glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
- void glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz);
- void glNormalPointer(GLenum type, GLsizei stride, const GLvoid* pointer);
- void glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
- void glPixelStorei(GLenum pname, GLint param);
- void glPointParameterx(GLenum pname, GLfixed param);
- void glPointParameterxv(GLenum pname, const GLfixed* params);
- void glPointSizex(GLfixed size);
- void glPolygonOffsetx(GLfixed factor, GLfixed units);
- void glPopMatrix();
- void glPushMatrix();
- void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
- void glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
- void glSampleCoverage(GLclampf value, GLboolean invert);
- void glSampleCoveragex(GLclampx value, GLboolean invert);
- void glScalex(GLfixed x, GLfixed y, GLfixed z);
- void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
- void glShadeModel(GLenum mode);
- void glStencilFunc(GLenum func, GLint ref, GLuint mask);
- void glStencilMask(GLuint mask);
- void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
- void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
- void glTexEnvi(GLenum target, GLenum pname, GLint param);
- void glTexEnvx(GLenum target, GLenum pname, GLfixed param);
- void glTexEnviv(GLenum target, GLenum pname, const GLint* params);
- void glTexEnvxv(GLenum target, GLenum pname, const GLfixed* params);
- void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
- void glTexParameteri(GLenum target, GLenum pname, GLint param);
- void glTexParameterx(GLenum target, GLenum pname, GLfixed param);
- void glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
- void glTexParameterxv(GLenum target, GLenum pname, const GLfixed* params);
- void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
- void glTranslatex(GLfixed x, GLfixed y, GLfixed z);
- void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
- void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
- void glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid* pointer);
- void glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset);
- void glColorPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset);
- void glNormalPointerOffset(GLenum type, GLsizei stride, GLuint offset);
- void glPointSizePointerOffset(GLenum type, GLsizei stride, GLuint offset);
- void glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset);
- void glWeightPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset);
- void glMatrixIndexPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset);
- void glVertexPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
- void glColorPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
- void glNormalPointerData(GLenum type, GLsizei stride, void* data, GLuint datalen);
- void glTexCoordPointerData(GLint unit, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
- void glPointSizePointerData(GLenum type, GLsizei stride, void* data, GLuint datalen);
- void glWeightPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
- void glMatrixIndexPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
- void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset);
- void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen);
- void glGetCompressedTextureFormats(int count, GLint* formats);
- int glFinishRoundTrip();
- void glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha);
- void glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
- void glBlendEquationOES(GLenum mode);
- void glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
- void glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height);
- void glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
- void glDrawTexsvOES(const GLshort* coords);
- void glDrawTexivOES(const GLint* coords);
- void glDrawTexxvOES(const GLfixed* coords);
- void glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
- void glDrawTexfvOES(const GLfloat* coords);
- void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
- void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
- void glAlphaFuncxOES(GLenum func, GLclampx ref);
- void glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
- void glClearDepthxOES(GLclampx depth);
- void glClipPlanexOES(GLenum plane, const GLfixed* equation);
- void glClipPlanexIMG(GLenum plane, const GLfixed* equation);
- void glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
- void glDepthRangexOES(GLclampx zNear, GLclampx zFar);
- void glFogxOES(GLenum pname, GLfixed param);
- void glFogxvOES(GLenum pname, const GLfixed* params);
- void glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
- void glGetClipPlanexOES(GLenum pname, GLfixed* eqn);
- void glGetClipPlanex(GLenum pname, GLfixed* eqn);
- void glGetFixedvOES(GLenum pname, GLfixed* params);
- void glGetLightxvOES(GLenum light, GLenum pname, GLfixed* params);
- void glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed* params);
- void glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed* params);
- void glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed* params);
- void glLightModelxOES(GLenum pname, GLfixed param);
- void glLightModelxvOES(GLenum pname, const GLfixed* params);
- void glLightxOES(GLenum light, GLenum pname, GLfixed param);
- void glLightxvOES(GLenum light, GLenum pname, const GLfixed* params);
- void glLineWidthxOES(GLfixed width);
- void glLoadMatrixxOES(const GLfixed* m);
- void glMaterialxOES(GLenum face, GLenum pname, GLfixed param);
- void glMaterialxvOES(GLenum face, GLenum pname, const GLfixed* params);
- void glMultMatrixxOES(const GLfixed* m);
- void glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
- void glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz);
- void glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
- void glPointParameterxOES(GLenum pname, GLfixed param);
- void glPointParameterxvOES(GLenum pname, const GLfixed* params);
- void glPointSizexOES(GLfixed size);
- void glPolygonOffsetxOES(GLfixed factor, GLfixed units);
- void glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
- void glSampleCoveragexOES(GLclampx value, GLboolean invert);
- void glScalexOES(GLfixed x, GLfixed y, GLfixed z);
- void glTexEnvxOES(GLenum target, GLenum pname, GLfixed param);
- void glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed* params);
- void glTexParameterxOES(GLenum target, GLenum pname, GLfixed param);
- void glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed* params);
- void glTranslatexOES(GLfixed x, GLfixed y, GLfixed z);
- GLboolean glIsRenderbufferOES(GLuint renderbuffer);
- void glBindRenderbufferOES(GLenum target, GLuint renderbuffer);
- void glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers);
- void glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers);
- void glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
- void glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params);
- GLboolean glIsFramebufferOES(GLuint framebuffer);
- void glBindFramebufferOES(GLenum target, GLuint framebuffer);
- void glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers);
- void glGenFramebuffersOES(GLsizei n, GLuint* framebuffers);
- GLenum glCheckFramebufferStatusOES(GLenum target);
- void glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
- void glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
- void glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params);
- void glGenerateMipmapOES(GLenum target);
- void* glMapBufferOES(GLenum target, GLenum access);
- GLboolean glUnmapBufferOES(GLenum target);
- void glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params);
- void glCurrentPaletteMatrixOES(GLuint matrixpaletteindex);
- void glLoadPaletteFromModelViewMatrixOES();
- void glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
- void glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
- GLbitfield glQueryMatrixxOES(GLfixed* mantissa, GLint* exponent);
- void glDepthRangefOES(GLclampf zNear, GLclampf zFar);
- void glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
- void glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
- void glClipPlanefOES(GLenum plane, const GLfloat* equation);
- void glClipPlanefIMG(GLenum plane, const GLfloat* equation);
- void glGetClipPlanefOES(GLenum pname, GLfloat* eqn);
- void glClearDepthfOES(GLclampf depth);
- void glTexGenfOES(GLenum coord, GLenum pname, GLfloat param);
- void glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat* params);
- void glTexGeniOES(GLenum coord, GLenum pname, GLint param);
- void glTexGenivOES(GLenum coord, GLenum pname, const GLint* params);
- void glTexGenxOES(GLenum coord, GLenum pname, GLfixed param);
- void glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed* params);
- void glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat* params);
- void glGetTexGenivOES(GLenum coord, GLenum pname, GLint* params);
- void glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed* params);
- void glBindVertexArrayOES(GLuint array);
- void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays);
- void glGenVertexArraysOES(GLsizei n, GLuint* arrays);
- GLboolean glIsVertexArrayOES(GLuint array);
- void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments);
- void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount);
- void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount);
- void glMultiDrawArraysSUN(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
- void glMultiDrawElementsSUN(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
- void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
- void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
- void glDeleteFencesNV(GLsizei n, const GLuint* fences);
- void glGenFencesNV(GLsizei n, GLuint* fences);
- GLboolean glIsFenceNV(GLuint fence);
- GLboolean glTestFenceNV(GLuint fence);
- void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params);
- void glFinishFenceNV(GLuint fence);
- void glSetFenceNV(GLuint fence, GLenum condition);
- void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls);
- void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString);
- void glEnableDriverControlQCOM(GLuint driverControl);
- void glDisableDriverControlQCOM(GLuint driverControl);
- void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures);
- void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
- void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
- void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
- void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
- void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param);
- void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels);
- void glExtGetBufferPointervQCOM(GLenum target, GLvoid** params);
- void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders);
- void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms);
- GLboolean glExtIsProgramBinaryQCOM(GLuint program);
- void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length);
- void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
- void glEndTilingQCOM(GLbitfield preserveMask);
-};
-
-#endif
-#ifndef GET_CONTEXT
-static gl_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
-void gl_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
-#define GET_CONTEXT gl_client_context_t * ctx = getCurrentContext()
-#endif
-
-void glAlphaFunc(GLenum func, GLclampf ref)
-{
- GET_CONTEXT;
- ctx->glAlphaFunc(ctx, func, ref);
-}
-
-void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- GET_CONTEXT;
- ctx->glClearColor(ctx, red, green, blue, alpha);
-}
-
-void glClearDepthf(GLclampf depth)
-{
- GET_CONTEXT;
- ctx->glClearDepthf(ctx, depth);
-}
-
-void glClipPlanef(GLenum plane, const GLfloat* equation)
-{
- GET_CONTEXT;
- ctx->glClipPlanef(ctx, plane, equation);
-}
-
-void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
- GET_CONTEXT;
- ctx->glColor4f(ctx, red, green, blue, alpha);
-}
-
-void glDepthRangef(GLclampf zNear, GLclampf zFar)
-{
- GET_CONTEXT;
- ctx->glDepthRangef(ctx, zNear, zFar);
-}
-
-void glFogf(GLenum pname, GLfloat param)
-{
- GET_CONTEXT;
- ctx->glFogf(ctx, pname, param);
-}
-
-void glFogfv(GLenum pname, const GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glFogfv(ctx, pname, params);
-}
-
-void glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
- GET_CONTEXT;
- ctx->glFrustumf(ctx, left, right, bottom, top, zNear, zFar);
-}
-
-void glGetClipPlanef(GLenum pname, GLfloat* eqn)
-{
- GET_CONTEXT;
- ctx->glGetClipPlanef(ctx, pname, eqn);
-}
-
-void glGetFloatv(GLenum pname, GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glGetFloatv(ctx, pname, params);
-}
-
-void glGetLightfv(GLenum light, GLenum pname, GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glGetLightfv(ctx, light, pname, params);
-}
-
-void glGetMaterialfv(GLenum face, GLenum pname, GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glGetMaterialfv(ctx, face, pname, params);
-}
-
-void glGetTexEnvfv(GLenum env, GLenum pname, GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glGetTexEnvfv(ctx, env, pname, params);
-}
-
-void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glGetTexParameterfv(ctx, target, pname, params);
-}
-
-void glLightModelf(GLenum pname, GLfloat param)
-{
- GET_CONTEXT;
- ctx->glLightModelf(ctx, pname, param);
-}
-
-void glLightModelfv(GLenum pname, const GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glLightModelfv(ctx, pname, params);
-}
-
-void glLightf(GLenum light, GLenum pname, GLfloat param)
-{
- GET_CONTEXT;
- ctx->glLightf(ctx, light, pname, param);
-}
-
-void glLightfv(GLenum light, GLenum pname, const GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glLightfv(ctx, light, pname, params);
-}
-
-void glLineWidth(GLfloat width)
-{
- GET_CONTEXT;
- ctx->glLineWidth(ctx, width);
-}
-
-void glLoadMatrixf(const GLfloat* m)
-{
- GET_CONTEXT;
- ctx->glLoadMatrixf(ctx, m);
-}
-
-void glMaterialf(GLenum face, GLenum pname, GLfloat param)
-{
- GET_CONTEXT;
- ctx->glMaterialf(ctx, face, pname, param);
-}
-
-void glMaterialfv(GLenum face, GLenum pname, const GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glMaterialfv(ctx, face, pname, params);
-}
-
-void glMultMatrixf(const GLfloat* m)
-{
- GET_CONTEXT;
- ctx->glMultMatrixf(ctx, m);
-}
-
-void glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- GET_CONTEXT;
- ctx->glMultiTexCoord4f(ctx, target, s, t, r, q);
-}
-
-void glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
-{
- GET_CONTEXT;
- ctx->glNormal3f(ctx, nx, ny, nz);
-}
-
-void glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
- GET_CONTEXT;
- ctx->glOrthof(ctx, left, right, bottom, top, zNear, zFar);
-}
-
-void glPointParameterf(GLenum pname, GLfloat param)
-{
- GET_CONTEXT;
- ctx->glPointParameterf(ctx, pname, param);
-}
-
-void glPointParameterfv(GLenum pname, const GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glPointParameterfv(ctx, pname, params);
-}
-
-void glPointSize(GLfloat size)
-{
- GET_CONTEXT;
- ctx->glPointSize(ctx, size);
-}
-
-void glPolygonOffset(GLfloat factor, GLfloat units)
-{
- GET_CONTEXT;
- ctx->glPolygonOffset(ctx, factor, units);
-}
-
-void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CONTEXT;
- ctx->glRotatef(ctx, angle, x, y, z);
-}
-
-void glScalef(GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CONTEXT;
- ctx->glScalef(ctx, x, y, z);
-}
-
-void glTexEnvf(GLenum target, GLenum pname, GLfloat param)
-{
- GET_CONTEXT;
- ctx->glTexEnvf(ctx, target, pname, param);
-}
-
-void glTexEnvfv(GLenum target, GLenum pname, const GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glTexEnvfv(ctx, target, pname, params);
-}
-
-void glTexParameterf(GLenum target, GLenum pname, GLfloat param)
-{
- GET_CONTEXT;
- ctx->glTexParameterf(ctx, target, pname, param);
-}
-
-void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glTexParameterfv(ctx, target, pname, params);
-}
-
-void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CONTEXT;
- ctx->glTranslatef(ctx, x, y, z);
-}
-
-void glActiveTexture(GLenum texture)
-{
- GET_CONTEXT;
- ctx->glActiveTexture(ctx, texture);
-}
-
-void glAlphaFuncx(GLenum func, GLclampx ref)
-{
- GET_CONTEXT;
- ctx->glAlphaFuncx(ctx, func, ref);
-}
-
-void glBindBuffer(GLenum target, GLuint buffer)
-{
- GET_CONTEXT;
- ctx->glBindBuffer(ctx, target, buffer);
-}
-
-void glBindTexture(GLenum target, GLuint texture)
-{
- GET_CONTEXT;
- ctx->glBindTexture(ctx, target, texture);
-}
-
-void glBlendFunc(GLenum sfactor, GLenum dfactor)
-{
- GET_CONTEXT;
- ctx->glBlendFunc(ctx, sfactor, dfactor);
-}
-
-void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
-{
- GET_CONTEXT;
- ctx->glBufferData(ctx, target, size, data, usage);
-}
-
-void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
-{
- GET_CONTEXT;
- ctx->glBufferSubData(ctx, target, offset, size, data);
-}
-
-void glClear(GLbitfield mask)
-{
- GET_CONTEXT;
- ctx->glClear(ctx, mask);
-}
-
-void glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
-{
- GET_CONTEXT;
- ctx->glClearColorx(ctx, red, green, blue, alpha);
-}
-
-void glClearDepthx(GLclampx depth)
-{
- GET_CONTEXT;
- ctx->glClearDepthx(ctx, depth);
-}
-
-void glClearStencil(GLint s)
-{
- GET_CONTEXT;
- ctx->glClearStencil(ctx, s);
-}
-
-void glClientActiveTexture(GLenum texture)
-{
- GET_CONTEXT;
- ctx->glClientActiveTexture(ctx, texture);
-}
-
-void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
-{
- GET_CONTEXT;
- ctx->glColor4ub(ctx, red, green, blue, alpha);
-}
-
-void glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
-{
- GET_CONTEXT;
- ctx->glColor4x(ctx, red, green, blue, alpha);
-}
-
-void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-{
- GET_CONTEXT;
- ctx->glColorMask(ctx, red, green, blue, alpha);
-}
-
-void glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
-{
- GET_CONTEXT;
- ctx->glColorPointer(ctx, size, type, stride, pointer);
-}
-
-void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
-{
- GET_CONTEXT;
- ctx->glCompressedTexImage2D(ctx, target, level, internalformat, width, height, border, imageSize, data);
-}
-
-void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
-{
- GET_CONTEXT;
- ctx->glCompressedTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, data);
-}
-
-void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
- GET_CONTEXT;
- ctx->glCopyTexImage2D(ctx, target, level, internalformat, x, y, width, height, border);
-}
-
-void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glCopyTexSubImage2D(ctx, target, level, xoffset, yoffset, x, y, width, height);
-}
-
-void glCullFace(GLenum mode)
-{
- GET_CONTEXT;
- ctx->glCullFace(ctx, mode);
-}
-
-void glDeleteBuffers(GLsizei n, const GLuint* buffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteBuffers(ctx, n, buffers);
-}
-
-void glDeleteTextures(GLsizei n, const GLuint* textures)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteTextures(ctx, n, textures);
-}
-
-void glDepthFunc(GLenum func)
-{
- GET_CONTEXT;
- ctx->glDepthFunc(ctx, func);
-}
-
-void glDepthMask(GLboolean flag)
-{
- GET_CONTEXT;
- ctx->glDepthMask(ctx, flag);
-}
-
-void glDepthRangex(GLclampx zNear, GLclampx zFar)
-{
- GET_CONTEXT;
- ctx->glDepthRangex(ctx, zNear, zFar);
-}
-
-void glDisable(GLenum cap)
-{
- GET_CONTEXT;
- ctx->glDisable(ctx, cap);
-}
-
-void glDisableClientState(GLenum array)
-{
- GET_CONTEXT;
- ctx->glDisableClientState(ctx, array);
-}
-
-void glDrawArrays(GLenum mode, GLint first, GLsizei count)
-{
- GET_CONTEXT;
- ctx->glDrawArrays(ctx, mode, first, count);
-}
-
-void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
-{
- GET_CONTEXT;
- ctx->glDrawElements(ctx, mode, count, type, indices);
-}
-
-void glEnable(GLenum cap)
-{
- GET_CONTEXT;
- ctx->glEnable(ctx, cap);
-}
-
-void glEnableClientState(GLenum array)
-{
- GET_CONTEXT;
- ctx->glEnableClientState(ctx, array);
-}
-
-void glFinish()
-{
- GET_CONTEXT;
- ctx->glFinish(ctx);
-}
-
-void glFlush()
-{
- GET_CONTEXT;
- ctx->glFlush(ctx);
-}
-
-void glFogx(GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glFogx(ctx, pname, param);
-}
-
-void glFogxv(GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glFogxv(ctx, pname, params);
-}
-
-void glFrontFace(GLenum mode)
-{
- GET_CONTEXT;
- ctx->glFrontFace(ctx, mode);
-}
-
-void glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
- GET_CONTEXT;
- ctx->glFrustumx(ctx, left, right, bottom, top, zNear, zFar);
-}
-
-void glGetBooleanv(GLenum pname, GLboolean* params)
-{
- GET_CONTEXT;
- ctx->glGetBooleanv(ctx, pname, params);
-}
-
-void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetBufferParameteriv(ctx, target, pname, params);
-}
-
-void glClipPlanex(GLenum pname, const GLfixed* eqn)
-{
- GET_CONTEXT;
- ctx->glClipPlanex(ctx, pname, eqn);
-}
-
-void glGenBuffers(GLsizei n, GLuint* buffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenBuffers(ctx, n, buffers);
-}
-
-void glGenTextures(GLsizei n, GLuint* textures)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenTextures(ctx, n, textures);
-}
-
-GLenum glGetError()
-{
- GET_CONTEXT;
- return ctx->glGetError(ctx);
-}
-
-void glGetFixedv(GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetFixedv(ctx, pname, params);
-}
-
-void glGetIntegerv(GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetIntegerv(ctx, pname, params);
-}
-
-void glGetLightxv(GLenum light, GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetLightxv(ctx, light, pname, params);
-}
-
-void glGetMaterialxv(GLenum face, GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetMaterialxv(ctx, face, pname, params);
-}
-
-void glGetPointerv(GLenum pname, GLvoid** params)
-{
- GET_CONTEXT;
- ctx->glGetPointerv(ctx, pname, params);
-}
-
-const GLubyte* glGetString(GLenum name)
-{
- GET_CONTEXT;
- return ctx->glGetString(ctx, name);
-}
-
-void glGetTexEnviv(GLenum env, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetTexEnviv(ctx, env, pname, params);
-}
-
-void glGetTexEnvxv(GLenum env, GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetTexEnvxv(ctx, env, pname, params);
-}
-
-void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetTexParameteriv(ctx, target, pname, params);
-}
-
-void glGetTexParameterxv(GLenum target, GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetTexParameterxv(ctx, target, pname, params);
-}
-
-void glHint(GLenum target, GLenum mode)
-{
- GET_CONTEXT;
- ctx->glHint(ctx, target, mode);
-}
-
-GLboolean glIsBuffer(GLuint buffer)
-{
- GET_CONTEXT;
- return ctx->glIsBuffer(ctx, buffer);
-}
-
-GLboolean glIsEnabled(GLenum cap)
-{
- GET_CONTEXT;
- return ctx->glIsEnabled(ctx, cap);
-}
-
-GLboolean glIsTexture(GLuint texture)
-{
- GET_CONTEXT;
- return ctx->glIsTexture(ctx, texture);
-}
-
-void glLightModelx(GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glLightModelx(ctx, pname, param);
-}
-
-void glLightModelxv(GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glLightModelxv(ctx, pname, params);
-}
-
-void glLightx(GLenum light, GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glLightx(ctx, light, pname, param);
-}
-
-void glLightxv(GLenum light, GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glLightxv(ctx, light, pname, params);
-}
-
-void glLineWidthx(GLfixed width)
-{
- GET_CONTEXT;
- ctx->glLineWidthx(ctx, width);
-}
-
-void glLoadIdentity()
-{
- GET_CONTEXT;
- ctx->glLoadIdentity(ctx);
-}
-
-void glLoadMatrixx(const GLfixed* m)
-{
- GET_CONTEXT;
- ctx->glLoadMatrixx(ctx, m);
-}
-
-void glLogicOp(GLenum opcode)
-{
- GET_CONTEXT;
- ctx->glLogicOp(ctx, opcode);
-}
-
-void glMaterialx(GLenum face, GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glMaterialx(ctx, face, pname, param);
-}
-
-void glMaterialxv(GLenum face, GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glMaterialxv(ctx, face, pname, params);
-}
-
-void glMatrixMode(GLenum mode)
-{
- GET_CONTEXT;
- ctx->glMatrixMode(ctx, mode);
-}
-
-void glMultMatrixx(const GLfixed* m)
-{
- GET_CONTEXT;
- ctx->glMultMatrixx(ctx, m);
-}
-
-void glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-{
- GET_CONTEXT;
- ctx->glMultiTexCoord4x(ctx, target, s, t, r, q);
-}
-
-void glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz)
-{
- GET_CONTEXT;
- ctx->glNormal3x(ctx, nx, ny, nz);
-}
-
-void glNormalPointer(GLenum type, GLsizei stride, const GLvoid* pointer)
-{
- GET_CONTEXT;
- ctx->glNormalPointer(ctx, type, stride, pointer);
-}
-
-void glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
- GET_CONTEXT;
- ctx->glOrthox(ctx, left, right, bottom, top, zNear, zFar);
-}
-
-void glPixelStorei(GLenum pname, GLint param)
-{
- GET_CONTEXT;
- ctx->glPixelStorei(ctx, pname, param);
-}
-
-void glPointParameterx(GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glPointParameterx(ctx, pname, param);
-}
-
-void glPointParameterxv(GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glPointParameterxv(ctx, pname, params);
-}
-
-void glPointSizex(GLfixed size)
-{
- GET_CONTEXT;
- ctx->glPointSizex(ctx, size);
-}
-
-void glPolygonOffsetx(GLfixed factor, GLfixed units)
-{
- GET_CONTEXT;
- ctx->glPolygonOffsetx(ctx, factor, units);
-}
-
-void glPopMatrix()
-{
- GET_CONTEXT;
- ctx->glPopMatrix(ctx);
-}
-
-void glPushMatrix()
-{
- GET_CONTEXT;
- ctx->glPushMatrix(ctx);
-}
-
-void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
-{
- GET_CONTEXT;
- ctx->glReadPixels(ctx, x, y, width, height, format, type, pixels);
-}
-
-void glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
-{
- GET_CONTEXT;
- ctx->glRotatex(ctx, angle, x, y, z);
-}
-
-void glSampleCoverage(GLclampf value, GLboolean invert)
-{
- GET_CONTEXT;
- ctx->glSampleCoverage(ctx, value, invert);
-}
-
-void glSampleCoveragex(GLclampx value, GLboolean invert)
-{
- GET_CONTEXT;
- ctx->glSampleCoveragex(ctx, value, invert);
-}
-
-void glScalex(GLfixed x, GLfixed y, GLfixed z)
-{
- GET_CONTEXT;
- ctx->glScalex(ctx, x, y, z);
-}
-
-void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glScissor(ctx, x, y, width, height);
-}
-
-void glShadeModel(GLenum mode)
-{
- GET_CONTEXT;
- ctx->glShadeModel(ctx, mode);
-}
-
-void glStencilFunc(GLenum func, GLint ref, GLuint mask)
-{
- GET_CONTEXT;
- ctx->glStencilFunc(ctx, func, ref, mask);
-}
-
-void glStencilMask(GLuint mask)
-{
- GET_CONTEXT;
- ctx->glStencilMask(ctx, mask);
-}
-
-void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
-{
- GET_CONTEXT;
- ctx->glStencilOp(ctx, fail, zfail, zpass);
-}
-
-void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
-{
- GET_CONTEXT;
- ctx->glTexCoordPointer(ctx, size, type, stride, pointer);
-}
-
-void glTexEnvi(GLenum target, GLenum pname, GLint param)
-{
- GET_CONTEXT;
- ctx->glTexEnvi(ctx, target, pname, param);
-}
-
-void glTexEnvx(GLenum target, GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glTexEnvx(ctx, target, pname, param);
-}
-
-void glTexEnviv(GLenum target, GLenum pname, const GLint* params)
-{
- GET_CONTEXT;
- ctx->glTexEnviv(ctx, target, pname, params);
-}
-
-void glTexEnvxv(GLenum target, GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glTexEnvxv(ctx, target, pname, params);
-}
-
-void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
-{
- GET_CONTEXT;
- ctx->glTexImage2D(ctx, target, level, internalformat, width, height, border, format, type, pixels);
-}
-
-void glTexParameteri(GLenum target, GLenum pname, GLint param)
-{
- GET_CONTEXT;
- ctx->glTexParameteri(ctx, target, pname, param);
-}
-
-void glTexParameterx(GLenum target, GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glTexParameterx(ctx, target, pname, param);
-}
-
-void glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
-{
- GET_CONTEXT;
- ctx->glTexParameteriv(ctx, target, pname, params);
-}
-
-void glTexParameterxv(GLenum target, GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glTexParameterxv(ctx, target, pname, params);
-}
-
-void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
-{
- GET_CONTEXT;
- ctx->glTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels);
-}
-
-void glTranslatex(GLfixed x, GLfixed y, GLfixed z)
-{
- GET_CONTEXT;
- ctx->glTranslatex(ctx, x, y, z);
-}
-
-void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
-{
- GET_CONTEXT;
- ctx->glVertexPointer(ctx, size, type, stride, pointer);
-}
-
-void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glViewport(ctx, x, y, width, height);
-}
-
-void glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid* pointer)
-{
- GET_CONTEXT;
- ctx->glPointSizePointerOES(ctx, type, stride, pointer);
-}
-
-void glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset)
-{
- GET_CONTEXT;
- ctx->glVertexPointerOffset(ctx, size, type, stride, offset);
-}
-
-void glColorPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset)
-{
- GET_CONTEXT;
- ctx->glColorPointerOffset(ctx, size, type, stride, offset);
-}
-
-void glNormalPointerOffset(GLenum type, GLsizei stride, GLuint offset)
-{
- GET_CONTEXT;
- ctx->glNormalPointerOffset(ctx, type, stride, offset);
-}
-
-void glPointSizePointerOffset(GLenum type, GLsizei stride, GLuint offset)
-{
- GET_CONTEXT;
- ctx->glPointSizePointerOffset(ctx, type, stride, offset);
-}
-
-void glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset)
-{
- GET_CONTEXT;
- ctx->glTexCoordPointerOffset(ctx, size, type, stride, offset);
-}
-
-void glWeightPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset)
-{
- GET_CONTEXT;
- ctx->glWeightPointerOffset(ctx, size, type, stride, offset);
-}
-
-void glMatrixIndexPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset)
-{
- GET_CONTEXT;
- ctx->glMatrixIndexPointerOffset(ctx, size, type, stride, offset);
-}
-
-void glVertexPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
- GET_CONTEXT;
- ctx->glVertexPointerData(ctx, size, type, stride, data, datalen);
-}
-
-void glColorPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
- GET_CONTEXT;
- ctx->glColorPointerData(ctx, size, type, stride, data, datalen);
-}
-
-void glNormalPointerData(GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
- GET_CONTEXT;
- ctx->glNormalPointerData(ctx, type, stride, data, datalen);
-}
-
-void glTexCoordPointerData(GLint unit, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
- GET_CONTEXT;
- ctx->glTexCoordPointerData(ctx, unit, size, type, stride, data, datalen);
-}
-
-void glPointSizePointerData(GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
- GET_CONTEXT;
- ctx->glPointSizePointerData(ctx, type, stride, data, datalen);
-}
-
-void glWeightPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
- GET_CONTEXT;
- ctx->glWeightPointerData(ctx, size, type, stride, data, datalen);
-}
-
-void glMatrixIndexPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
-{
- GET_CONTEXT;
- ctx->glMatrixIndexPointerData(ctx, size, type, stride, data, datalen);
-}
-
-void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset)
-{
- GET_CONTEXT;
- ctx->glDrawElementsOffset(ctx, mode, count, type, offset);
-}
-
-void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
-{
- GET_CONTEXT;
- ctx->glDrawElementsData(ctx, mode, count, type, data, datalen);
-}
-
-void glGetCompressedTextureFormats(int count, GLint* formats)
-{
- GET_CONTEXT;
- ctx->glGetCompressedTextureFormats(ctx, count, formats);
-}
-
-int glFinishRoundTrip()
-{
- GET_CONTEXT;
- return ctx->glFinishRoundTrip(ctx);
-}
-
-void glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha)
-{
- GET_CONTEXT;
- ctx->glBlendEquationSeparateOES(ctx, modeRGB, modeAlpha);
-}
-
-void glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-{
- GET_CONTEXT;
- ctx->glBlendFuncSeparateOES(ctx, srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-
-void glBlendEquationOES(GLenum mode)
-{
- GET_CONTEXT;
- ctx->glBlendEquationOES(ctx, mode);
-}
-
-void glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
-{
- GET_CONTEXT;
- ctx->glDrawTexsOES(ctx, x, y, z, width, height);
-}
-
-void glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
-{
- GET_CONTEXT;
- ctx->glDrawTexiOES(ctx, x, y, z, width, height);
-}
-
-void glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
-{
- GET_CONTEXT;
- ctx->glDrawTexxOES(ctx, x, y, z, width, height);
-}
-
-void glDrawTexsvOES(const GLshort* coords)
-{
- GET_CONTEXT;
- ctx->glDrawTexsvOES(ctx, coords);
-}
-
-void glDrawTexivOES(const GLint* coords)
-{
- GET_CONTEXT;
- ctx->glDrawTexivOES(ctx, coords);
-}
-
-void glDrawTexxvOES(const GLfixed* coords)
-{
- GET_CONTEXT;
- ctx->glDrawTexxvOES(ctx, coords);
-}
-
-void glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
-{
- GET_CONTEXT;
- ctx->glDrawTexfOES(ctx, x, y, z, width, height);
-}
-
-void glDrawTexfvOES(const GLfloat* coords)
-{
- GET_CONTEXT;
- ctx->glDrawTexfvOES(ctx, coords);
-}
-
-void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
-{
- GET_CONTEXT;
- ctx->glEGLImageTargetTexture2DOES(ctx, target, image);
-}
-
-void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
-{
- GET_CONTEXT;
- ctx->glEGLImageTargetRenderbufferStorageOES(ctx, target, image);
-}
-
-void glAlphaFuncxOES(GLenum func, GLclampx ref)
-{
- GET_CONTEXT;
- ctx->glAlphaFuncxOES(ctx, func, ref);
-}
-
-void glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
-{
- GET_CONTEXT;
- ctx->glClearColorxOES(ctx, red, green, blue, alpha);
-}
-
-void glClearDepthxOES(GLclampx depth)
-{
- GET_CONTEXT;
- ctx->glClearDepthxOES(ctx, depth);
-}
-
-void glClipPlanexOES(GLenum plane, const GLfixed* equation)
-{
- GET_CONTEXT;
- ctx->glClipPlanexOES(ctx, plane, equation);
-}
-
-void glClipPlanexIMG(GLenum plane, const GLfixed* equation)
-{
- GET_CONTEXT;
- ctx->glClipPlanexIMG(ctx, plane, equation);
-}
-
-void glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
-{
- GET_CONTEXT;
- ctx->glColor4xOES(ctx, red, green, blue, alpha);
-}
-
-void glDepthRangexOES(GLclampx zNear, GLclampx zFar)
-{
- GET_CONTEXT;
- ctx->glDepthRangexOES(ctx, zNear, zFar);
-}
-
-void glFogxOES(GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glFogxOES(ctx, pname, param);
-}
-
-void glFogxvOES(GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glFogxvOES(ctx, pname, params);
-}
-
-void glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
- GET_CONTEXT;
- ctx->glFrustumxOES(ctx, left, right, bottom, top, zNear, zFar);
-}
-
-void glGetClipPlanexOES(GLenum pname, GLfixed* eqn)
-{
- GET_CONTEXT;
- ctx->glGetClipPlanexOES(ctx, pname, eqn);
-}
-
-void glGetClipPlanex(GLenum pname, GLfixed* eqn)
-{
- GET_CONTEXT;
- ctx->glGetClipPlanex(ctx, pname, eqn);
-}
-
-void glGetFixedvOES(GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetFixedvOES(ctx, pname, params);
-}
-
-void glGetLightxvOES(GLenum light, GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetLightxvOES(ctx, light, pname, params);
-}
-
-void glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetMaterialxvOES(ctx, face, pname, params);
-}
-
-void glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetTexEnvxvOES(ctx, env, pname, params);
-}
-
-void glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetTexParameterxvOES(ctx, target, pname, params);
-}
-
-void glLightModelxOES(GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glLightModelxOES(ctx, pname, param);
-}
-
-void glLightModelxvOES(GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glLightModelxvOES(ctx, pname, params);
-}
-
-void glLightxOES(GLenum light, GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glLightxOES(ctx, light, pname, param);
-}
-
-void glLightxvOES(GLenum light, GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glLightxvOES(ctx, light, pname, params);
-}
-
-void glLineWidthxOES(GLfixed width)
-{
- GET_CONTEXT;
- ctx->glLineWidthxOES(ctx, width);
-}
-
-void glLoadMatrixxOES(const GLfixed* m)
-{
- GET_CONTEXT;
- ctx->glLoadMatrixxOES(ctx, m);
-}
-
-void glMaterialxOES(GLenum face, GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glMaterialxOES(ctx, face, pname, param);
-}
-
-void glMaterialxvOES(GLenum face, GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glMaterialxvOES(ctx, face, pname, params);
-}
-
-void glMultMatrixxOES(const GLfixed* m)
-{
- GET_CONTEXT;
- ctx->glMultMatrixxOES(ctx, m);
-}
-
-void glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-{
- GET_CONTEXT;
- ctx->glMultiTexCoord4xOES(ctx, target, s, t, r, q);
-}
-
-void glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz)
-{
- GET_CONTEXT;
- ctx->glNormal3xOES(ctx, nx, ny, nz);
-}
-
-void glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
- GET_CONTEXT;
- ctx->glOrthoxOES(ctx, left, right, bottom, top, zNear, zFar);
-}
-
-void glPointParameterxOES(GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glPointParameterxOES(ctx, pname, param);
-}
-
-void glPointParameterxvOES(GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glPointParameterxvOES(ctx, pname, params);
-}
-
-void glPointSizexOES(GLfixed size)
-{
- GET_CONTEXT;
- ctx->glPointSizexOES(ctx, size);
-}
-
-void glPolygonOffsetxOES(GLfixed factor, GLfixed units)
-{
- GET_CONTEXT;
- ctx->glPolygonOffsetxOES(ctx, factor, units);
-}
-
-void glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
-{
- GET_CONTEXT;
- ctx->glRotatexOES(ctx, angle, x, y, z);
-}
-
-void glSampleCoveragexOES(GLclampx value, GLboolean invert)
-{
- GET_CONTEXT;
- ctx->glSampleCoveragexOES(ctx, value, invert);
-}
-
-void glScalexOES(GLfixed x, GLfixed y, GLfixed z)
-{
- GET_CONTEXT;
- ctx->glScalexOES(ctx, x, y, z);
-}
-
-void glTexEnvxOES(GLenum target, GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glTexEnvxOES(ctx, target, pname, param);
-}
-
-void glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glTexEnvxvOES(ctx, target, pname, params);
-}
-
-void glTexParameterxOES(GLenum target, GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glTexParameterxOES(ctx, target, pname, param);
-}
-
-void glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glTexParameterxvOES(ctx, target, pname, params);
-}
-
-void glTranslatexOES(GLfixed x, GLfixed y, GLfixed z)
-{
- GET_CONTEXT;
- ctx->glTranslatexOES(ctx, x, y, z);
-}
-
-GLboolean glIsRenderbufferOES(GLuint renderbuffer)
-{
- GET_CONTEXT;
- return ctx->glIsRenderbufferOES(ctx, renderbuffer);
-}
-
-void glBindRenderbufferOES(GLenum target, GLuint renderbuffer)
-{
- GET_CONTEXT;
- ctx->glBindRenderbufferOES(ctx, target, renderbuffer);
-}
-
-void glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteRenderbuffersOES(ctx, n, renderbuffers);
-}
-
-void glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenRenderbuffersOES(ctx, n, renderbuffers);
-}
-
-void glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glRenderbufferStorageOES(ctx, target, internalformat, width, height);
-}
-
-void glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetRenderbufferParameterivOES(ctx, target, pname, params);
-}
-
-GLboolean glIsFramebufferOES(GLuint framebuffer)
-{
- GET_CONTEXT;
- return ctx->glIsFramebufferOES(ctx, framebuffer);
-}
-
-void glBindFramebufferOES(GLenum target, GLuint framebuffer)
-{
- GET_CONTEXT;
- ctx->glBindFramebufferOES(ctx, target, framebuffer);
-}
-
-void glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteFramebuffersOES(ctx, n, framebuffers);
-}
-
-void glGenFramebuffersOES(GLsizei n, GLuint* framebuffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenFramebuffersOES(ctx, n, framebuffers);
-}
-
-GLenum glCheckFramebufferStatusOES(GLenum target)
-{
- GET_CONTEXT;
- return ctx->glCheckFramebufferStatusOES(ctx, target);
-}
-
-void glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
- GET_CONTEXT;
- ctx->glFramebufferRenderbufferOES(ctx, target, attachment, renderbuffertarget, renderbuffer);
-}
-
-void glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- GET_CONTEXT;
- ctx->glFramebufferTexture2DOES(ctx, target, attachment, textarget, texture, level);
-}
-
-void glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetFramebufferAttachmentParameterivOES(ctx, target, attachment, pname, params);
-}
-
-void glGenerateMipmapOES(GLenum target)
-{
- GET_CONTEXT;
- ctx->glGenerateMipmapOES(ctx, target);
-}
-
-void* glMapBufferOES(GLenum target, GLenum access)
-{
- GET_CONTEXT;
- return ctx->glMapBufferOES(ctx, target, access);
-}
-
-GLboolean glUnmapBufferOES(GLenum target)
-{
- GET_CONTEXT;
- return ctx->glUnmapBufferOES(ctx, target);
-}
-
-void glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params)
-{
- GET_CONTEXT;
- ctx->glGetBufferPointervOES(ctx, target, pname, params);
-}
-
-void glCurrentPaletteMatrixOES(GLuint matrixpaletteindex)
-{
- GET_CONTEXT;
- ctx->glCurrentPaletteMatrixOES(ctx, matrixpaletteindex);
-}
-
-void glLoadPaletteFromModelViewMatrixOES()
-{
- GET_CONTEXT;
- ctx->glLoadPaletteFromModelViewMatrixOES(ctx);
-}
-
-void glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
-{
- GET_CONTEXT;
- ctx->glMatrixIndexPointerOES(ctx, size, type, stride, pointer);
-}
-
-void glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
-{
- GET_CONTEXT;
- ctx->glWeightPointerOES(ctx, size, type, stride, pointer);
-}
-
-GLbitfield glQueryMatrixxOES(GLfixed* mantissa, GLint* exponent)
-{
- GET_CONTEXT;
- return ctx->glQueryMatrixxOES(ctx, mantissa, exponent);
-}
-
-void glDepthRangefOES(GLclampf zNear, GLclampf zFar)
-{
- GET_CONTEXT;
- ctx->glDepthRangefOES(ctx, zNear, zFar);
-}
-
-void glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
- GET_CONTEXT;
- ctx->glFrustumfOES(ctx, left, right, bottom, top, zNear, zFar);
-}
-
-void glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
- GET_CONTEXT;
- ctx->glOrthofOES(ctx, left, right, bottom, top, zNear, zFar);
-}
-
-void glClipPlanefOES(GLenum plane, const GLfloat* equation)
-{
- GET_CONTEXT;
- ctx->glClipPlanefOES(ctx, plane, equation);
-}
-
-void glClipPlanefIMG(GLenum plane, const GLfloat* equation)
-{
- GET_CONTEXT;
- ctx->glClipPlanefIMG(ctx, plane, equation);
-}
-
-void glGetClipPlanefOES(GLenum pname, GLfloat* eqn)
-{
- GET_CONTEXT;
- ctx->glGetClipPlanefOES(ctx, pname, eqn);
-}
-
-void glClearDepthfOES(GLclampf depth)
-{
- GET_CONTEXT;
- ctx->glClearDepthfOES(ctx, depth);
-}
-
-void glTexGenfOES(GLenum coord, GLenum pname, GLfloat param)
-{
- GET_CONTEXT;
- ctx->glTexGenfOES(ctx, coord, pname, param);
-}
-
-void glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glTexGenfvOES(ctx, coord, pname, params);
-}
-
-void glTexGeniOES(GLenum coord, GLenum pname, GLint param)
-{
- GET_CONTEXT;
- ctx->glTexGeniOES(ctx, coord, pname, param);
-}
-
-void glTexGenivOES(GLenum coord, GLenum pname, const GLint* params)
-{
- GET_CONTEXT;
- ctx->glTexGenivOES(ctx, coord, pname, params);
-}
-
-void glTexGenxOES(GLenum coord, GLenum pname, GLfixed param)
-{
- GET_CONTEXT;
- ctx->glTexGenxOES(ctx, coord, pname, param);
-}
-
-void glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glTexGenxvOES(ctx, coord, pname, params);
-}
-
-void glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glGetTexGenfvOES(ctx, coord, pname, params);
-}
-
-void glGetTexGenivOES(GLenum coord, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetTexGenivOES(ctx, coord, pname, params);
-}
-
-void glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed* params)
-{
- GET_CONTEXT;
- ctx->glGetTexGenxvOES(ctx, coord, pname, params);
-}
-
-void glBindVertexArrayOES(GLuint array)
-{
- GET_CONTEXT;
- ctx->glBindVertexArrayOES(ctx, array);
-}
-
-void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteVertexArraysOES(ctx, n, arrays);
-}
-
-void glGenVertexArraysOES(GLsizei n, GLuint* arrays)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenVertexArraysOES(ctx, n, arrays);
-}
-
-GLboolean glIsVertexArrayOES(GLuint array)
-{
- GET_CONTEXT;
- return ctx->glIsVertexArrayOES(ctx, array);
-}
-
-void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments)
-{
- GET_CONTEXT;
- ctx->glDiscardFramebufferEXT(ctx, target, numAttachments, attachments);
-}
-
-void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount)
-{
- GET_CONTEXT;
- ctx->glMultiDrawArraysEXT(ctx, mode, first, count, primcount);
-}
-
-void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount)
-{
- GET_CONTEXT;
- ctx->glMultiDrawElementsEXT(ctx, mode, count, type, indices, primcount);
-}
-
-void glMultiDrawArraysSUN(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount)
-{
- GET_CONTEXT;
- ctx->glMultiDrawArraysSUN(ctx, mode, first, count, primcount);
-}
-
-void glMultiDrawElementsSUN(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount)
-{
- GET_CONTEXT;
- ctx->glMultiDrawElementsSUN(ctx, mode, count, type, indices, primcount);
-}
-
-void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glRenderbufferStorageMultisampleIMG(ctx, target, samples, internalformat, width, height);
-}
-
-void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
-{
- GET_CONTEXT;
- ctx->glFramebufferTexture2DMultisampleIMG(ctx, target, attachment, textarget, texture, level, samples);
-}
-
-void glDeleteFencesNV(GLsizei n, const GLuint* fences)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteFencesNV(ctx, n, fences);
-}
-
-void glGenFencesNV(GLsizei n, GLuint* fences)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenFencesNV(ctx, n, fences);
-}
-
-GLboolean glIsFenceNV(GLuint fence)
-{
- GET_CONTEXT;
- return ctx->glIsFenceNV(ctx, fence);
-}
-
-GLboolean glTestFenceNV(GLuint fence)
-{
- GET_CONTEXT;
- return ctx->glTestFenceNV(ctx, fence);
-}
-
-void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetFenceivNV(ctx, fence, pname, params);
-}
-
-void glFinishFenceNV(GLuint fence)
-{
- GET_CONTEXT;
- ctx->glFinishFenceNV(ctx, fence);
-}
-
-void glSetFenceNV(GLuint fence, GLenum condition)
-{
- GET_CONTEXT;
- ctx->glSetFenceNV(ctx, fence, condition);
-}
-
-void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls)
-{
- GET_CONTEXT;
- ctx->glGetDriverControlsQCOM(ctx, num, size, driverControls);
-}
-
-void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString)
-{
- GET_CONTEXT;
- ctx->glGetDriverControlStringQCOM(ctx, driverControl, bufSize, length, driverControlString);
-}
-
-void glEnableDriverControlQCOM(GLuint driverControl)
-{
- GET_CONTEXT;
- ctx->glEnableDriverControlQCOM(ctx, driverControl);
-}
-
-void glDisableDriverControlQCOM(GLuint driverControl)
-{
- GET_CONTEXT;
- ctx->glDisableDriverControlQCOM(ctx, driverControl);
-}
-
-void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures)
-{
- GET_CONTEXT;
- ctx->glExtGetTexturesQCOM(ctx, textures, maxTextures, numTextures);
-}
-
-void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
-{
- GET_CONTEXT;
- ctx->glExtGetBuffersQCOM(ctx, buffers, maxBuffers, numBuffers);
-}
-
-void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
-{
- GET_CONTEXT;
- ctx->glExtGetRenderbuffersQCOM(ctx, renderbuffers, maxRenderbuffers, numRenderbuffers);
-}
-
-void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
-{
- GET_CONTEXT;
- ctx->glExtGetFramebuffersQCOM(ctx, framebuffers, maxFramebuffers, numFramebuffers);
-}
-
-void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glExtGetTexLevelParameterivQCOM(ctx, texture, face, level, pname, params);
-}
-
-void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param)
-{
- GET_CONTEXT;
- ctx->glExtTexObjectStateOverrideiQCOM(ctx, target, pname, param);
-}
-
-void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels)
-{
- GET_CONTEXT;
- ctx->glExtGetTexSubImageQCOM(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
-}
-
-void glExtGetBufferPointervQCOM(GLenum target, GLvoid** params)
-{
- GET_CONTEXT;
- ctx->glExtGetBufferPointervQCOM(ctx, target, params);
-}
-
-void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders)
-{
- GET_CONTEXT;
- ctx->glExtGetShadersQCOM(ctx, shaders, maxShaders, numShaders);
-}
-
-void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms)
-{
- GET_CONTEXT;
- ctx->glExtGetProgramsQCOM(ctx, programs, maxPrograms, numPrograms);
-}
-
-GLboolean glExtIsProgramBinaryQCOM(GLuint program)
-{
- GET_CONTEXT;
- return ctx->glExtIsProgramBinaryQCOM(ctx, program);
-}
-
-void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length)
-{
- GET_CONTEXT;
- ctx->glExtGetProgramBinarySourceQCOM(ctx, program, shadertype, source, length);
-}
-
-void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
-{
- GET_CONTEXT;
- ctx->glStartTilingQCOM(ctx, x, y, width, height, preserveMask);
-}
-
-void glEndTilingQCOM(GLbitfield preserveMask)
-{
- GET_CONTEXT;
- ctx->glEndTilingQCOM(ctx, preserveMask);
-}
-
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __gl_client_ftable_t_h
-#define __gl_client_ftable_t_h
-
-
-static const struct _gl_funcs_by_name {
- const char *name;
- void *proc;
-} gl_funcs_by_name[] = {
- {"glAlphaFunc", (void*)glAlphaFunc},
- {"glClearColor", (void*)glClearColor},
- {"glClearDepthf", (void*)glClearDepthf},
- {"glClipPlanef", (void*)glClipPlanef},
- {"glColor4f", (void*)glColor4f},
- {"glDepthRangef", (void*)glDepthRangef},
- {"glFogf", (void*)glFogf},
- {"glFogfv", (void*)glFogfv},
- {"glFrustumf", (void*)glFrustumf},
- {"glGetClipPlanef", (void*)glGetClipPlanef},
- {"glGetFloatv", (void*)glGetFloatv},
- {"glGetLightfv", (void*)glGetLightfv},
- {"glGetMaterialfv", (void*)glGetMaterialfv},
- {"glGetTexEnvfv", (void*)glGetTexEnvfv},
- {"glGetTexParameterfv", (void*)glGetTexParameterfv},
- {"glLightModelf", (void*)glLightModelf},
- {"glLightModelfv", (void*)glLightModelfv},
- {"glLightf", (void*)glLightf},
- {"glLightfv", (void*)glLightfv},
- {"glLineWidth", (void*)glLineWidth},
- {"glLoadMatrixf", (void*)glLoadMatrixf},
- {"glMaterialf", (void*)glMaterialf},
- {"glMaterialfv", (void*)glMaterialfv},
- {"glMultMatrixf", (void*)glMultMatrixf},
- {"glMultiTexCoord4f", (void*)glMultiTexCoord4f},
- {"glNormal3f", (void*)glNormal3f},
- {"glOrthof", (void*)glOrthof},
- {"glPointParameterf", (void*)glPointParameterf},
- {"glPointParameterfv", (void*)glPointParameterfv},
- {"glPointSize", (void*)glPointSize},
- {"glPolygonOffset", (void*)glPolygonOffset},
- {"glRotatef", (void*)glRotatef},
- {"glScalef", (void*)glScalef},
- {"glTexEnvf", (void*)glTexEnvf},
- {"glTexEnvfv", (void*)glTexEnvfv},
- {"glTexParameterf", (void*)glTexParameterf},
- {"glTexParameterfv", (void*)glTexParameterfv},
- {"glTranslatef", (void*)glTranslatef},
- {"glActiveTexture", (void*)glActiveTexture},
- {"glAlphaFuncx", (void*)glAlphaFuncx},
- {"glBindBuffer", (void*)glBindBuffer},
- {"glBindTexture", (void*)glBindTexture},
- {"glBlendFunc", (void*)glBlendFunc},
- {"glBufferData", (void*)glBufferData},
- {"glBufferSubData", (void*)glBufferSubData},
- {"glClear", (void*)glClear},
- {"glClearColorx", (void*)glClearColorx},
- {"glClearDepthx", (void*)glClearDepthx},
- {"glClearStencil", (void*)glClearStencil},
- {"glClientActiveTexture", (void*)glClientActiveTexture},
- {"glColor4ub", (void*)glColor4ub},
- {"glColor4x", (void*)glColor4x},
- {"glColorMask", (void*)glColorMask},
- {"glColorPointer", (void*)glColorPointer},
- {"glCompressedTexImage2D", (void*)glCompressedTexImage2D},
- {"glCompressedTexSubImage2D", (void*)glCompressedTexSubImage2D},
- {"glCopyTexImage2D", (void*)glCopyTexImage2D},
- {"glCopyTexSubImage2D", (void*)glCopyTexSubImage2D},
- {"glCullFace", (void*)glCullFace},
- {"glDeleteBuffers", (void*)glDeleteBuffers},
- {"glDeleteTextures", (void*)glDeleteTextures},
- {"glDepthFunc", (void*)glDepthFunc},
- {"glDepthMask", (void*)glDepthMask},
- {"glDepthRangex", (void*)glDepthRangex},
- {"glDisable", (void*)glDisable},
- {"glDisableClientState", (void*)glDisableClientState},
- {"glDrawArrays", (void*)glDrawArrays},
- {"glDrawElements", (void*)glDrawElements},
- {"glEnable", (void*)glEnable},
- {"glEnableClientState", (void*)glEnableClientState},
- {"glFinish", (void*)glFinish},
- {"glFlush", (void*)glFlush},
- {"glFogx", (void*)glFogx},
- {"glFogxv", (void*)glFogxv},
- {"glFrontFace", (void*)glFrontFace},
- {"glFrustumx", (void*)glFrustumx},
- {"glGetBooleanv", (void*)glGetBooleanv},
- {"glGetBufferParameteriv", (void*)glGetBufferParameteriv},
- {"glClipPlanex", (void*)glClipPlanex},
- {"glGenBuffers", (void*)glGenBuffers},
- {"glGenTextures", (void*)glGenTextures},
- {"glGetError", (void*)glGetError},
- {"glGetFixedv", (void*)glGetFixedv},
- {"glGetIntegerv", (void*)glGetIntegerv},
- {"glGetLightxv", (void*)glGetLightxv},
- {"glGetMaterialxv", (void*)glGetMaterialxv},
- {"glGetPointerv", (void*)glGetPointerv},
- {"glGetString", (void*)glGetString},
- {"glGetTexEnviv", (void*)glGetTexEnviv},
- {"glGetTexEnvxv", (void*)glGetTexEnvxv},
- {"glGetTexParameteriv", (void*)glGetTexParameteriv},
- {"glGetTexParameterxv", (void*)glGetTexParameterxv},
- {"glHint", (void*)glHint},
- {"glIsBuffer", (void*)glIsBuffer},
- {"glIsEnabled", (void*)glIsEnabled},
- {"glIsTexture", (void*)glIsTexture},
- {"glLightModelx", (void*)glLightModelx},
- {"glLightModelxv", (void*)glLightModelxv},
- {"glLightx", (void*)glLightx},
- {"glLightxv", (void*)glLightxv},
- {"glLineWidthx", (void*)glLineWidthx},
- {"glLoadIdentity", (void*)glLoadIdentity},
- {"glLoadMatrixx", (void*)glLoadMatrixx},
- {"glLogicOp", (void*)glLogicOp},
- {"glMaterialx", (void*)glMaterialx},
- {"glMaterialxv", (void*)glMaterialxv},
- {"glMatrixMode", (void*)glMatrixMode},
- {"glMultMatrixx", (void*)glMultMatrixx},
- {"glMultiTexCoord4x", (void*)glMultiTexCoord4x},
- {"glNormal3x", (void*)glNormal3x},
- {"glNormalPointer", (void*)glNormalPointer},
- {"glOrthox", (void*)glOrthox},
- {"glPixelStorei", (void*)glPixelStorei},
- {"glPointParameterx", (void*)glPointParameterx},
- {"glPointParameterxv", (void*)glPointParameterxv},
- {"glPointSizex", (void*)glPointSizex},
- {"glPolygonOffsetx", (void*)glPolygonOffsetx},
- {"glPopMatrix", (void*)glPopMatrix},
- {"glPushMatrix", (void*)glPushMatrix},
- {"glReadPixels", (void*)glReadPixels},
- {"glRotatex", (void*)glRotatex},
- {"glSampleCoverage", (void*)glSampleCoverage},
- {"glSampleCoveragex", (void*)glSampleCoveragex},
- {"glScalex", (void*)glScalex},
- {"glScissor", (void*)glScissor},
- {"glShadeModel", (void*)glShadeModel},
- {"glStencilFunc", (void*)glStencilFunc},
- {"glStencilMask", (void*)glStencilMask},
- {"glStencilOp", (void*)glStencilOp},
- {"glTexCoordPointer", (void*)glTexCoordPointer},
- {"glTexEnvi", (void*)glTexEnvi},
- {"glTexEnvx", (void*)glTexEnvx},
- {"glTexEnviv", (void*)glTexEnviv},
- {"glTexEnvxv", (void*)glTexEnvxv},
- {"glTexImage2D", (void*)glTexImage2D},
- {"glTexParameteri", (void*)glTexParameteri},
- {"glTexParameterx", (void*)glTexParameterx},
- {"glTexParameteriv", (void*)glTexParameteriv},
- {"glTexParameterxv", (void*)glTexParameterxv},
- {"glTexSubImage2D", (void*)glTexSubImage2D},
- {"glTranslatex", (void*)glTranslatex},
- {"glVertexPointer", (void*)glVertexPointer},
- {"glViewport", (void*)glViewport},
- {"glPointSizePointerOES", (void*)glPointSizePointerOES},
- {"glBlendEquationSeparateOES", (void*)glBlendEquationSeparateOES},
- {"glBlendFuncSeparateOES", (void*)glBlendFuncSeparateOES},
- {"glBlendEquationOES", (void*)glBlendEquationOES},
- {"glDrawTexsOES", (void*)glDrawTexsOES},
- {"glDrawTexiOES", (void*)glDrawTexiOES},
- {"glDrawTexxOES", (void*)glDrawTexxOES},
- {"glDrawTexsvOES", (void*)glDrawTexsvOES},
- {"glDrawTexivOES", (void*)glDrawTexivOES},
- {"glDrawTexxvOES", (void*)glDrawTexxvOES},
- {"glDrawTexfOES", (void*)glDrawTexfOES},
- {"glDrawTexfvOES", (void*)glDrawTexfvOES},
- {"glEGLImageTargetTexture2DOES", (void*)glEGLImageTargetTexture2DOES},
- {"glEGLImageTargetRenderbufferStorageOES", (void*)glEGLImageTargetRenderbufferStorageOES},
- {"glAlphaFuncxOES", (void*)glAlphaFuncxOES},
- {"glClearColorxOES", (void*)glClearColorxOES},
- {"glClearDepthxOES", (void*)glClearDepthxOES},
- {"glClipPlanexOES", (void*)glClipPlanexOES},
- {"glClipPlanexIMG", (void*)glClipPlanexIMG},
- {"glColor4xOES", (void*)glColor4xOES},
- {"glDepthRangexOES", (void*)glDepthRangexOES},
- {"glFogxOES", (void*)glFogxOES},
- {"glFogxvOES", (void*)glFogxvOES},
- {"glFrustumxOES", (void*)glFrustumxOES},
- {"glGetClipPlanexOES", (void*)glGetClipPlanexOES},
- {"glGetClipPlanex", (void*)glGetClipPlanex},
- {"glGetFixedvOES", (void*)glGetFixedvOES},
- {"glGetLightxvOES", (void*)glGetLightxvOES},
- {"glGetMaterialxvOES", (void*)glGetMaterialxvOES},
- {"glGetTexEnvxvOES", (void*)glGetTexEnvxvOES},
- {"glGetTexParameterxvOES", (void*)glGetTexParameterxvOES},
- {"glLightModelxOES", (void*)glLightModelxOES},
- {"glLightModelxvOES", (void*)glLightModelxvOES},
- {"glLightxOES", (void*)glLightxOES},
- {"glLightxvOES", (void*)glLightxvOES},
- {"glLineWidthxOES", (void*)glLineWidthxOES},
- {"glLoadMatrixxOES", (void*)glLoadMatrixxOES},
- {"glMaterialxOES", (void*)glMaterialxOES},
- {"glMaterialxvOES", (void*)glMaterialxvOES},
- {"glMultMatrixxOES", (void*)glMultMatrixxOES},
- {"glMultiTexCoord4xOES", (void*)glMultiTexCoord4xOES},
- {"glNormal3xOES", (void*)glNormal3xOES},
- {"glOrthoxOES", (void*)glOrthoxOES},
- {"glPointParameterxOES", (void*)glPointParameterxOES},
- {"glPointParameterxvOES", (void*)glPointParameterxvOES},
- {"glPointSizexOES", (void*)glPointSizexOES},
- {"glPolygonOffsetxOES", (void*)glPolygonOffsetxOES},
- {"glRotatexOES", (void*)glRotatexOES},
- {"glSampleCoveragexOES", (void*)glSampleCoveragexOES},
- {"glScalexOES", (void*)glScalexOES},
- {"glTexEnvxOES", (void*)glTexEnvxOES},
- {"glTexEnvxvOES", (void*)glTexEnvxvOES},
- {"glTexParameterxOES", (void*)glTexParameterxOES},
- {"glTexParameterxvOES", (void*)glTexParameterxvOES},
- {"glTranslatexOES", (void*)glTranslatexOES},
- {"glIsRenderbufferOES", (void*)glIsRenderbufferOES},
- {"glBindRenderbufferOES", (void*)glBindRenderbufferOES},
- {"glDeleteRenderbuffersOES", (void*)glDeleteRenderbuffersOES},
- {"glGenRenderbuffersOES", (void*)glGenRenderbuffersOES},
- {"glRenderbufferStorageOES", (void*)glRenderbufferStorageOES},
- {"glGetRenderbufferParameterivOES", (void*)glGetRenderbufferParameterivOES},
- {"glIsFramebufferOES", (void*)glIsFramebufferOES},
- {"glBindFramebufferOES", (void*)glBindFramebufferOES},
- {"glDeleteFramebuffersOES", (void*)glDeleteFramebuffersOES},
- {"glGenFramebuffersOES", (void*)glGenFramebuffersOES},
- {"glCheckFramebufferStatusOES", (void*)glCheckFramebufferStatusOES},
- {"glFramebufferRenderbufferOES", (void*)glFramebufferRenderbufferOES},
- {"glFramebufferTexture2DOES", (void*)glFramebufferTexture2DOES},
- {"glGetFramebufferAttachmentParameterivOES", (void*)glGetFramebufferAttachmentParameterivOES},
- {"glGenerateMipmapOES", (void*)glGenerateMipmapOES},
- {"glMapBufferOES", (void*)glMapBufferOES},
- {"glUnmapBufferOES", (void*)glUnmapBufferOES},
- {"glGetBufferPointervOES", (void*)glGetBufferPointervOES},
- {"glCurrentPaletteMatrixOES", (void*)glCurrentPaletteMatrixOES},
- {"glLoadPaletteFromModelViewMatrixOES", (void*)glLoadPaletteFromModelViewMatrixOES},
- {"glMatrixIndexPointerOES", (void*)glMatrixIndexPointerOES},
- {"glWeightPointerOES", (void*)glWeightPointerOES},
- {"glQueryMatrixxOES", (void*)glQueryMatrixxOES},
- {"glDepthRangefOES", (void*)glDepthRangefOES},
- {"glFrustumfOES", (void*)glFrustumfOES},
- {"glOrthofOES", (void*)glOrthofOES},
- {"glClipPlanefOES", (void*)glClipPlanefOES},
- {"glClipPlanefIMG", (void*)glClipPlanefIMG},
- {"glGetClipPlanefOES", (void*)glGetClipPlanefOES},
- {"glClearDepthfOES", (void*)glClearDepthfOES},
- {"glTexGenfOES", (void*)glTexGenfOES},
- {"glTexGenfvOES", (void*)glTexGenfvOES},
- {"glTexGeniOES", (void*)glTexGeniOES},
- {"glTexGenivOES", (void*)glTexGenivOES},
- {"glTexGenxOES", (void*)glTexGenxOES},
- {"glTexGenxvOES", (void*)glTexGenxvOES},
- {"glGetTexGenfvOES", (void*)glGetTexGenfvOES},
- {"glGetTexGenivOES", (void*)glGetTexGenivOES},
- {"glGetTexGenxvOES", (void*)glGetTexGenxvOES},
- {"glBindVertexArrayOES", (void*)glBindVertexArrayOES},
- {"glDeleteVertexArraysOES", (void*)glDeleteVertexArraysOES},
- {"glGenVertexArraysOES", (void*)glGenVertexArraysOES},
- {"glIsVertexArrayOES", (void*)glIsVertexArrayOES},
- {"glDiscardFramebufferEXT", (void*)glDiscardFramebufferEXT},
- {"glMultiDrawArraysEXT", (void*)glMultiDrawArraysEXT},
- {"glMultiDrawElementsEXT", (void*)glMultiDrawElementsEXT},
- {"glMultiDrawArraysSUN", (void*)glMultiDrawArraysSUN},
- {"glMultiDrawElementsSUN", (void*)glMultiDrawElementsSUN},
- {"glRenderbufferStorageMultisampleIMG", (void*)glRenderbufferStorageMultisampleIMG},
- {"glFramebufferTexture2DMultisampleIMG", (void*)glFramebufferTexture2DMultisampleIMG},
- {"glDeleteFencesNV", (void*)glDeleteFencesNV},
- {"glGenFencesNV", (void*)glGenFencesNV},
- {"glIsFenceNV", (void*)glIsFenceNV},
- {"glTestFenceNV", (void*)glTestFenceNV},
- {"glGetFenceivNV", (void*)glGetFenceivNV},
- {"glFinishFenceNV", (void*)glFinishFenceNV},
- {"glSetFenceNV", (void*)glSetFenceNV},
- {"glGetDriverControlsQCOM", (void*)glGetDriverControlsQCOM},
- {"glGetDriverControlStringQCOM", (void*)glGetDriverControlStringQCOM},
- {"glEnableDriverControlQCOM", (void*)glEnableDriverControlQCOM},
- {"glDisableDriverControlQCOM", (void*)glDisableDriverControlQCOM},
- {"glExtGetTexturesQCOM", (void*)glExtGetTexturesQCOM},
- {"glExtGetBuffersQCOM", (void*)glExtGetBuffersQCOM},
- {"glExtGetRenderbuffersQCOM", (void*)glExtGetRenderbuffersQCOM},
- {"glExtGetFramebuffersQCOM", (void*)glExtGetFramebuffersQCOM},
- {"glExtGetTexLevelParameterivQCOM", (void*)glExtGetTexLevelParameterivQCOM},
- {"glExtTexObjectStateOverrideiQCOM", (void*)glExtTexObjectStateOverrideiQCOM},
- {"glExtGetTexSubImageQCOM", (void*)glExtGetTexSubImageQCOM},
- {"glExtGetBufferPointervQCOM", (void*)glExtGetBufferPointervQCOM},
- {"glExtGetShadersQCOM", (void*)glExtGetShadersQCOM},
- {"glExtGetProgramsQCOM", (void*)glExtGetProgramsQCOM},
- {"glExtIsProgramBinaryQCOM", (void*)glExtIsProgramBinaryQCOM},
- {"glExtGetProgramBinarySourceQCOM", (void*)glExtGetProgramBinarySourceQCOM},
- {"glStartTilingQCOM", (void*)glStartTilingQCOM},
- {"glEndTilingQCOM", (void*)glEndTilingQCOM},
-};
-static const int gl_num_funcs = sizeof(gl_funcs_by_name) / sizeof(struct _gl_funcs_by_name);
-
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __GUARD_gl_opcodes_h_
-#define __GUARD_gl_opcodes_h_
-
-#define OP_glAlphaFunc 1024
-#define OP_glClearColor 1025
-#define OP_glClearDepthf 1026
-#define OP_glClipPlanef 1027
-#define OP_glColor4f 1028
-#define OP_glDepthRangef 1029
-#define OP_glFogf 1030
-#define OP_glFogfv 1031
-#define OP_glFrustumf 1032
-#define OP_glGetClipPlanef 1033
-#define OP_glGetFloatv 1034
-#define OP_glGetLightfv 1035
-#define OP_glGetMaterialfv 1036
-#define OP_glGetTexEnvfv 1037
-#define OP_glGetTexParameterfv 1038
-#define OP_glLightModelf 1039
-#define OP_glLightModelfv 1040
-#define OP_glLightf 1041
-#define OP_glLightfv 1042
-#define OP_glLineWidth 1043
-#define OP_glLoadMatrixf 1044
-#define OP_glMaterialf 1045
-#define OP_glMaterialfv 1046
-#define OP_glMultMatrixf 1047
-#define OP_glMultiTexCoord4f 1048
-#define OP_glNormal3f 1049
-#define OP_glOrthof 1050
-#define OP_glPointParameterf 1051
-#define OP_glPointParameterfv 1052
-#define OP_glPointSize 1053
-#define OP_glPolygonOffset 1054
-#define OP_glRotatef 1055
-#define OP_glScalef 1056
-#define OP_glTexEnvf 1057
-#define OP_glTexEnvfv 1058
-#define OP_glTexParameterf 1059
-#define OP_glTexParameterfv 1060
-#define OP_glTranslatef 1061
-#define OP_glActiveTexture 1062
-#define OP_glAlphaFuncx 1063
-#define OP_glBindBuffer 1064
-#define OP_glBindTexture 1065
-#define OP_glBlendFunc 1066
-#define OP_glBufferData 1067
-#define OP_glBufferSubData 1068
-#define OP_glClear 1069
-#define OP_glClearColorx 1070
-#define OP_glClearDepthx 1071
-#define OP_glClearStencil 1072
-#define OP_glClientActiveTexture 1073
-#define OP_glColor4ub 1074
-#define OP_glColor4x 1075
-#define OP_glColorMask 1076
-#define OP_glColorPointer 1077
-#define OP_glCompressedTexImage2D 1078
-#define OP_glCompressedTexSubImage2D 1079
-#define OP_glCopyTexImage2D 1080
-#define OP_glCopyTexSubImage2D 1081
-#define OP_glCullFace 1082
-#define OP_glDeleteBuffers 1083
-#define OP_glDeleteTextures 1084
-#define OP_glDepthFunc 1085
-#define OP_glDepthMask 1086
-#define OP_glDepthRangex 1087
-#define OP_glDisable 1088
-#define OP_glDisableClientState 1089
-#define OP_glDrawArrays 1090
-#define OP_glDrawElements 1091
-#define OP_glEnable 1092
-#define OP_glEnableClientState 1093
-#define OP_glFinish 1094
-#define OP_glFlush 1095
-#define OP_glFogx 1096
-#define OP_glFogxv 1097
-#define OP_glFrontFace 1098
-#define OP_glFrustumx 1099
-#define OP_glGetBooleanv 1100
-#define OP_glGetBufferParameteriv 1101
-#define OP_glClipPlanex 1102
-#define OP_glGenBuffers 1103
-#define OP_glGenTextures 1104
-#define OP_glGetError 1105
-#define OP_glGetFixedv 1106
-#define OP_glGetIntegerv 1107
-#define OP_glGetLightxv 1108
-#define OP_glGetMaterialxv 1109
-#define OP_glGetPointerv 1110
-#define OP_glGetString 1111
-#define OP_glGetTexEnviv 1112
-#define OP_glGetTexEnvxv 1113
-#define OP_glGetTexParameteriv 1114
-#define OP_glGetTexParameterxv 1115
-#define OP_glHint 1116
-#define OP_glIsBuffer 1117
-#define OP_glIsEnabled 1118
-#define OP_glIsTexture 1119
-#define OP_glLightModelx 1120
-#define OP_glLightModelxv 1121
-#define OP_glLightx 1122
-#define OP_glLightxv 1123
-#define OP_glLineWidthx 1124
-#define OP_glLoadIdentity 1125
-#define OP_glLoadMatrixx 1126
-#define OP_glLogicOp 1127
-#define OP_glMaterialx 1128
-#define OP_glMaterialxv 1129
-#define OP_glMatrixMode 1130
-#define OP_glMultMatrixx 1131
-#define OP_glMultiTexCoord4x 1132
-#define OP_glNormal3x 1133
-#define OP_glNormalPointer 1134
-#define OP_glOrthox 1135
-#define OP_glPixelStorei 1136
-#define OP_glPointParameterx 1137
-#define OP_glPointParameterxv 1138
-#define OP_glPointSizex 1139
-#define OP_glPolygonOffsetx 1140
-#define OP_glPopMatrix 1141
-#define OP_glPushMatrix 1142
-#define OP_glReadPixels 1143
-#define OP_glRotatex 1144
-#define OP_glSampleCoverage 1145
-#define OP_glSampleCoveragex 1146
-#define OP_glScalex 1147
-#define OP_glScissor 1148
-#define OP_glShadeModel 1149
-#define OP_glStencilFunc 1150
-#define OP_glStencilMask 1151
-#define OP_glStencilOp 1152
-#define OP_glTexCoordPointer 1153
-#define OP_glTexEnvi 1154
-#define OP_glTexEnvx 1155
-#define OP_glTexEnviv 1156
-#define OP_glTexEnvxv 1157
-#define OP_glTexImage2D 1158
-#define OP_glTexParameteri 1159
-#define OP_glTexParameterx 1160
-#define OP_glTexParameteriv 1161
-#define OP_glTexParameterxv 1162
-#define OP_glTexSubImage2D 1163
-#define OP_glTranslatex 1164
-#define OP_glVertexPointer 1165
-#define OP_glViewport 1166
-#define OP_glPointSizePointerOES 1167
-#define OP_glVertexPointerOffset 1168
-#define OP_glColorPointerOffset 1169
-#define OP_glNormalPointerOffset 1170
-#define OP_glPointSizePointerOffset 1171
-#define OP_glTexCoordPointerOffset 1172
-#define OP_glWeightPointerOffset 1173
-#define OP_glMatrixIndexPointerOffset 1174
-#define OP_glVertexPointerData 1175
-#define OP_glColorPointerData 1176
-#define OP_glNormalPointerData 1177
-#define OP_glTexCoordPointerData 1178
-#define OP_glPointSizePointerData 1179
-#define OP_glWeightPointerData 1180
-#define OP_glMatrixIndexPointerData 1181
-#define OP_glDrawElementsOffset 1182
-#define OP_glDrawElementsData 1183
-#define OP_glGetCompressedTextureFormats 1184
-#define OP_glFinishRoundTrip 1185
-#define OP_glBlendEquationSeparateOES 1186
-#define OP_glBlendFuncSeparateOES 1187
-#define OP_glBlendEquationOES 1188
-#define OP_glDrawTexsOES 1189
-#define OP_glDrawTexiOES 1190
-#define OP_glDrawTexxOES 1191
-#define OP_glDrawTexsvOES 1192
-#define OP_glDrawTexivOES 1193
-#define OP_glDrawTexxvOES 1194
-#define OP_glDrawTexfOES 1195
-#define OP_glDrawTexfvOES 1196
-#define OP_glEGLImageTargetTexture2DOES 1197
-#define OP_glEGLImageTargetRenderbufferStorageOES 1198
-#define OP_glAlphaFuncxOES 1199
-#define OP_glClearColorxOES 1200
-#define OP_glClearDepthxOES 1201
-#define OP_glClipPlanexOES 1202
-#define OP_glClipPlanexIMG 1203
-#define OP_glColor4xOES 1204
-#define OP_glDepthRangexOES 1205
-#define OP_glFogxOES 1206
-#define OP_glFogxvOES 1207
-#define OP_glFrustumxOES 1208
-#define OP_glGetClipPlanexOES 1209
-#define OP_glGetClipPlanex 1210
-#define OP_glGetFixedvOES 1211
-#define OP_glGetLightxvOES 1212
-#define OP_glGetMaterialxvOES 1213
-#define OP_glGetTexEnvxvOES 1214
-#define OP_glGetTexParameterxvOES 1215
-#define OP_glLightModelxOES 1216
-#define OP_glLightModelxvOES 1217
-#define OP_glLightxOES 1218
-#define OP_glLightxvOES 1219
-#define OP_glLineWidthxOES 1220
-#define OP_glLoadMatrixxOES 1221
-#define OP_glMaterialxOES 1222
-#define OP_glMaterialxvOES 1223
-#define OP_glMultMatrixxOES 1224
-#define OP_glMultiTexCoord4xOES 1225
-#define OP_glNormal3xOES 1226
-#define OP_glOrthoxOES 1227
-#define OP_glPointParameterxOES 1228
-#define OP_glPointParameterxvOES 1229
-#define OP_glPointSizexOES 1230
-#define OP_glPolygonOffsetxOES 1231
-#define OP_glRotatexOES 1232
-#define OP_glSampleCoveragexOES 1233
-#define OP_glScalexOES 1234
-#define OP_glTexEnvxOES 1235
-#define OP_glTexEnvxvOES 1236
-#define OP_glTexParameterxOES 1237
-#define OP_glTexParameterxvOES 1238
-#define OP_glTranslatexOES 1239
-#define OP_glIsRenderbufferOES 1240
-#define OP_glBindRenderbufferOES 1241
-#define OP_glDeleteRenderbuffersOES 1242
-#define OP_glGenRenderbuffersOES 1243
-#define OP_glRenderbufferStorageOES 1244
-#define OP_glGetRenderbufferParameterivOES 1245
-#define OP_glIsFramebufferOES 1246
-#define OP_glBindFramebufferOES 1247
-#define OP_glDeleteFramebuffersOES 1248
-#define OP_glGenFramebuffersOES 1249
-#define OP_glCheckFramebufferStatusOES 1250
-#define OP_glFramebufferRenderbufferOES 1251
-#define OP_glFramebufferTexture2DOES 1252
-#define OP_glGetFramebufferAttachmentParameterivOES 1253
-#define OP_glGenerateMipmapOES 1254
-#define OP_glMapBufferOES 1255
-#define OP_glUnmapBufferOES 1256
-#define OP_glGetBufferPointervOES 1257
-#define OP_glCurrentPaletteMatrixOES 1258
-#define OP_glLoadPaletteFromModelViewMatrixOES 1259
-#define OP_glMatrixIndexPointerOES 1260
-#define OP_glWeightPointerOES 1261
-#define OP_glQueryMatrixxOES 1262
-#define OP_glDepthRangefOES 1263
-#define OP_glFrustumfOES 1264
-#define OP_glOrthofOES 1265
-#define OP_glClipPlanefOES 1266
-#define OP_glClipPlanefIMG 1267
-#define OP_glGetClipPlanefOES 1268
-#define OP_glClearDepthfOES 1269
-#define OP_glTexGenfOES 1270
-#define OP_glTexGenfvOES 1271
-#define OP_glTexGeniOES 1272
-#define OP_glTexGenivOES 1273
-#define OP_glTexGenxOES 1274
-#define OP_glTexGenxvOES 1275
-#define OP_glGetTexGenfvOES 1276
-#define OP_glGetTexGenivOES 1277
-#define OP_glGetTexGenxvOES 1278
-#define OP_glBindVertexArrayOES 1279
-#define OP_glDeleteVertexArraysOES 1280
-#define OP_glGenVertexArraysOES 1281
-#define OP_glIsVertexArrayOES 1282
-#define OP_glDiscardFramebufferEXT 1283
-#define OP_glMultiDrawArraysEXT 1284
-#define OP_glMultiDrawElementsEXT 1285
-#define OP_glMultiDrawArraysSUN 1286
-#define OP_glMultiDrawElementsSUN 1287
-#define OP_glRenderbufferStorageMultisampleIMG 1288
-#define OP_glFramebufferTexture2DMultisampleIMG 1289
-#define OP_glDeleteFencesNV 1290
-#define OP_glGenFencesNV 1291
-#define OP_glIsFenceNV 1292
-#define OP_glTestFenceNV 1293
-#define OP_glGetFenceivNV 1294
-#define OP_glFinishFenceNV 1295
-#define OP_glSetFenceNV 1296
-#define OP_glGetDriverControlsQCOM 1297
-#define OP_glGetDriverControlStringQCOM 1298
-#define OP_glEnableDriverControlQCOM 1299
-#define OP_glDisableDriverControlQCOM 1300
-#define OP_glExtGetTexturesQCOM 1301
-#define OP_glExtGetBuffersQCOM 1302
-#define OP_glExtGetRenderbuffersQCOM 1303
-#define OP_glExtGetFramebuffersQCOM 1304
-#define OP_glExtGetTexLevelParameterivQCOM 1305
-#define OP_glExtTexObjectStateOverrideiQCOM 1306
-#define OP_glExtGetTexSubImageQCOM 1307
-#define OP_glExtGetBufferPointervQCOM 1308
-#define OP_glExtGetShadersQCOM 1309
-#define OP_glExtGetProgramsQCOM 1310
-#define OP_glExtIsProgramBinaryQCOM 1311
-#define OP_glExtGetProgramBinarySourceQCOM 1312
-#define OP_glStartTilingQCOM 1313
-#define OP_glEndTilingQCOM 1314
-#define OP_last 1315
-
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 __GL_TYPES__H
-#define __GL_TYPES__H
-
-#include "gl_base_types.h"
-#endif
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-### GLESv2 implementation ###########################################
-$(call emugl-begin-shared-library,libGLESv2_emulation)
-$(call emugl-import,libOpenglSystemCommon libGLESv2_enc lib_renderControl_enc)
-
-LOCAL_CFLAGS += -DLOG_TAG=\"GLESv2_emulation\" -DGL_GLEXT_PROTOTYPES
-
-LOCAL_SRC_FILES := gl2.cpp
-LOCAL_MODULE_RELATIVE_PATH := egl
-
-$(call emugl-end-module)
+++ /dev/null
-/*
-* Copyright 2011 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 "EGLClientIface.h"
-#include "HostConnection.h"
-#include "GL2Encoder.h"
-#include "GLES/gl.h"
-#include "GLES/glext.h"
-#include "ErrorLog.h"
-#include "gralloc_cb.h"
-#include "ThreadInfo.h"
-#include "EGLImage.h"
-
-//XXX: fix this macro to get the context from fast tls path
-#define GET_CONTEXT GL2Encoder * ctx = getEGLThreadInfo()->hostConn->gl2Encoder();
-
-#include "gl2_entry.cpp"
-
-//The functions table
-#include "gl2_ftable.h"
-
-
-static EGLClient_eglInterface * s_egl = NULL;
-static EGLClient_glesInterface * s_gl = NULL;
-
-#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
- HostConnection *hostCon = HostConnection::get(); \
- if (!hostCon) { \
- ALOGE("egl: Failed to get host connection\n"); \
- return ret; \
- } \
- renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
- if (!rcEnc) { \
- ALOGE("egl: Failed to get renderControl encoder context\n"); \
- return ret; \
- }
-
-//GL extensions
-void glEGLImageTargetTexture2DOES(void * self, GLenum target, GLeglImageOES img)
-{
- (void)self;
- (void)target;
-
- DBG("glEGLImageTargetTexture2DOES v2 target=%#x img=%p\n", target, img);
-
- EGLImage_t *image = (EGLImage_t*)img;
-
- if (image->target == EGL_NATIVE_BUFFER_ANDROID) {
- //TODO: check error - we don't have a way to set gl error
- android_native_buffer_t* native_buffer = image->native_buffer;
-
- if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
- return;
- }
-
- if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
- return;
- }
-
- GET_CONTEXT;
- DEFINE_AND_VALIDATE_HOST_CONNECTION();
-
- ctx->override2DTextureTarget(target);
- rcEnc->rcBindTexture(rcEnc, ((cb_handle_t *)(native_buffer->handle))->hostHandle);
- ctx->restore2DTextureTarget();
- }
- else if (image->target == EGL_GL_TEXTURE_2D_KHR) {
- GET_CONTEXT;
- ctx->override2DTextureTarget(target);
- GLeglImageOES hostImage = reinterpret_cast<GLeglImageOES>((intptr_t)image->host_egl_image);
- ctx->m_glEGLImageTargetTexture2DOES_enc(self, target, hostImage);
- ctx->restore2DTextureTarget();
- }
-}
-
-void glEGLImageTargetRenderbufferStorageOES(void *self, GLenum target, GLeglImageOES image)
-{
- (void)self;
- (void)target;
-
- DBG("glEGLImageTargetRenderbufferStorageOES v2 image=%p\n", image);
- //TODO: check error - we don't have a way to set gl error
- android_native_buffer_t* native_buffer = (android_native_buffer_t*)image;
-
- if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
- return;
- }
-
- if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
- return;
- }
-
- DEFINE_AND_VALIDATE_HOST_CONNECTION();
- rcEnc->rcBindRenderbuffer(rcEnc, ((cb_handle_t *)(native_buffer->handle))->hostHandle);
-
- return;
-}
-
-void * getProcAddress(const char * procname)
-{
- // search in GL function table
- for (int i=0; i<gl2_num_funcs; i++) {
- if (!strcmp(gl2_funcs_by_name[i].name, procname)) {
- return gl2_funcs_by_name[i].proc;
- }
- }
- return NULL;
-}
-
-void finish()
-{
- glFinish();
-}
-
-const GLubyte *my_glGetString (void *self, GLenum name)
-{
- (void)self;
-
- //see ref in https://www.khronos.org/opengles/sdk/docs/man
- //name in glGetString can be one of the following five values
- switch (name) {
- case GL_VERSION:
- case GL_VENDOR:
- case GL_RENDERER:
- case GL_SHADING_LANGUAGE_VERSION:
- case GL_EXTENSIONS:
- if (s_egl) {
- return (const GLubyte*)s_egl->getGLString(name);
- }
- break;
- default:
- GET_CONTEXT;
- ctx->setError(GL_INVALID_ENUM);
- break;
- }
- return NULL;
-}
-
-void init()
-{
- GET_CONTEXT;
- ctx->m_glEGLImageTargetTexture2DOES_enc = ctx->glEGLImageTargetTexture2DOES;
- ctx->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES;
- ctx->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES;
- ctx->glGetString = &my_glGetString;
-}
-
-extern "C" {
-EGLClient_glesInterface * init_emul_gles(EGLClient_eglInterface *eglIface)
-{
- s_egl = eglIface;
-
- if (!s_gl) {
- s_gl = new EGLClient_glesInterface();
- s_gl->getProcAddress = getProcAddress;
- s_gl->finish = finish;
- s_gl->init = init;
- }
-
- return s_gl;
-}
-} //extern
-
-
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-### GLESv2_enc Encoder ###########################################
-$(call emugl-begin-shared-library,libGLESv2_enc)
-
-LOCAL_SRC_FILES := \
- GL2EncoderUtils.cpp \
- GL2Encoder.cpp \
- gl2_client_context.cpp \
- gl2_enc.cpp \
- gl2_entry.cpp
-
-LOCAL_CFLAGS += -DLOG_TAG=\"emuglGLESv2_enc\"
-
-$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
-$(call emugl-import,libOpenglCodecCommon)
-
-$(call emugl-end-module)
-
-
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "GL2Encoder.h"
-#include <assert.h>
-#include <ctype.h>
-#include <cmath>
-
-#ifndef MIN
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-static GLubyte *gVendorString= (GLubyte *) "Android";
-static GLubyte *gRendererString= (GLubyte *) "Android HW-GLES 2.0";
-static GLubyte *gVersionString= (GLubyte *) "OpenGL ES 2.0";
-static GLubyte *gExtensionsString= (GLubyte *) "GL_OES_EGL_image_external ";
-
-#define SET_ERROR_IF(condition,err) if((condition)) { \
- ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
- ctx->setError(err); \
- return; \
- }
-
-
-#define RET_AND_SET_ERROR_IF(condition,err,ret) if((condition)) { \
- ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
- ctx->setError(err); \
- return ret; \
- }
-
-
-GL2Encoder::GL2Encoder(IOStream *stream, ChecksumCalculator *protocol)
- : gl2_encoder_context_t(stream, protocol)
-{
- m_initialized = false;
- m_state = NULL;
- m_error = GL_NO_ERROR;
- m_num_compressedTextureFormats = 0;
- m_max_cubeMapTextureSize = 0;
- m_max_renderBufferSize = 0;
- m_max_textureSize = 0;
- m_compressedTextureFormats = NULL;
-
- //overrides
-#define OVERRIDE(name) m_##name##_enc = this-> name ; this-> name = &s_##name
-
- OVERRIDE(glFlush);
- OVERRIDE(glPixelStorei);
- OVERRIDE(glGetString);
- OVERRIDE(glBindBuffer);
- OVERRIDE(glBufferData);
- OVERRIDE(glBufferSubData);
- OVERRIDE(glDeleteBuffers);
- OVERRIDE(glDrawArrays);
- OVERRIDE(glDrawElements);
- OVERRIDE(glGetIntegerv);
- OVERRIDE(glGetFloatv);
- OVERRIDE(glGetBooleanv);
- OVERRIDE(glVertexAttribPointer);
- OVERRIDE(glEnableVertexAttribArray);
- OVERRIDE(glDisableVertexAttribArray);
- OVERRIDE(glGetVertexAttribiv);
- OVERRIDE(glGetVertexAttribfv);
- OVERRIDE(glGetVertexAttribPointerv);
-
- this->glShaderBinary = &s_glShaderBinary;
- this->glShaderSource = &s_glShaderSource;
- this->glFinish = &s_glFinish;
-
- OVERRIDE(glGetError);
- OVERRIDE(glLinkProgram);
- OVERRIDE(glDeleteProgram);
- OVERRIDE(glGetUniformiv);
- OVERRIDE(glGetUniformfv);
- OVERRIDE(glCreateProgram);
- OVERRIDE(glCreateShader);
- OVERRIDE(glDeleteShader);
- OVERRIDE(glAttachShader);
- OVERRIDE(glDetachShader);
- OVERRIDE(glGetAttachedShaders);
- OVERRIDE(glGetShaderSource);
- OVERRIDE(glGetShaderInfoLog);
- OVERRIDE(glGetProgramInfoLog);
-
- OVERRIDE(glGetUniformLocation);
- OVERRIDE(glUseProgram);
-
- OVERRIDE(glUniform1f);
- OVERRIDE(glUniform1fv);
- OVERRIDE(glUniform1i);
- OVERRIDE(glUniform1iv);
- OVERRIDE(glUniform2f);
- OVERRIDE(glUniform2fv);
- OVERRIDE(glUniform2i);
- OVERRIDE(glUniform2iv);
- OVERRIDE(glUniform3f);
- OVERRIDE(glUniform3fv);
- OVERRIDE(glUniform3i);
- OVERRIDE(glUniform3iv);
- OVERRIDE(glUniform4f);
- OVERRIDE(glUniform4fv);
- OVERRIDE(glUniform4i);
- OVERRIDE(glUniform4iv);
- OVERRIDE(glUniformMatrix2fv);
- OVERRIDE(glUniformMatrix3fv);
- OVERRIDE(glUniformMatrix4fv);
-
- OVERRIDE(glActiveTexture);
- OVERRIDE(glBindTexture);
- OVERRIDE(glDeleteTextures);
- OVERRIDE(glGetTexParameterfv);
- OVERRIDE(glGetTexParameteriv);
- OVERRIDE(glTexParameterf);
- OVERRIDE(glTexParameterfv);
- OVERRIDE(glTexParameteri);
- OVERRIDE(glTexParameteriv);
- OVERRIDE(glTexImage2D);
- OVERRIDE(glTexSubImage2D);
-}
-
-GL2Encoder::~GL2Encoder()
-{
- delete m_compressedTextureFormats;
-}
-
-GLenum GL2Encoder::s_glGetError(void * self)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- GLenum err = ctx->getError();
- if(err != GL_NO_ERROR) {
- ctx->setError(GL_NO_ERROR);
- return err;
- }
-
- return ctx->m_glGetError_enc(self);
-
-}
-
-void GL2Encoder::s_glFlush(void *self)
-{
- GL2Encoder *ctx = (GL2Encoder *) self;
- ctx->m_glFlush_enc(self);
- ctx->m_stream->flush();
-}
-
-const GLubyte *GL2Encoder::s_glGetString(void *self, GLenum name)
-{
- (void)self;
-
- GLubyte *retval = (GLubyte *) "";
- switch(name) {
- case GL_VENDOR:
- retval = gVendorString;
- break;
- case GL_RENDERER:
- retval = gRendererString;
- break;
- case GL_VERSION:
- retval = gVersionString;
- break;
- case GL_EXTENSIONS:
- retval = gExtensionsString;
- break;
- }
- return retval;
-}
-
-void GL2Encoder::s_glPixelStorei(void *self, GLenum param, GLint value)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- ctx->m_glPixelStorei_enc(ctx, param, value);
- assert(ctx->m_state != NULL);
- ctx->m_state->setPixelStore(param, value);
-}
-
-
-void GL2Encoder::s_glBindBuffer(void *self, GLenum target, GLuint id)
-{
- GL2Encoder *ctx = (GL2Encoder *) self;
- assert(ctx->m_state != NULL);
- ctx->m_state->bindBuffer(target, id);
- // TODO set error state if needed;
- ctx->m_glBindBuffer_enc(self, target, id);
-}
-
-void GL2Encoder::s_glBufferData(void * self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage)
-{
- GL2Encoder *ctx = (GL2Encoder *) self;
- SET_ERROR_IF(!(target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER), GL_INVALID_ENUM);
- GLuint bufferId = ctx->m_state->getBuffer(target);
- SET_ERROR_IF(bufferId==0, GL_INVALID_OPERATION);
- SET_ERROR_IF(size<0, GL_INVALID_VALUE);
-
- ctx->m_shared->updateBufferData(bufferId, size, (void*)data);
- ctx->m_glBufferData_enc(self, target, size, data, usage);
-}
-
-void GL2Encoder::s_glBufferSubData(void * self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data)
-{
- GL2Encoder *ctx = (GL2Encoder *) self;
- SET_ERROR_IF(!(target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER), GL_INVALID_ENUM);
- GLuint bufferId = ctx->m_state->getBuffer(target);
- SET_ERROR_IF(bufferId==0, GL_INVALID_OPERATION);
-
- GLenum res = ctx->m_shared->subUpdateBufferData(bufferId, offset, size, (void*)data);
- SET_ERROR_IF(res, res);
-
- ctx->m_glBufferSubData_enc(self, target, offset, size, data);
-}
-
-void GL2Encoder::s_glDeleteBuffers(void * self, GLsizei n, const GLuint * buffers)
-{
- GL2Encoder *ctx = (GL2Encoder *) self;
- SET_ERROR_IF(n<0, GL_INVALID_VALUE);
- for (int i=0; i<n; i++) {
- ctx->m_shared->deleteBufferData(buffers[i]);
- ctx->m_state->unBindBuffer(buffers[i]);
- ctx->m_glDeleteBuffers_enc(self,1,&buffers[i]);
- }
-}
-
-void GL2Encoder::s_glVertexAttribPointer(void *self, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * ptr)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- assert(ctx->m_state != NULL);
- ctx->m_state->setState(indx, size, type, normalized, stride, ptr);
-}
-
-void GL2Encoder::s_glGetIntegerv(void *self, GLenum param, GLint *ptr)
-{
- GL2Encoder *ctx = (GL2Encoder *) self;
- assert(ctx->m_state != NULL);
- GLClientState* state = ctx->m_state;
-
- switch (param) {
- case GL_NUM_SHADER_BINARY_FORMATS:
- *ptr = 0;
- break;
- case GL_SHADER_BINARY_FORMATS:
- // do nothing
- break;
-
- case GL_COMPRESSED_TEXTURE_FORMATS: {
- GLint *compressedTextureFormats = ctx->getCompressedTextureFormats();
- if (ctx->m_num_compressedTextureFormats > 0 &&
- compressedTextureFormats != NULL) {
- memcpy(ptr, compressedTextureFormats,
- ctx->m_num_compressedTextureFormats * sizeof(GLint));
- }
- break;
- }
-
- case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
- case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
- case GL_MAX_TEXTURE_IMAGE_UNITS:
- ctx->m_glGetIntegerv_enc(self, param, ptr);
- *ptr = MIN(*ptr, GLClientState::MAX_TEXTURE_UNITS);
- break;
-
- case GL_TEXTURE_BINDING_2D:
- *ptr = state->getBoundTexture(GL_TEXTURE_2D);
- break;
- case GL_TEXTURE_BINDING_EXTERNAL_OES:
- *ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES);
- break;
-
- case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
- if (ctx->m_max_cubeMapTextureSize != 0) {
- *ptr = ctx->m_max_cubeMapTextureSize;
- } else {
- ctx->m_glGetIntegerv_enc(self, param, ptr);
- ctx->m_max_cubeMapTextureSize = *ptr;
- }
- break;
- case GL_MAX_RENDERBUFFER_SIZE:
- if (ctx->m_max_renderBufferSize != 0) {
- *ptr = ctx->m_max_renderBufferSize;
- } else {
- ctx->m_glGetIntegerv_enc(self, param, ptr);
- ctx->m_max_renderBufferSize = *ptr;
- }
- break;
- case GL_MAX_TEXTURE_SIZE:
- if (ctx->m_max_textureSize != 0) {
- *ptr = ctx->m_max_textureSize;
- } else {
- ctx->m_glGetIntegerv_enc(self, param, ptr);
- ctx->m_max_textureSize = *ptr;
- }
- break;
- case GL_MAX_VERTEX_ATTRIBS:
- if (!ctx->m_state->getClientStateParameter<GLint>(param, ptr)) {
- ctx->m_glGetIntegerv_enc(self, param, ptr);
- ctx->m_state->setMaxVertexAttribs(*ptr);
- }
- break;
- default:
- if (!ctx->m_state->getClientStateParameter<GLint>(param, ptr)) {
- ctx->m_glGetIntegerv_enc(self, param, ptr);
- }
- break;
- }
-}
-
-
-void GL2Encoder::s_glGetFloatv(void *self, GLenum param, GLfloat *ptr)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- assert(ctx->m_state != NULL);
- GLClientState* state = ctx->m_state;
-
- switch (param) {
- case GL_NUM_SHADER_BINARY_FORMATS:
- *ptr = 0;
- break;
- case GL_SHADER_BINARY_FORMATS:
- // do nothing
- break;
-
- case GL_COMPRESSED_TEXTURE_FORMATS: {
- GLint *compressedTextureFormats = ctx->getCompressedTextureFormats();
- if (ctx->m_num_compressedTextureFormats > 0 &&
- compressedTextureFormats != NULL) {
- for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
- ptr[i] = (GLfloat) compressedTextureFormats[i];
- }
- }
- break;
- }
-
- case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
- case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
- case GL_MAX_TEXTURE_IMAGE_UNITS:
- ctx->m_glGetFloatv_enc(self, param, ptr);
- *ptr = MIN(*ptr, (GLfloat)GLClientState::MAX_TEXTURE_UNITS);
- break;
-
- case GL_TEXTURE_BINDING_2D:
- *ptr = (GLfloat)state->getBoundTexture(GL_TEXTURE_2D);
- break;
- case GL_TEXTURE_BINDING_EXTERNAL_OES:
- *ptr = (GLfloat)state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES);
- break;
-
- default:
- if (!ctx->m_state->getClientStateParameter<GLfloat>(param, ptr)) {
- ctx->m_glGetFloatv_enc(self, param, ptr);
- }
- break;
- }
-}
-
-
-void GL2Encoder::s_glGetBooleanv(void *self, GLenum param, GLboolean *ptr)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- assert(ctx->m_state != NULL);
- GLClientState* state = ctx->m_state;
-
- switch (param) {
- case GL_NUM_SHADER_BINARY_FORMATS:
- *ptr = GL_FALSE;
- break;
- case GL_SHADER_BINARY_FORMATS:
- // do nothing
- break;
-
- case GL_COMPRESSED_TEXTURE_FORMATS: {
- GLint *compressedTextureFormats = ctx->getCompressedTextureFormats();
- if (ctx->m_num_compressedTextureFormats > 0 &&
- compressedTextureFormats != NULL) {
- for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
- ptr[i] = compressedTextureFormats[i] != 0 ? GL_TRUE : GL_FALSE;
- }
- }
- break;
- }
-
- case GL_TEXTURE_BINDING_2D:
- *ptr = state->getBoundTexture(GL_TEXTURE_2D) != 0 ? GL_TRUE : GL_FALSE;
- break;
- case GL_TEXTURE_BINDING_EXTERNAL_OES:
- *ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES) != 0
- ? GL_TRUE : GL_FALSE;
- break;
-
- default:
- if (!ctx->m_state->getClientStateParameter<GLboolean>(param, ptr)) {
- ctx->m_glGetBooleanv_enc(self, param, ptr);
- }
- *ptr = (*ptr != 0) ? GL_TRUE : GL_FALSE;
- break;
- }
-}
-
-
-void GL2Encoder::s_glEnableVertexAttribArray(void *self, GLuint index)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- assert(ctx->m_state);
- GLint maxIndex;
- ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex);
- SET_ERROR_IF(!(index < maxIndex), GL_INVALID_VALUE);
- ctx->m_state->enable(index, 1);
-}
-
-void GL2Encoder::s_glDisableVertexAttribArray(void *self, GLuint index)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- assert(ctx->m_state);
- GLint maxIndex;
- ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex);
- SET_ERROR_IF(!(index < maxIndex), GL_INVALID_VALUE);
- ctx->m_state->enable(index, 0);
-}
-
-
-void GL2Encoder::s_glGetVertexAttribiv(void *self, GLuint index, GLenum pname, GLint *params)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- assert(ctx->m_state);
- GLint maxIndex;
- ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex);
- SET_ERROR_IF(!(index < maxIndex), GL_INVALID_VALUE);
-
- if (!ctx->m_state->getVertexAttribParameter<GLint>(index, pname, params)) {
- ctx->m_glGetVertexAttribiv_enc(self, index, pname, params);
- }
-}
-
-void GL2Encoder::s_glGetVertexAttribfv(void *self, GLuint index, GLenum pname, GLfloat *params)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- assert(ctx->m_state);
- GLint maxIndex;
- ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex);
- SET_ERROR_IF(!(index < maxIndex), GL_INVALID_VALUE);
-
- if (!ctx->m_state->getVertexAttribParameter<GLfloat>(index, pname, params)) {
- ctx->m_glGetVertexAttribfv_enc(self, index, pname, params);
- }
-}
-
-void GL2Encoder::s_glGetVertexAttribPointerv(void *self, GLuint index, GLenum pname, GLvoid **pointer)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- if (ctx->m_state == NULL) return;
- GLint maxIndex;
- ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex);
- SET_ERROR_IF(!(index < maxIndex), GL_INVALID_VALUE);
- SET_ERROR_IF(pname != GL_VERTEX_ATTRIB_ARRAY_POINTER, GL_INVALID_ENUM);
-
- (void)pname;
-
- const GLClientState::VertexAttribState *va_state = ctx->m_state->getState(index);
- if (va_state != NULL) {
- *pointer = va_state->data;
- }
-}
-
-
-void GL2Encoder::sendVertexAttributes(GLint first, GLsizei count)
-{
- assert(m_state);
-
- for (int i = 0; i < m_state->nLocations(); i++) {
- bool enableDirty;
- const GLClientState::VertexAttribState *state = m_state->getStateAndEnableDirty(i, &enableDirty);
-
- if (!state) {
- continue;
- }
-
- if (!enableDirty && !state->enabled) {
- continue;
- }
-
-
- if (state->enabled) {
- m_glEnableVertexAttribArray_enc(this, i);
-
- unsigned int datalen = state->elementSize * count;
- int stride = state->stride == 0 ? state->elementSize : state->stride;
- int firstIndex = stride * first;
-
- this->m_glBindBuffer_enc(this, GL_ARRAY_BUFFER, state->bufferObject);
- if (state->bufferObject == 0) {
- this->glVertexAttribPointerData(this, i, state->size, state->type, state->normalized, state->stride,
- (unsigned char *)state->data + firstIndex, datalen);
- } else {
- this->glVertexAttribPointerOffset(this, i, state->size, state->type, state->normalized, state->stride,
- (uintptr_t) state->data + firstIndex);
- }
- this->m_glBindBuffer_enc(this, GL_ARRAY_BUFFER, m_state->currentArrayVbo());
- } else {
- this->m_glDisableVertexAttribArray_enc(this, i);
- }
- }
-}
-
-static bool isValidDrawMode(GLenum mode) {
- switch(mode) {
- case GL_POINTS:
- case GL_LINE_STRIP:
- case GL_LINE_LOOP:
- case GL_LINES:
- case GL_TRIANGLE_STRIP:
- case GL_TRIANGLE_FAN:
- case GL_TRIANGLES:
- return true;
- }
- return false;
-}
-
-static bool isValidDrawType(GLenum mode) {
- return mode == GL_UNSIGNED_BYTE ||
- mode == GL_UNSIGNED_SHORT ||
- mode == GL_UNSIGNED_INT;
-}
-
-void GL2Encoder::s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
-
- SET_ERROR_IF(!isValidDrawMode(mode), GL_INVALID_ENUM);
- SET_ERROR_IF(count<0, GL_INVALID_VALUE);
-
- bool has_arrays = false;
- int nLocations = ctx->m_state->nLocations();
- for (int i = 0; i < nLocations; i++) {
- const GLClientState::VertexAttribState *state = ctx->m_state->getState(i);
- if (state->enabled) {
- if (state->bufferObject || state->data) {
- has_arrays = true;
- }
- else {
- ALOGE("glDrawArrays: a vertex attribute array is enabled with no data bound\n");
- ctx->setError(GL_INVALID_OPERATION);
- return;
- }
- }
- }
- if (!has_arrays) {
- ALOGE("glDrawArrays: no data bound to the command - ignoring\n");
- return;
- }
-
- ctx->sendVertexAttributes(first, count);
- ctx->m_glDrawArrays_enc(ctx, mode, 0, count);
-}
-
-void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices)
-{
-
- GL2Encoder *ctx = (GL2Encoder *)self;
- assert(ctx->m_state != NULL);
- SET_ERROR_IF(!(isValidDrawMode(mode) && isValidDrawType(type)),GL_INVALID_ENUM);
- SET_ERROR_IF(count<0, GL_INVALID_VALUE);
-
- bool has_immediate_arrays = false;
- bool has_indirect_arrays = false;
- int nLocations = ctx->m_state->nLocations();
-
- for (int i = 0; i < nLocations; i++) {
- const GLClientState::VertexAttribState *state = ctx->m_state->getState(i);
- if (state->enabled) {
- if (state->bufferObject != 0) {
- has_indirect_arrays = true;
- } else if (state->data) {
- has_immediate_arrays = true;
- } else {
- ALOGW("glDrawElements: a vertex attribute array is enabled with no data bound\n");
- ctx->setError(GL_INVALID_OPERATION);
- return;
- }
- }
- }
-
- if (!has_immediate_arrays && !has_indirect_arrays) {
- ALOGE("glDrawElements: no data bound to the command - ignoring\n");
- return;
- }
-
- bool adjustIndices = true;
- if (ctx->m_state->currentIndexVbo() != 0) {
- if (!has_immediate_arrays) {
- ctx->sendVertexAttributes(0, count);
- ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo());
- ctx->glDrawElementsOffset(ctx, mode, count, type, (uintptr_t)indices);
- adjustIndices = false;
- } else {
- BufferData * buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo());
- ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, 0);
- indices = (void*)((GLintptr)buf->m_fixedBuffer.ptr() + (GLintptr)indices);
- }
- }
- if (adjustIndices) {
- void *adjustedIndices = (void*)indices;
- int minIndex = 0, maxIndex = 0;
-
- switch(type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- GLUtils::minmax<unsigned char>((unsigned char *)indices, count, &minIndex, &maxIndex);
- if (minIndex != 0) {
- adjustedIndices = ctx->m_fixedBuffer.alloc(glSizeof(type) * count);
- GLUtils::shiftIndices<unsigned char>((unsigned char *)indices,
- (unsigned char *)adjustedIndices,
- count, -minIndex);
- }
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- GLUtils::minmax<unsigned short>((unsigned short *)indices, count, &minIndex, &maxIndex);
- if (minIndex != 0) {
- adjustedIndices = ctx->m_fixedBuffer.alloc(glSizeof(type) * count);
- GLUtils::shiftIndices<unsigned short>((unsigned short *)indices,
- (unsigned short *)adjustedIndices,
- count, -minIndex);
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- GLUtils::minmax<unsigned int>((unsigned int *)indices, count, &minIndex, &maxIndex);
- if (minIndex != 0) {
- adjustedIndices = ctx->m_fixedBuffer.alloc(glSizeof(type) * count);
- GLUtils::shiftIndices<unsigned int>((unsigned int *)indices,
- (unsigned int *)adjustedIndices,
- count, -minIndex);
- }
- break;
- default:
- ALOGE("unsupported index buffer type %d\n", type);
- }
- if (has_indirect_arrays || 1) {
- ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1);
- ctx->glDrawElementsData(ctx, mode, count, type, adjustedIndices,
- count * glSizeof(type));
- // XXX - OPTIMIZATION (see the other else branch) should be implemented
- if(!has_indirect_arrays) {
- //ALOGD("unoptimized drawelements !!!\n");
- }
- } else {
- // we are all direct arrays and immidate mode index array -
- // rebuild the arrays and the index array;
- ALOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
- }
- }
-}
-
-
-GLint * GL2Encoder::getCompressedTextureFormats()
-{
- if (m_compressedTextureFormats == NULL) {
- this->glGetIntegerv(this, GL_NUM_COMPRESSED_TEXTURE_FORMATS,
- &m_num_compressedTextureFormats);
- if (m_num_compressedTextureFormats > 0) {
- // get number of texture formats;
- m_compressedTextureFormats = new GLint[m_num_compressedTextureFormats];
- this->glGetCompressedTextureFormats(this, m_num_compressedTextureFormats, m_compressedTextureFormats);
- }
- }
- return m_compressedTextureFormats;
-}
-
-// Replace uses of samplerExternalOES with sampler2D, recording the names of
-// modified shaders in data. Also remove
-// #extension GL_OES_EGL_image_external : require
-// statements.
-//
-// This implementation assumes the input has already been pre-processed. If not,
-// a few cases will be mishandled:
-//
-// 1. "mySampler" will be incorrectly recorded as being a samplerExternalOES in
-// the following code:
-// #if 1
-// uniform sampler2D mySampler;
-// #else
-// uniform samplerExternalOES mySampler;
-// #endif
-//
-// 2. Comments that look like sampler declarations will be incorrectly modified
-// and recorded:
-// // samplerExternalOES hahaFooledYou
-//
-// 3. However, GLSL ES does not have a concatentation operator, so things like
-// this (valid in C) are invalid and not a problem:
-// #define SAMPLER(TYPE, NAME) uniform sampler#TYPE NAME
-// SAMPLER(ExternalOES, mySampler);
-//
-static bool replaceSamplerExternalWith2D(char* const str, ShaderData* const data)
-{
- static const char STR_HASH_EXTENSION[] = "#extension";
- static const char STR_GL_OES_EGL_IMAGE_EXTERNAL[] = "GL_OES_EGL_image_external";
- static const char STR_SAMPLER_EXTERNAL_OES[] = "samplerExternalOES";
- static const char STR_SAMPLER2D_SPACE[] = "sampler2D ";
-
- // -- overwrite all "#extension GL_OES_EGL_image_external : xxx" statements
- char* c = str;
- while ((c = strstr(c, STR_HASH_EXTENSION))) {
- char* start = c;
- c += sizeof(STR_HASH_EXTENSION)-1;
- while (isspace(*c) && *c != '\0') {
- c++;
- }
- if (strncmp(c, STR_GL_OES_EGL_IMAGE_EXTERNAL,
- sizeof(STR_GL_OES_EGL_IMAGE_EXTERNAL)-1) == 0)
- {
- // #extension statements are terminated by end of line
- c = start;
- while (*c != '\0' && *c != '\r' && *c != '\n') {
- *c++ = ' ';
- }
- }
- }
-
- // -- replace "samplerExternalOES" with "sampler2D" and record name
- c = str;
- while ((c = strstr(c, STR_SAMPLER_EXTERNAL_OES))) {
- // Make sure "samplerExternalOES" isn't a substring of a larger token
- if (c == str || !isspace(*(c-1))) {
- c++;
- continue;
- }
- char* sampler_start = c;
- c += sizeof(STR_SAMPLER_EXTERNAL_OES)-1;
- if (!isspace(*c) && *c != '\0') {
- continue;
- }
-
- // capture sampler name
- while (isspace(*c) && *c != '\0') {
- c++;
- }
- if (!isalpha(*c) && *c != '_') {
- // not an identifier
- return false;
- }
- char* name_start = c;
- do {
- c++;
- } while (isalnum(*c) || *c == '_');
- data->samplerExternalNames.push_back(
- android::String8(name_start, c - name_start));
-
- // memcpy instead of strcpy since we don't want the NUL terminator
- memcpy(sampler_start, STR_SAMPLER2D_SPACE, sizeof(STR_SAMPLER2D_SPACE)-1);
- }
-
- return true;
-}
-
-void GL2Encoder::s_glShaderBinary(void *self, GLsizei n, const GLuint *shaders, GLenum binaryformat, const void* binary, GLsizei length)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- // Although it is not supported, need to set proper error code.
- SET_ERROR_IF(1, GL_INVALID_ENUM);
-}
-
-void GL2Encoder::s_glShaderSource(void *self, GLuint shader, GLsizei count, const GLchar * const *string, const GLint *length)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- ShaderData* shaderData = ctx->m_shared->getShaderData(shader);
- SET_ERROR_IF(!ctx->m_shared->isObject(shader), GL_INVALID_VALUE);
- SET_ERROR_IF(!shaderData, GL_INVALID_OPERATION);
- SET_ERROR_IF((count<0), GL_INVALID_VALUE);
-
- int len = glUtilsCalcShaderSourceLen((char**)string, (GLint*)length, count);
- char *str = new char[len + 1];
- glUtilsPackStrings(str, (char**)string, (GLint*)length, count);
-
- // TODO: pre-process str before calling replaceSamplerExternalWith2D().
- // Perhaps we can borrow Mesa's pre-processor?
-
- if (!replaceSamplerExternalWith2D(str, shaderData)) {
- delete str;
- ctx->setError(GL_OUT_OF_MEMORY);
- return;
- }
-
- ctx->glShaderString(ctx, shader, str, len + 1);
- delete str;
-}
-
-void GL2Encoder::s_glFinish(void *self)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- ctx->glFinishRoundTrip(self);
-}
-
-void GL2Encoder::s_glLinkProgram(void * self, GLuint program)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- ctx->m_glLinkProgram_enc(self, program);
-
- GLint linkStatus = 0;
- ctx->glGetProgramiv(self,program,GL_LINK_STATUS,&linkStatus);
- if (!linkStatus)
- return;
-
- //get number of active uniforms in the program
- GLint numUniforms=0;
- ctx->glGetProgramiv(self, program, GL_ACTIVE_UNIFORMS, &numUniforms);
- ctx->m_shared->initProgramData(program,numUniforms);
-
- //get the length of the longest uniform name
- GLint maxLength=0;
- ctx->glGetProgramiv(self, program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxLength);
-
- GLint size;
- GLenum type;
- GLchar *name = new GLchar[maxLength+1];
- GLint location;
- //for each active uniform, get its size and starting location.
- for (GLint i=0 ; i<numUniforms ; ++i)
- {
- ctx->glGetActiveUniform(self, program, i, maxLength, NULL, &size, &type, name);
- location = ctx->m_glGetUniformLocation_enc(self, program, name);
- ctx->m_shared->setProgramIndexInfo(program, i, location, size, type, name);
- }
- ctx->m_shared->setupLocationShiftWAR(program);
-
- delete[] name;
-}
-
-void GL2Encoder::s_glDeleteProgram(void *self, GLuint program)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- ctx->m_glDeleteProgram_enc(self, program);
-
- ctx->m_shared->deleteProgramData(program);
-}
-
-void GL2Encoder::s_glGetUniformiv(void *self, GLuint program, GLint location, GLint* params)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- SET_ERROR_IF(!ctx->m_shared->isObject(program), GL_INVALID_VALUE);
- SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION);
- SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION);
- GLint hostLoc = ctx->m_shared->locationWARAppToHost(program, location);
- SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,hostLoc)==0, GL_INVALID_OPERATION);
- ctx->m_glGetUniformiv_enc(self, program, hostLoc, params);
-}
-void GL2Encoder::s_glGetUniformfv(void *self, GLuint program, GLint location, GLfloat* params)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- SET_ERROR_IF(!ctx->m_shared->isObject(program), GL_INVALID_VALUE);
- SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION);
- SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION);
- GLint hostLoc = ctx->m_shared->locationWARAppToHost(program,location);
- SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,hostLoc)==0, GL_INVALID_OPERATION);
- ctx->m_glGetUniformfv_enc(self, program, hostLoc, params);
-}
-
-GLuint GL2Encoder::s_glCreateProgram(void * self)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLuint program = ctx->m_glCreateProgram_enc(self);
- if (program!=0)
- ctx->m_shared->addProgramData(program);
- return program;
-}
-
-GLuint GL2Encoder::s_glCreateShader(void *self, GLenum shaderType)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- RET_AND_SET_ERROR_IF(((shaderType != GL_VERTEX_SHADER) && (shaderType != GL_FRAGMENT_SHADER)),
- GL_INVALID_ENUM, 0);
- GLuint shader = ctx->m_glCreateShader_enc(self, shaderType);
- if (shader != 0) {
- if (!ctx->m_shared->addShaderData(shader)) {
- ctx->m_glDeleteShader_enc(self, shader);
- return 0;
- }
- }
- return shader;
-}
-
-void GL2Encoder::s_glGetAttachedShaders(void *self, GLuint program, GLsizei maxCount,
- GLsizei* count, GLuint* shaders)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- SET_ERROR_IF(maxCount < 0, GL_INVALID_VALUE);
- ctx->m_glGetAttachedShaders_enc(self, program, maxCount, count, shaders);
-}
-
-void GL2Encoder::s_glGetShaderSource(void *self, GLuint shader, GLsizei bufsize,
- GLsizei* length, GLchar* source)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- SET_ERROR_IF(bufsize < 0, GL_INVALID_VALUE);
- ctx->m_glGetShaderSource_enc(self, shader, bufsize, length, source);
-}
-
-void GL2Encoder::s_glGetShaderInfoLog(void *self, GLuint shader, GLsizei bufsize,
- GLsizei* length, GLchar* infolog)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- SET_ERROR_IF(bufsize < 0, GL_INVALID_VALUE);
- ctx->m_glGetShaderInfoLog_enc(self, shader, bufsize, length, infolog);
-}
-
-void GL2Encoder::s_glGetProgramInfoLog(void *self, GLuint program, GLsizei bufsize,
- GLsizei* length, GLchar* infolog)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- SET_ERROR_IF(bufsize < 0, GL_INVALID_VALUE);
- ctx->m_glGetProgramInfoLog_enc(self, program, bufsize, length, infolog);
-}
-
-void GL2Encoder::s_glDeleteShader(void *self, GLenum shader)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- ctx->m_glDeleteShader_enc(self,shader);
- ctx->m_shared->unrefShaderData(shader);
-}
-
-void GL2Encoder::s_glAttachShader(void *self, GLuint program, GLuint shader)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- ctx->m_glAttachShader_enc(self, program, shader);
- ctx->m_shared->attachShader(program, shader);
-}
-
-void GL2Encoder::s_glDetachShader(void *self, GLuint program, GLuint shader)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- ctx->m_glDetachShader_enc(self, program, shader);
- ctx->m_shared->detachShader(program, shader);
-}
-
-int GL2Encoder::s_glGetUniformLocation(void *self, GLuint program, const GLchar *name)
-{
- if (!name) return -1;
-
- GL2Encoder *ctx = (GL2Encoder*)self;
-
- // if we need the uniform location WAR
- // parse array index from the end of the name string
- int arrIndex = 0;
- bool needLocationWAR = ctx->m_shared->needUniformLocationWAR(program);
- if (needLocationWAR) {
- int namelen = strlen(name);
- if (name[namelen-1] == ']') {
- char *brace = strrchr(name,'[');
- if (!brace || sscanf(brace+1,"%d",&arrIndex) != 1) {
- return -1;
- }
-
- }
- }
-
- int hostLoc = ctx->m_glGetUniformLocation_enc(self, program, name);
- if (hostLoc >= 0 && needLocationWAR) {
- return ctx->m_shared->locationWARHostToApp(program, hostLoc, arrIndex);
- }
- return hostLoc;
-}
-
-bool GL2Encoder::updateHostTexture2DBinding(GLenum texUnit, GLenum newTarget)
-{
- if (newTarget != GL_TEXTURE_2D && newTarget != GL_TEXTURE_EXTERNAL_OES)
- return false;
-
- m_state->setActiveTextureUnit(texUnit);
-
- GLenum oldTarget = m_state->getPriorityEnabledTarget(GL_TEXTURE_2D);
- if (newTarget != oldTarget) {
- if (newTarget == GL_TEXTURE_EXTERNAL_OES) {
- m_state->disableTextureTarget(GL_TEXTURE_2D);
- m_state->enableTextureTarget(GL_TEXTURE_EXTERNAL_OES);
- } else {
- m_state->disableTextureTarget(GL_TEXTURE_EXTERNAL_OES);
- m_state->enableTextureTarget(GL_TEXTURE_2D);
- }
- m_glActiveTexture_enc(this, texUnit);
- m_glBindTexture_enc(this, GL_TEXTURE_2D,
- m_state->getBoundTexture(newTarget));
- return true;
- }
-
- return false;
-}
-
-void GL2Encoder::s_glUseProgram(void *self, GLuint program)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLClientState* state = ctx->m_state;
- GLSharedGroupPtr shared = ctx->m_shared;
-
- ctx->m_glUseProgram_enc(self, program);
- ctx->m_state->setCurrentProgram(program);
-
- GLenum origActiveTexture = state->getActiveTextureUnit();
- GLenum hostActiveTexture = origActiveTexture;
- GLint samplerIdx = -1;
- GLint samplerVal;
- GLenum samplerTarget;
- while ((samplerIdx = shared->getNextSamplerUniform(program, samplerIdx, &samplerVal, &samplerTarget)) != -1) {
- if (samplerVal < 0 || samplerVal >= GLClientState::MAX_TEXTURE_UNITS)
- continue;
- if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + samplerVal,
- samplerTarget))
- {
- hostActiveTexture = GL_TEXTURE0 + samplerVal;
- }
- }
- state->setActiveTextureUnit(origActiveTexture);
- if (hostActiveTexture != origActiveTexture) {
- ctx->m_glActiveTexture_enc(self, origActiveTexture);
- }
-}
-
-void GL2Encoder::checkValidUniformParam(void *self, GLsizei count, GLboolean transpose)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLuint program = ctx->m_state->currentProgram();
- SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION);
- SET_ERROR_IF((count < 0 || transpose == GL_TRUE), GL_INVALID_VALUE);
-}
-
-void GL2Encoder::getHostLocation(void *self, GLint location, GLint *hostLoc)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLuint program = ctx->m_state->currentProgram();
- if (location == -1) {
- *hostLoc = location;
- return;
- }
- SET_ERROR_IF((location < 0), GL_INVALID_OPERATION);
- GLint curHostLoc = ctx->m_shared->locationWARAppToHost(program,location);
- SET_ERROR_IF((ctx->m_shared->getProgramUniformType(program,curHostLoc) == 0 &&
- curHostLoc!=-1), GL_INVALID_OPERATION);
- *hostLoc = curHostLoc;
-}
-
-void GL2Encoder::s_glUniform1f(void *self , GLint location, GLfloat x)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, 0, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform1f_enc(self, hostLoc, x);
-}
-
-void GL2Encoder::s_glUniform1fv(void *self , GLint location, GLsizei count, const GLfloat* v)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform1fv_enc(self, hostLoc, count, v);
-}
-
-void GL2Encoder::s_glUniform1i(void *self , GLint location, GLint x)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLClientState* state = ctx->m_state;
- GLSharedGroupPtr shared = ctx->m_shared;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, 0, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform1i_enc(self, hostLoc, x);
-
- GLenum target;
- if (shared->setSamplerUniform(state->currentProgram(), location, x, &target)) {
- GLenum origActiveTexture = state->getActiveTextureUnit();
- if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + x, target)) {
- ctx->m_glActiveTexture_enc(self, origActiveTexture);
- }
- state->setActiveTextureUnit(origActiveTexture);
- }
-}
-
-void GL2Encoder::s_glUniform1iv(void *self , GLint location, GLsizei count, const GLint* v)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform1iv_enc(self, hostLoc, count, v);
-}
-
-void GL2Encoder::s_glUniform2f(void *self , GLint location, GLfloat x, GLfloat y)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, 0, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform2f_enc(self, hostLoc, x, y);
-}
-
-void GL2Encoder::s_glUniform2fv(void *self , GLint location, GLsizei count, const GLfloat* v)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform2fv_enc(self, hostLoc, count, v);
-}
-
-void GL2Encoder::s_glUniform2i(void *self , GLint location, GLint x, GLint y)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, 0, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform2i_enc(self, hostLoc, x, y);
-}
-
-void GL2Encoder::s_glUniform2iv(void *self , GLint location, GLsizei count, const GLint* v)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform2iv_enc(self, hostLoc, count, v);
-}
-
-void GL2Encoder::s_glUniform3f(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, 0, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform3f_enc(self, hostLoc, x, y, z);
-}
-
-void GL2Encoder::s_glUniform3fv(void *self , GLint location, GLsizei count, const GLfloat* v)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform3fv_enc(self, hostLoc, count, v);
-}
-
-void GL2Encoder::s_glUniform3i(void *self , GLint location, GLint x, GLint y, GLint z)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, 0, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform3i_enc(self, hostLoc, x, y, z);
-}
-
-void GL2Encoder::s_glUniform3iv(void *self , GLint location, GLsizei count, const GLint* v)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform3iv_enc(self, hostLoc, count, v);
-}
-
-void GL2Encoder::s_glUniform4f(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, 0, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform4f_enc(self, hostLoc, x, y, z, w);
-}
-
-void GL2Encoder::s_glUniform4fv(void *self , GLint location, GLsizei count, const GLfloat* v)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform4fv_enc(self, hostLoc, count, v);
-}
-
-void GL2Encoder::s_glUniform4i(void *self , GLint location, GLint x, GLint y, GLint z, GLint w)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, 0, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform4i_enc(self, hostLoc, x, y, z, w);
-}
-
-void GL2Encoder::s_glUniform4iv(void *self , GLint location, GLsizei count, const GLint* v)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, GL_FALSE);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniform4iv_enc(self, hostLoc, count, v);
-}
-
-void GL2Encoder::s_glUniformMatrix2fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, transpose);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniformMatrix2fv_enc(self, hostLoc, count, transpose, value);
-}
-
-void GL2Encoder::s_glUniformMatrix3fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, transpose);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniformMatrix3fv_enc(self, hostLoc, count, transpose, value);
-}
-
-void GL2Encoder::s_glUniformMatrix4fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
- GL2Encoder *ctx = (GL2Encoder*)self;
- GLint hostLoc;
-
- ctx->checkValidUniformParam(self, count, transpose);
- ctx->getHostLocation(self, location, &hostLoc);
- ctx->m_glUniformMatrix4fv_enc(self, hostLoc, count, transpose, value);
-}
-
-void GL2Encoder::s_glActiveTexture(void* self, GLenum texture)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- GLClientState* state = ctx->m_state;
- GLenum err;
-
- SET_ERROR_IF((err = state->setActiveTextureUnit(texture)) != GL_NO_ERROR, err);
-
- ctx->m_glActiveTexture_enc(ctx, texture);
-}
-
-void GL2Encoder::s_glBindTexture(void* self, GLenum target, GLuint texture)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- GLClientState* state = ctx->m_state;
- GLenum err;
- GLboolean firstUse;
-
- SET_ERROR_IF((err = state->bindTexture(target, texture, &firstUse)) != GL_NO_ERROR, err);
-
- if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES) {
- ctx->m_glBindTexture_enc(ctx, target, texture);
- return;
- }
-
- GLenum priorityTarget = state->getPriorityEnabledTarget(GL_TEXTURE_2D);
-
- if (target == GL_TEXTURE_EXTERNAL_OES && firstUse) {
- ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
- ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
- GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
- GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
- GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- if (target != priorityTarget) {
- ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
- state->getBoundTexture(GL_TEXTURE_2D));
- }
- }
-
- if (target == priorityTarget) {
- ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
- }
-}
-
-void GL2Encoder::s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- GLClientState* state = ctx->m_state;
-
- state->deleteTextures(n, textures);
- ctx->m_glDeleteTextures_enc(ctx, n, textures);
-}
-
-void GL2Encoder::s_glGetTexParameterfv(void* self,
- GLenum target, GLenum pname, GLfloat* params)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- const GLClientState* state = ctx->m_state;
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glGetTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glGetTexParameterfv_enc(ctx, target, pname, params);
- }
-}
-
-void GL2Encoder::s_glGetTexParameteriv(void* self,
- GLenum target, GLenum pname, GLint* params)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- const GLClientState* state = ctx->m_state;
-
- switch (pname) {
- case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
- *params = 1;
- break;
-
- default:
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glGetTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glGetTexParameteriv_enc(ctx, target, pname, params);
- }
- break;
- }
-}
-
-static bool isValidTextureExternalParam(GLenum pname, GLenum param)
-{
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- return param == GL_NEAREST || param == GL_LINEAR;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- return param == GL_CLAMP_TO_EDGE;
-
- default:
- return true;
- }
-}
-
-void GL2Encoder::s_glTexParameterf(void* self,
- GLenum target, GLenum pname, GLfloat param)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- const GLClientState* state = ctx->m_state;
-
- SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
- !isValidTextureExternalParam(pname, (GLenum)param)),
- GL_INVALID_ENUM);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexParameterf_enc(ctx, GL_TEXTURE_2D, pname, param);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexParameterf_enc(ctx, target, pname, param);
- }
-}
-
-void GL2Encoder::s_glTexParameterfv(void* self,
- GLenum target, GLenum pname, const GLfloat* params)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- const GLClientState* state = ctx->m_state;
-
- SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
- !isValidTextureExternalParam(pname, (GLenum)params[0])),
- GL_INVALID_ENUM);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexParameterfv_enc(ctx, target, pname, params);
- }
-}
-
-void GL2Encoder::s_glTexParameteri(void* self,
- GLenum target, GLenum pname, GLint param)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- const GLClientState* state = ctx->m_state;
-
- SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
- !isValidTextureExternalParam(pname, (GLenum)param)),
- GL_INVALID_ENUM);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D, pname, param);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexParameteri_enc(ctx, target, pname, param);
- }
-}
-
-void GL2Encoder::s_glTexImage2D(void* self, GLenum target, GLint level,
- GLint internalformat, GLsizei width, GLsizei height, GLint border,
- GLenum format, GLenum type, const GLvoid* pixels)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexImage2D_enc(ctx, target, level, internalformat, width,
- height, border, format, type, pixels);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexImage2D_enc(ctx, target, level, internalformat, width,
- height, border, format, type, pixels);
- }
-}
-
-void GL2Encoder::s_glTexSubImage2D(void* self, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format,
- GLenum type, const GLvoid* pixels)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- GLint maxTextureSize;
- ctx->glGetIntegerv(self, GL_MAX_TEXTURE_SIZE, &maxTextureSize);
-
- SET_ERROR_IF((level < 0 || level > log2(maxTextureSize)), GL_INVALID_VALUE);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexSubImage2D_enc(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexSubImage2D_enc(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels);
- }
-}
-
-void GL2Encoder::s_glTexParameteriv(void* self,
- GLenum target, GLenum pname, const GLint* params)
-{
- GL2Encoder* ctx = (GL2Encoder*)self;
- const GLClientState* state = ctx->m_state;
-
- SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
- !isValidTextureExternalParam(pname, (GLenum)params[0])),
- GL_INVALID_ENUM);
-
- if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
- ctx->override2DTextureTarget(target);
- ctx->m_glTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
- ctx->restore2DTextureTarget();
- } else {
- ctx->m_glTexParameteriv_enc(ctx, target, pname, params);
- }
-}
-
-void GL2Encoder::override2DTextureTarget(GLenum target)
-{
- if ((target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) &&
- target != m_state->getPriorityEnabledTarget(GL_TEXTURE_2D)) {
- m_glBindTexture_enc(this, GL_TEXTURE_2D,
- m_state->getBoundTexture(target));
- }
-}
-
-void GL2Encoder::restore2DTextureTarget()
-{
- GLenum priorityTarget = m_state->getPriorityEnabledTarget(GL_TEXTURE_2D);
- m_glBindTexture_enc(this, GL_TEXTURE_2D,
- m_state->getBoundTexture(priorityTarget));
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _GL2_ENCODER_H_
-#define _GL2_ENCODER_H_
-
-#include "gl2_enc.h"
-#include "GLClientState.h"
-#include "GLSharedGroup.h"
-#include "FixedBuffer.h"
-
-class GL2Encoder : public gl2_encoder_context_t {
-public:
- GL2Encoder(IOStream *stream, ChecksumCalculator* protocol);
- virtual ~GL2Encoder();
- void setClientState(GLClientState *state) {
- m_state = state;
- }
- void setSharedGroup(GLSharedGroupPtr shared){ m_shared = shared; }
- const GLClientState *state() { return m_state; }
- const GLSharedGroupPtr shared() { return m_shared; }
- void flush() { m_stream->flush(); }
-
- void setInitialized(){ m_initialized = true; };
- bool isInitialized(){ return m_initialized; };
-
- virtual void setError(GLenum error){ m_error = error; };
- virtual GLenum getError() { return m_error; };
-
- void override2DTextureTarget(GLenum target);
- void restore2DTextureTarget();
-
-private:
-
- bool m_initialized;
- GLClientState *m_state;
- GLSharedGroupPtr m_shared;
- GLenum m_error;
-
- GLint *m_compressedTextureFormats;
- GLint m_num_compressedTextureFormats;
- GLint *getCompressedTextureFormats();
-
- GLint m_max_cubeMapTextureSize;
- GLint m_max_renderBufferSize;
- GLint m_max_textureSize;
- FixedBuffer m_fixedBuffer;
-
- void sendVertexAttributes(GLint first, GLsizei count);
- bool updateHostTexture2DBinding(GLenum texUnit, GLenum newTarget);
- void checkValidUniformParam(void * self, GLsizei count, GLboolean transpose);
- void getHostLocation(void *self, GLint location, GLint *hostLoc);
-
-
- glGetError_client_proc_t m_glGetError_enc;
- static GLenum s_glGetError(void * self);
-
- glFlush_client_proc_t m_glFlush_enc;
- static void s_glFlush(void * self);
-
- glPixelStorei_client_proc_t m_glPixelStorei_enc;
- static void s_glPixelStorei(void *self, GLenum param, GLint value);
-
- glGetString_client_proc_t m_glGetString_enc;
- static const GLubyte * s_glGetString(void *self, GLenum name);
-
- glBindBuffer_client_proc_t m_glBindBuffer_enc;
- static void s_glBindBuffer(void *self, GLenum target, GLuint id);
-
-
- glBufferData_client_proc_t m_glBufferData_enc;
- static void s_glBufferData(void *self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
- glBufferSubData_client_proc_t m_glBufferSubData_enc;
- static void s_glBufferSubData(void *self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
- glDeleteBuffers_client_proc_t m_glDeleteBuffers_enc;
- static void s_glDeleteBuffers(void *self, GLsizei n, const GLuint * buffers);
-
- glDrawArrays_client_proc_t m_glDrawArrays_enc;
- static void s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count);
-
- glDrawElements_client_proc_t m_glDrawElements_enc;
- static void s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices);
-
-
- glGetIntegerv_client_proc_t m_glGetIntegerv_enc;
- static void s_glGetIntegerv(void *self, GLenum pname, GLint *ptr);
-
- glGetFloatv_client_proc_t m_glGetFloatv_enc;
- static void s_glGetFloatv(void *self, GLenum pname, GLfloat *ptr);
-
- glGetBooleanv_client_proc_t m_glGetBooleanv_enc;
- static void s_glGetBooleanv(void *self, GLenum pname, GLboolean *ptr);
-
- glVertexAttribPointer_client_proc_t m_glVertexAttribPointer_enc;
- static void s_glVertexAttribPointer(void *self, GLuint indx, GLint size, GLenum type,
- GLboolean normalized, GLsizei stride, const GLvoid * ptr);
-
- glEnableVertexAttribArray_client_proc_t m_glEnableVertexAttribArray_enc;
- static void s_glEnableVertexAttribArray(void *self, GLuint index);
-
- glDisableVertexAttribArray_client_proc_t m_glDisableVertexAttribArray_enc;
- static void s_glDisableVertexAttribArray(void *self, GLuint index);
-
- glGetVertexAttribiv_client_proc_t m_glGetVertexAttribiv_enc;
- static void s_glGetVertexAttribiv(void *self, GLuint index, GLenum pname, GLint *params);
-
- glGetVertexAttribfv_client_proc_t m_glGetVertexAttribfv_enc;
- static void s_glGetVertexAttribfv(void *self, GLuint index, GLenum pname, GLfloat *params);
-
- glGetVertexAttribPointerv_client_proc_t m_glGetVertexAttribPointerv_enc;
- static void s_glGetVertexAttribPointerv(void *self, GLuint index, GLenum pname, GLvoid **pointer);
-
- static void s_glShaderBinary(void *self, GLsizei n, const GLuint *shaders, GLenum binaryformat, const void* binary, GLsizei length);
-
- static void s_glShaderSource(void *self, GLuint shader, GLsizei count, const GLchar * const *string, const GLint *length);
-
- static void s_glFinish(void *self);
-
- glLinkProgram_client_proc_t m_glLinkProgram_enc;
- static void s_glLinkProgram(void *self, GLuint program);
-
- glDeleteProgram_client_proc_t m_glDeleteProgram_enc;
- static void s_glDeleteProgram(void * self, GLuint program);
-
- glGetUniformiv_client_proc_t m_glGetUniformiv_enc;
- static void s_glGetUniformiv(void *self, GLuint program, GLint location , GLint *params);
-
- glGetUniformfv_client_proc_t m_glGetUniformfv_enc;
- static void s_glGetUniformfv(void *self, GLuint program, GLint location , GLfloat *params);
-
- glCreateProgram_client_proc_t m_glCreateProgram_enc;
- static GLuint s_glCreateProgram(void *self);
-
- glCreateShader_client_proc_t m_glCreateShader_enc;
- static GLuint s_glCreateShader(void *self, GLenum shaderType);
-
- glDeleteShader_client_proc_t m_glDeleteShader_enc;
- static void s_glDeleteShader(void *self, GLuint shader);
-
- glAttachShader_client_proc_t m_glAttachShader_enc;
- static void s_glAttachShader(void *self, GLuint program, GLuint shader);
-
- glDetachShader_client_proc_t m_glDetachShader_enc;
- static void s_glDetachShader(void *self, GLuint program, GLuint shader);
-
- glGetAttachedShaders_client_proc_t m_glGetAttachedShaders_enc;
- static void s_glGetAttachedShaders(void *self, GLuint program, GLsizei maxCount,
- GLsizei* count, GLuint* shaders);
-
- glGetShaderSource_client_proc_t m_glGetShaderSource_enc;
- static void s_glGetShaderSource(void *self, GLuint shader, GLsizei bufsize,
- GLsizei* length, GLchar* source);
-
- glGetShaderInfoLog_client_proc_t m_glGetShaderInfoLog_enc;
- static void s_glGetShaderInfoLog(void *self,GLuint shader,
- GLsizei bufsize, GLsizei* length, GLchar* infolog);
-
- glGetProgramInfoLog_client_proc_t m_glGetProgramInfoLog_enc;
- static void s_glGetProgramInfoLog(void *self,GLuint program,
- GLsizei bufsize, GLsizei* length, GLchar* infolog);
-
- glGetUniformLocation_client_proc_t m_glGetUniformLocation_enc;
- static int s_glGetUniformLocation(void *self, GLuint program, const GLchar *name);
- glUseProgram_client_proc_t m_glUseProgram_enc;
-
- glUniform1f_client_proc_t m_glUniform1f_enc;
- glUniform1fv_client_proc_t m_glUniform1fv_enc;
- glUniform1i_client_proc_t m_glUniform1i_enc;
- glUniform1iv_client_proc_t m_glUniform1iv_enc;
- glUniform2f_client_proc_t m_glUniform2f_enc;
- glUniform2fv_client_proc_t m_glUniform2fv_enc;
- glUniform2i_client_proc_t m_glUniform2i_enc;
- glUniform2iv_client_proc_t m_glUniform2iv_enc;
- glUniform3f_client_proc_t m_glUniform3f_enc;
- glUniform3fv_client_proc_t m_glUniform3fv_enc;
- glUniform3i_client_proc_t m_glUniform3i_enc;
- glUniform3iv_client_proc_t m_glUniform3iv_enc;
- glUniform4f_client_proc_t m_glUniform4f_enc;
- glUniform4fv_client_proc_t m_glUniform4fv_enc;
- glUniform4i_client_proc_t m_glUniform4i_enc;
- glUniform4iv_client_proc_t m_glUniform4iv_enc;
- glUniformMatrix2fv_client_proc_t m_glUniformMatrix2fv_enc;
- glUniformMatrix3fv_client_proc_t m_glUniformMatrix3fv_enc;
- glUniformMatrix4fv_client_proc_t m_glUniformMatrix4fv_enc;
-
- static void s_glUseProgram(void *self, GLuint program);
- static void s_glUniform1f(void *self , GLint location, GLfloat x);
- static void s_glUniform1fv(void *self , GLint location, GLsizei count, const GLfloat* v);
- static void s_glUniform1i(void *self , GLint location, GLint x);
- static void s_glUniform1iv(void *self , GLint location, GLsizei count, const GLint* v);
- static void s_glUniform2f(void *self , GLint location, GLfloat x, GLfloat y);
- static void s_glUniform2fv(void *self , GLint location, GLsizei count, const GLfloat* v);
- static void s_glUniform2i(void *self , GLint location, GLint x, GLint y);
- static void s_glUniform2iv(void *self , GLint location, GLsizei count, const GLint* v);
- static void s_glUniform3f(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z);
- static void s_glUniform3fv(void *self , GLint location, GLsizei count, const GLfloat* v);
- static void s_glUniform3i(void *self , GLint location, GLint x, GLint y, GLint z);
- static void s_glUniform3iv(void *self , GLint location, GLsizei count, const GLint* v);
- static void s_glUniform4f(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- static void s_glUniform4fv(void *self , GLint location, GLsizei count, const GLfloat* v);
- static void s_glUniform4i(void *self , GLint location, GLint x, GLint y, GLint z, GLint w);
- static void s_glUniform4iv(void *self , GLint location, GLsizei count, const GLint* v);
- static void s_glUniformMatrix2fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- static void s_glUniformMatrix3fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- static void s_glUniformMatrix4fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-
- glActiveTexture_client_proc_t m_glActiveTexture_enc;
- glBindTexture_client_proc_t m_glBindTexture_enc;
- glDeleteTextures_client_proc_t m_glDeleteTextures_enc;
- glGetTexParameterfv_client_proc_t m_glGetTexParameterfv_enc;
- glGetTexParameteriv_client_proc_t m_glGetTexParameteriv_enc;
- glTexParameterf_client_proc_t m_glTexParameterf_enc;
- glTexParameterfv_client_proc_t m_glTexParameterfv_enc;
- glTexParameteri_client_proc_t m_glTexParameteri_enc;
- glTexParameteriv_client_proc_t m_glTexParameteriv_enc;
- glTexImage2D_client_proc_t m_glTexImage2D_enc;
- glTexSubImage2D_client_proc_t m_glTexSubImage2D_enc;
-
- static void s_glActiveTexture(void* self, GLenum texture);
- static void s_glBindTexture(void* self, GLenum target, GLuint texture);
- static void s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures);
- static void s_glGetTexParameterfv(void* self, GLenum target, GLenum pname, GLfloat* params);
- static void s_glGetTexParameteriv(void* self, GLenum target, GLenum pname, GLint* params);
- static void s_glTexParameterf(void* self, GLenum target, GLenum pname, GLfloat param);
- static void s_glTexParameterfv(void* self, GLenum target, GLenum pname, const GLfloat* params);
- static void s_glTexParameteri(void* self, GLenum target, GLenum pname, GLint param);
- static void s_glTexParameteriv(void* self, GLenum target, GLenum pname, const GLint* params);
- static void s_glTexImage2D(void* self, GLenum target, GLint level, GLint internalformat,
- GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type,
- const GLvoid* pixels);
- static void s_glTexSubImage2D(void* self, GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
- const GLvoid* pixels);
-
-public:
- glEGLImageTargetTexture2DOES_client_proc_t m_glEGLImageTargetTexture2DOES_enc;
-
-};
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 <stdio.h>
-#include <stdlib.h>
-#include "GL2Encoder.h"
-#include <assert.h>
-
-namespace glesv2_enc {
-
-size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
-{
- GL2Encoder *ctx = (GL2Encoder *)self;
- assert (ctx->state() != NULL);
- return ctx->state()->pixelDataSize(width, height, format, type, pack);
-}
-
-size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack)
-{
- size_t layerSize = pixelDataSize(self, width, height, format, type, pack);
- return layerSize * depth;
-}
-
-GLenum uniformType(void * self, GLuint program, GLint location)
-{
- GL2Encoder * ctx = (GL2Encoder *) self;
- assert (ctx->shared() != NULL);
- return ctx->shared()->getProgramUniformType(program, location);
-}
-
-} // namespace glesv2_enc
+++ /dev/null
-/*
-* Copyright (C) 2011 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 GL2_ENCODER_UTILS_H
-#define GL2_ENCODER_UTILS_H
-
-namespace glesv2_enc {
-
-size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
-size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack);
-GLenum uniformType(void * self, GLuint program, GLint location);
-
-} // namespace glesv2_enc
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-
-
-#include <string.h>
-#include "gl2_client_context.h"
-
-
-#include <stdio.h>
-
-int gl2_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
-{
- glActiveTexture = (glActiveTexture_client_proc_t) getProc("glActiveTexture", userData);
- glAttachShader = (glAttachShader_client_proc_t) getProc("glAttachShader", userData);
- glBindAttribLocation = (glBindAttribLocation_client_proc_t) getProc("glBindAttribLocation", userData);
- glBindBuffer = (glBindBuffer_client_proc_t) getProc("glBindBuffer", userData);
- glBindFramebuffer = (glBindFramebuffer_client_proc_t) getProc("glBindFramebuffer", userData);
- glBindRenderbuffer = (glBindRenderbuffer_client_proc_t) getProc("glBindRenderbuffer", userData);
- glBindTexture = (glBindTexture_client_proc_t) getProc("glBindTexture", userData);
- glBlendColor = (glBlendColor_client_proc_t) getProc("glBlendColor", userData);
- glBlendEquation = (glBlendEquation_client_proc_t) getProc("glBlendEquation", userData);
- glBlendEquationSeparate = (glBlendEquationSeparate_client_proc_t) getProc("glBlendEquationSeparate", userData);
- glBlendFunc = (glBlendFunc_client_proc_t) getProc("glBlendFunc", userData);
- glBlendFuncSeparate = (glBlendFuncSeparate_client_proc_t) getProc("glBlendFuncSeparate", userData);
- glBufferData = (glBufferData_client_proc_t) getProc("glBufferData", userData);
- glBufferSubData = (glBufferSubData_client_proc_t) getProc("glBufferSubData", userData);
- glCheckFramebufferStatus = (glCheckFramebufferStatus_client_proc_t) getProc("glCheckFramebufferStatus", userData);
- glClear = (glClear_client_proc_t) getProc("glClear", userData);
- glClearColor = (glClearColor_client_proc_t) getProc("glClearColor", userData);
- glClearDepthf = (glClearDepthf_client_proc_t) getProc("glClearDepthf", userData);
- glClearStencil = (glClearStencil_client_proc_t) getProc("glClearStencil", userData);
- glColorMask = (glColorMask_client_proc_t) getProc("glColorMask", userData);
- glCompileShader = (glCompileShader_client_proc_t) getProc("glCompileShader", userData);
- glCompressedTexImage2D = (glCompressedTexImage2D_client_proc_t) getProc("glCompressedTexImage2D", userData);
- glCompressedTexSubImage2D = (glCompressedTexSubImage2D_client_proc_t) getProc("glCompressedTexSubImage2D", userData);
- glCopyTexImage2D = (glCopyTexImage2D_client_proc_t) getProc("glCopyTexImage2D", userData);
- glCopyTexSubImage2D = (glCopyTexSubImage2D_client_proc_t) getProc("glCopyTexSubImage2D", userData);
- glCreateProgram = (glCreateProgram_client_proc_t) getProc("glCreateProgram", userData);
- glCreateShader = (glCreateShader_client_proc_t) getProc("glCreateShader", userData);
- glCullFace = (glCullFace_client_proc_t) getProc("glCullFace", userData);
- glDeleteBuffers = (glDeleteBuffers_client_proc_t) getProc("glDeleteBuffers", userData);
- glDeleteFramebuffers = (glDeleteFramebuffers_client_proc_t) getProc("glDeleteFramebuffers", userData);
- glDeleteProgram = (glDeleteProgram_client_proc_t) getProc("glDeleteProgram", userData);
- glDeleteRenderbuffers = (glDeleteRenderbuffers_client_proc_t) getProc("glDeleteRenderbuffers", userData);
- glDeleteShader = (glDeleteShader_client_proc_t) getProc("glDeleteShader", userData);
- glDeleteTextures = (glDeleteTextures_client_proc_t) getProc("glDeleteTextures", userData);
- glDepthFunc = (glDepthFunc_client_proc_t) getProc("glDepthFunc", userData);
- glDepthMask = (glDepthMask_client_proc_t) getProc("glDepthMask", userData);
- glDepthRangef = (glDepthRangef_client_proc_t) getProc("glDepthRangef", userData);
- glDetachShader = (glDetachShader_client_proc_t) getProc("glDetachShader", userData);
- glDisable = (glDisable_client_proc_t) getProc("glDisable", userData);
- glDisableVertexAttribArray = (glDisableVertexAttribArray_client_proc_t) getProc("glDisableVertexAttribArray", userData);
- glDrawArrays = (glDrawArrays_client_proc_t) getProc("glDrawArrays", userData);
- glDrawElements = (glDrawElements_client_proc_t) getProc("glDrawElements", userData);
- glEnable = (glEnable_client_proc_t) getProc("glEnable", userData);
- glEnableVertexAttribArray = (glEnableVertexAttribArray_client_proc_t) getProc("glEnableVertexAttribArray", userData);
- glFinish = (glFinish_client_proc_t) getProc("glFinish", userData);
- glFlush = (glFlush_client_proc_t) getProc("glFlush", userData);
- glFramebufferRenderbuffer = (glFramebufferRenderbuffer_client_proc_t) getProc("glFramebufferRenderbuffer", userData);
- glFramebufferTexture2D = (glFramebufferTexture2D_client_proc_t) getProc("glFramebufferTexture2D", userData);
- glFrontFace = (glFrontFace_client_proc_t) getProc("glFrontFace", userData);
- glGenBuffers = (glGenBuffers_client_proc_t) getProc("glGenBuffers", userData);
- glGenerateMipmap = (glGenerateMipmap_client_proc_t) getProc("glGenerateMipmap", userData);
- glGenFramebuffers = (glGenFramebuffers_client_proc_t) getProc("glGenFramebuffers", userData);
- glGenRenderbuffers = (glGenRenderbuffers_client_proc_t) getProc("glGenRenderbuffers", userData);
- glGenTextures = (glGenTextures_client_proc_t) getProc("glGenTextures", userData);
- glGetActiveAttrib = (glGetActiveAttrib_client_proc_t) getProc("glGetActiveAttrib", userData);
- glGetActiveUniform = (glGetActiveUniform_client_proc_t) getProc("glGetActiveUniform", userData);
- glGetAttachedShaders = (glGetAttachedShaders_client_proc_t) getProc("glGetAttachedShaders", userData);
- glGetAttribLocation = (glGetAttribLocation_client_proc_t) getProc("glGetAttribLocation", userData);
- glGetBooleanv = (glGetBooleanv_client_proc_t) getProc("glGetBooleanv", userData);
- glGetBufferParameteriv = (glGetBufferParameteriv_client_proc_t) getProc("glGetBufferParameteriv", userData);
- glGetError = (glGetError_client_proc_t) getProc("glGetError", userData);
- glGetFloatv = (glGetFloatv_client_proc_t) getProc("glGetFloatv", userData);
- glGetFramebufferAttachmentParameteriv = (glGetFramebufferAttachmentParameteriv_client_proc_t) getProc("glGetFramebufferAttachmentParameteriv", userData);
- glGetIntegerv = (glGetIntegerv_client_proc_t) getProc("glGetIntegerv", userData);
- glGetProgramiv = (glGetProgramiv_client_proc_t) getProc("glGetProgramiv", userData);
- glGetProgramInfoLog = (glGetProgramInfoLog_client_proc_t) getProc("glGetProgramInfoLog", userData);
- glGetRenderbufferParameteriv = (glGetRenderbufferParameteriv_client_proc_t) getProc("glGetRenderbufferParameteriv", userData);
- glGetShaderiv = (glGetShaderiv_client_proc_t) getProc("glGetShaderiv", userData);
- glGetShaderInfoLog = (glGetShaderInfoLog_client_proc_t) getProc("glGetShaderInfoLog", userData);
- glGetShaderPrecisionFormat = (glGetShaderPrecisionFormat_client_proc_t) getProc("glGetShaderPrecisionFormat", userData);
- glGetShaderSource = (glGetShaderSource_client_proc_t) getProc("glGetShaderSource", userData);
- glGetString = (glGetString_client_proc_t) getProc("glGetString", userData);
- glGetTexParameterfv = (glGetTexParameterfv_client_proc_t) getProc("glGetTexParameterfv", userData);
- glGetTexParameteriv = (glGetTexParameteriv_client_proc_t) getProc("glGetTexParameteriv", userData);
- glGetUniformfv = (glGetUniformfv_client_proc_t) getProc("glGetUniformfv", userData);
- glGetUniformiv = (glGetUniformiv_client_proc_t) getProc("glGetUniformiv", userData);
- glGetUniformLocation = (glGetUniformLocation_client_proc_t) getProc("glGetUniformLocation", userData);
- glGetVertexAttribfv = (glGetVertexAttribfv_client_proc_t) getProc("glGetVertexAttribfv", userData);
- glGetVertexAttribiv = (glGetVertexAttribiv_client_proc_t) getProc("glGetVertexAttribiv", userData);
- glGetVertexAttribPointerv = (glGetVertexAttribPointerv_client_proc_t) getProc("glGetVertexAttribPointerv", userData);
- glHint = (glHint_client_proc_t) getProc("glHint", userData);
- glIsBuffer = (glIsBuffer_client_proc_t) getProc("glIsBuffer", userData);
- glIsEnabled = (glIsEnabled_client_proc_t) getProc("glIsEnabled", userData);
- glIsFramebuffer = (glIsFramebuffer_client_proc_t) getProc("glIsFramebuffer", userData);
- glIsProgram = (glIsProgram_client_proc_t) getProc("glIsProgram", userData);
- glIsRenderbuffer = (glIsRenderbuffer_client_proc_t) getProc("glIsRenderbuffer", userData);
- glIsShader = (glIsShader_client_proc_t) getProc("glIsShader", userData);
- glIsTexture = (glIsTexture_client_proc_t) getProc("glIsTexture", userData);
- glLineWidth = (glLineWidth_client_proc_t) getProc("glLineWidth", userData);
- glLinkProgram = (glLinkProgram_client_proc_t) getProc("glLinkProgram", userData);
- glPixelStorei = (glPixelStorei_client_proc_t) getProc("glPixelStorei", userData);
- glPolygonOffset = (glPolygonOffset_client_proc_t) getProc("glPolygonOffset", userData);
- glReadPixels = (glReadPixels_client_proc_t) getProc("glReadPixels", userData);
- glReleaseShaderCompiler = (glReleaseShaderCompiler_client_proc_t) getProc("glReleaseShaderCompiler", userData);
- glRenderbufferStorage = (glRenderbufferStorage_client_proc_t) getProc("glRenderbufferStorage", userData);
- glSampleCoverage = (glSampleCoverage_client_proc_t) getProc("glSampleCoverage", userData);
- glScissor = (glScissor_client_proc_t) getProc("glScissor", userData);
- glShaderBinary = (glShaderBinary_client_proc_t) getProc("glShaderBinary", userData);
- glShaderSource = (glShaderSource_client_proc_t) getProc("glShaderSource", userData);
- glStencilFunc = (glStencilFunc_client_proc_t) getProc("glStencilFunc", userData);
- glStencilFuncSeparate = (glStencilFuncSeparate_client_proc_t) getProc("glStencilFuncSeparate", userData);
- glStencilMask = (glStencilMask_client_proc_t) getProc("glStencilMask", userData);
- glStencilMaskSeparate = (glStencilMaskSeparate_client_proc_t) getProc("glStencilMaskSeparate", userData);
- glStencilOp = (glStencilOp_client_proc_t) getProc("glStencilOp", userData);
- glStencilOpSeparate = (glStencilOpSeparate_client_proc_t) getProc("glStencilOpSeparate", userData);
- glTexImage2D = (glTexImage2D_client_proc_t) getProc("glTexImage2D", userData);
- glTexParameterf = (glTexParameterf_client_proc_t) getProc("glTexParameterf", userData);
- glTexParameterfv = (glTexParameterfv_client_proc_t) getProc("glTexParameterfv", userData);
- glTexParameteri = (glTexParameteri_client_proc_t) getProc("glTexParameteri", userData);
- glTexParameteriv = (glTexParameteriv_client_proc_t) getProc("glTexParameteriv", userData);
- glTexSubImage2D = (glTexSubImage2D_client_proc_t) getProc("glTexSubImage2D", userData);
- glUniform1f = (glUniform1f_client_proc_t) getProc("glUniform1f", userData);
- glUniform1fv = (glUniform1fv_client_proc_t) getProc("glUniform1fv", userData);
- glUniform1i = (glUniform1i_client_proc_t) getProc("glUniform1i", userData);
- glUniform1iv = (glUniform1iv_client_proc_t) getProc("glUniform1iv", userData);
- glUniform2f = (glUniform2f_client_proc_t) getProc("glUniform2f", userData);
- glUniform2fv = (glUniform2fv_client_proc_t) getProc("glUniform2fv", userData);
- glUniform2i = (glUniform2i_client_proc_t) getProc("glUniform2i", userData);
- glUniform2iv = (glUniform2iv_client_proc_t) getProc("glUniform2iv", userData);
- glUniform3f = (glUniform3f_client_proc_t) getProc("glUniform3f", userData);
- glUniform3fv = (glUniform3fv_client_proc_t) getProc("glUniform3fv", userData);
- glUniform3i = (glUniform3i_client_proc_t) getProc("glUniform3i", userData);
- glUniform3iv = (glUniform3iv_client_proc_t) getProc("glUniform3iv", userData);
- glUniform4f = (glUniform4f_client_proc_t) getProc("glUniform4f", userData);
- glUniform4fv = (glUniform4fv_client_proc_t) getProc("glUniform4fv", userData);
- glUniform4i = (glUniform4i_client_proc_t) getProc("glUniform4i", userData);
- glUniform4iv = (glUniform4iv_client_proc_t) getProc("glUniform4iv", userData);
- glUniformMatrix2fv = (glUniformMatrix2fv_client_proc_t) getProc("glUniformMatrix2fv", userData);
- glUniformMatrix3fv = (glUniformMatrix3fv_client_proc_t) getProc("glUniformMatrix3fv", userData);
- glUniformMatrix4fv = (glUniformMatrix4fv_client_proc_t) getProc("glUniformMatrix4fv", userData);
- glUseProgram = (glUseProgram_client_proc_t) getProc("glUseProgram", userData);
- glValidateProgram = (glValidateProgram_client_proc_t) getProc("glValidateProgram", userData);
- glVertexAttrib1f = (glVertexAttrib1f_client_proc_t) getProc("glVertexAttrib1f", userData);
- glVertexAttrib1fv = (glVertexAttrib1fv_client_proc_t) getProc("glVertexAttrib1fv", userData);
- glVertexAttrib2f = (glVertexAttrib2f_client_proc_t) getProc("glVertexAttrib2f", userData);
- glVertexAttrib2fv = (glVertexAttrib2fv_client_proc_t) getProc("glVertexAttrib2fv", userData);
- glVertexAttrib3f = (glVertexAttrib3f_client_proc_t) getProc("glVertexAttrib3f", userData);
- glVertexAttrib3fv = (glVertexAttrib3fv_client_proc_t) getProc("glVertexAttrib3fv", userData);
- glVertexAttrib4f = (glVertexAttrib4f_client_proc_t) getProc("glVertexAttrib4f", userData);
- glVertexAttrib4fv = (glVertexAttrib4fv_client_proc_t) getProc("glVertexAttrib4fv", userData);
- glVertexAttribPointer = (glVertexAttribPointer_client_proc_t) getProc("glVertexAttribPointer", userData);
- glViewport = (glViewport_client_proc_t) getProc("glViewport", userData);
- glEGLImageTargetTexture2DOES = (glEGLImageTargetTexture2DOES_client_proc_t) getProc("glEGLImageTargetTexture2DOES", userData);
- glEGLImageTargetRenderbufferStorageOES = (glEGLImageTargetRenderbufferStorageOES_client_proc_t) getProc("glEGLImageTargetRenderbufferStorageOES", userData);
- glGetProgramBinaryOES = (glGetProgramBinaryOES_client_proc_t) getProc("glGetProgramBinaryOES", userData);
- glProgramBinaryOES = (glProgramBinaryOES_client_proc_t) getProc("glProgramBinaryOES", userData);
- glMapBufferOES = (glMapBufferOES_client_proc_t) getProc("glMapBufferOES", userData);
- glUnmapBufferOES = (glUnmapBufferOES_client_proc_t) getProc("glUnmapBufferOES", userData);
- glTexImage3DOES = (glTexImage3DOES_client_proc_t) getProc("glTexImage3DOES", userData);
- glTexSubImage3DOES = (glTexSubImage3DOES_client_proc_t) getProc("glTexSubImage3DOES", userData);
- glCopyTexSubImage3DOES = (glCopyTexSubImage3DOES_client_proc_t) getProc("glCopyTexSubImage3DOES", userData);
- glCompressedTexImage3DOES = (glCompressedTexImage3DOES_client_proc_t) getProc("glCompressedTexImage3DOES", userData);
- glCompressedTexSubImage3DOES = (glCompressedTexSubImage3DOES_client_proc_t) getProc("glCompressedTexSubImage3DOES", userData);
- glFramebufferTexture3DOES = (glFramebufferTexture3DOES_client_proc_t) getProc("glFramebufferTexture3DOES", userData);
- glBindVertexArrayOES = (glBindVertexArrayOES_client_proc_t) getProc("glBindVertexArrayOES", userData);
- glDeleteVertexArraysOES = (glDeleteVertexArraysOES_client_proc_t) getProc("glDeleteVertexArraysOES", userData);
- glGenVertexArraysOES = (glGenVertexArraysOES_client_proc_t) getProc("glGenVertexArraysOES", userData);
- glIsVertexArrayOES = (glIsVertexArrayOES_client_proc_t) getProc("glIsVertexArrayOES", userData);
- glDiscardFramebufferEXT = (glDiscardFramebufferEXT_client_proc_t) getProc("glDiscardFramebufferEXT", userData);
- glMultiDrawArraysEXT = (glMultiDrawArraysEXT_client_proc_t) getProc("glMultiDrawArraysEXT", userData);
- glMultiDrawElementsEXT = (glMultiDrawElementsEXT_client_proc_t) getProc("glMultiDrawElementsEXT", userData);
- glGetPerfMonitorGroupsAMD = (glGetPerfMonitorGroupsAMD_client_proc_t) getProc("glGetPerfMonitorGroupsAMD", userData);
- glGetPerfMonitorCountersAMD = (glGetPerfMonitorCountersAMD_client_proc_t) getProc("glGetPerfMonitorCountersAMD", userData);
- glGetPerfMonitorGroupStringAMD = (glGetPerfMonitorGroupStringAMD_client_proc_t) getProc("glGetPerfMonitorGroupStringAMD", userData);
- glGetPerfMonitorCounterStringAMD = (glGetPerfMonitorCounterStringAMD_client_proc_t) getProc("glGetPerfMonitorCounterStringAMD", userData);
- glGetPerfMonitorCounterInfoAMD = (glGetPerfMonitorCounterInfoAMD_client_proc_t) getProc("glGetPerfMonitorCounterInfoAMD", userData);
- glGenPerfMonitorsAMD = (glGenPerfMonitorsAMD_client_proc_t) getProc("glGenPerfMonitorsAMD", userData);
- glDeletePerfMonitorsAMD = (glDeletePerfMonitorsAMD_client_proc_t) getProc("glDeletePerfMonitorsAMD", userData);
- glSelectPerfMonitorCountersAMD = (glSelectPerfMonitorCountersAMD_client_proc_t) getProc("glSelectPerfMonitorCountersAMD", userData);
- glBeginPerfMonitorAMD = (glBeginPerfMonitorAMD_client_proc_t) getProc("glBeginPerfMonitorAMD", userData);
- glEndPerfMonitorAMD = (glEndPerfMonitorAMD_client_proc_t) getProc("glEndPerfMonitorAMD", userData);
- glGetPerfMonitorCounterDataAMD = (glGetPerfMonitorCounterDataAMD_client_proc_t) getProc("glGetPerfMonitorCounterDataAMD", userData);
- glRenderbufferStorageMultisampleIMG = (glRenderbufferStorageMultisampleIMG_client_proc_t) getProc("glRenderbufferStorageMultisampleIMG", userData);
- glFramebufferTexture2DMultisampleIMG = (glFramebufferTexture2DMultisampleIMG_client_proc_t) getProc("glFramebufferTexture2DMultisampleIMG", userData);
- glDeleteFencesNV = (glDeleteFencesNV_client_proc_t) getProc("glDeleteFencesNV", userData);
- glGenFencesNV = (glGenFencesNV_client_proc_t) getProc("glGenFencesNV", userData);
- glIsFenceNV = (glIsFenceNV_client_proc_t) getProc("glIsFenceNV", userData);
- glTestFenceNV = (glTestFenceNV_client_proc_t) getProc("glTestFenceNV", userData);
- glGetFenceivNV = (glGetFenceivNV_client_proc_t) getProc("glGetFenceivNV", userData);
- glFinishFenceNV = (glFinishFenceNV_client_proc_t) getProc("glFinishFenceNV", userData);
- glSetFenceNV = (glSetFenceNV_client_proc_t) getProc("glSetFenceNV", userData);
- glCoverageMaskNV = (glCoverageMaskNV_client_proc_t) getProc("glCoverageMaskNV", userData);
- glCoverageOperationNV = (glCoverageOperationNV_client_proc_t) getProc("glCoverageOperationNV", userData);
- glGetDriverControlsQCOM = (glGetDriverControlsQCOM_client_proc_t) getProc("glGetDriverControlsQCOM", userData);
- glGetDriverControlStringQCOM = (glGetDriverControlStringQCOM_client_proc_t) getProc("glGetDriverControlStringQCOM", userData);
- glEnableDriverControlQCOM = (glEnableDriverControlQCOM_client_proc_t) getProc("glEnableDriverControlQCOM", userData);
- glDisableDriverControlQCOM = (glDisableDriverControlQCOM_client_proc_t) getProc("glDisableDriverControlQCOM", userData);
- glExtGetTexturesQCOM = (glExtGetTexturesQCOM_client_proc_t) getProc("glExtGetTexturesQCOM", userData);
- glExtGetBuffersQCOM = (glExtGetBuffersQCOM_client_proc_t) getProc("glExtGetBuffersQCOM", userData);
- glExtGetRenderbuffersQCOM = (glExtGetRenderbuffersQCOM_client_proc_t) getProc("glExtGetRenderbuffersQCOM", userData);
- glExtGetFramebuffersQCOM = (glExtGetFramebuffersQCOM_client_proc_t) getProc("glExtGetFramebuffersQCOM", userData);
- glExtGetTexLevelParameterivQCOM = (glExtGetTexLevelParameterivQCOM_client_proc_t) getProc("glExtGetTexLevelParameterivQCOM", userData);
- glExtTexObjectStateOverrideiQCOM = (glExtTexObjectStateOverrideiQCOM_client_proc_t) getProc("glExtTexObjectStateOverrideiQCOM", userData);
- glExtGetTexSubImageQCOM = (glExtGetTexSubImageQCOM_client_proc_t) getProc("glExtGetTexSubImageQCOM", userData);
- glExtGetBufferPointervQCOM = (glExtGetBufferPointervQCOM_client_proc_t) getProc("glExtGetBufferPointervQCOM", userData);
- glExtGetShadersQCOM = (glExtGetShadersQCOM_client_proc_t) getProc("glExtGetShadersQCOM", userData);
- glExtGetProgramsQCOM = (glExtGetProgramsQCOM_client_proc_t) getProc("glExtGetProgramsQCOM", userData);
- glExtIsProgramBinaryQCOM = (glExtIsProgramBinaryQCOM_client_proc_t) getProc("glExtIsProgramBinaryQCOM", userData);
- glExtGetProgramBinarySourceQCOM = (glExtGetProgramBinarySourceQCOM_client_proc_t) getProc("glExtGetProgramBinarySourceQCOM", userData);
- glStartTilingQCOM = (glStartTilingQCOM_client_proc_t) getProc("glStartTilingQCOM", userData);
- glEndTilingQCOM = (glEndTilingQCOM_client_proc_t) getProc("glEndTilingQCOM", userData);
- glVertexAttribPointerData = (glVertexAttribPointerData_client_proc_t) getProc("glVertexAttribPointerData", userData);
- glVertexAttribPointerOffset = (glVertexAttribPointerOffset_client_proc_t) getProc("glVertexAttribPointerOffset", userData);
- glDrawElementsOffset = (glDrawElementsOffset_client_proc_t) getProc("glDrawElementsOffset", userData);
- glDrawElementsData = (glDrawElementsData_client_proc_t) getProc("glDrawElementsData", userData);
- glGetCompressedTextureFormats = (glGetCompressedTextureFormats_client_proc_t) getProc("glGetCompressedTextureFormats", userData);
- glShaderString = (glShaderString_client_proc_t) getProc("glShaderString", userData);
- glFinishRoundTrip = (glFinishRoundTrip_client_proc_t) getProc("glFinishRoundTrip", userData);
- return 0;
-}
-
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __gl2_client_context_t_h
-#define __gl2_client_context_t_h
-
-#include "gl2_client_proc.h"
-
-#include "gl2_types.h"
-
-
-struct gl2_client_context_t {
-
- glActiveTexture_client_proc_t glActiveTexture;
- glAttachShader_client_proc_t glAttachShader;
- glBindAttribLocation_client_proc_t glBindAttribLocation;
- glBindBuffer_client_proc_t glBindBuffer;
- glBindFramebuffer_client_proc_t glBindFramebuffer;
- glBindRenderbuffer_client_proc_t glBindRenderbuffer;
- glBindTexture_client_proc_t glBindTexture;
- glBlendColor_client_proc_t glBlendColor;
- glBlendEquation_client_proc_t glBlendEquation;
- glBlendEquationSeparate_client_proc_t glBlendEquationSeparate;
- glBlendFunc_client_proc_t glBlendFunc;
- glBlendFuncSeparate_client_proc_t glBlendFuncSeparate;
- glBufferData_client_proc_t glBufferData;
- glBufferSubData_client_proc_t glBufferSubData;
- glCheckFramebufferStatus_client_proc_t glCheckFramebufferStatus;
- glClear_client_proc_t glClear;
- glClearColor_client_proc_t glClearColor;
- glClearDepthf_client_proc_t glClearDepthf;
- glClearStencil_client_proc_t glClearStencil;
- glColorMask_client_proc_t glColorMask;
- glCompileShader_client_proc_t glCompileShader;
- glCompressedTexImage2D_client_proc_t glCompressedTexImage2D;
- glCompressedTexSubImage2D_client_proc_t glCompressedTexSubImage2D;
- glCopyTexImage2D_client_proc_t glCopyTexImage2D;
- glCopyTexSubImage2D_client_proc_t glCopyTexSubImage2D;
- glCreateProgram_client_proc_t glCreateProgram;
- glCreateShader_client_proc_t glCreateShader;
- glCullFace_client_proc_t glCullFace;
- glDeleteBuffers_client_proc_t glDeleteBuffers;
- glDeleteFramebuffers_client_proc_t glDeleteFramebuffers;
- glDeleteProgram_client_proc_t glDeleteProgram;
- glDeleteRenderbuffers_client_proc_t glDeleteRenderbuffers;
- glDeleteShader_client_proc_t glDeleteShader;
- glDeleteTextures_client_proc_t glDeleteTextures;
- glDepthFunc_client_proc_t glDepthFunc;
- glDepthMask_client_proc_t glDepthMask;
- glDepthRangef_client_proc_t glDepthRangef;
- glDetachShader_client_proc_t glDetachShader;
- glDisable_client_proc_t glDisable;
- glDisableVertexAttribArray_client_proc_t glDisableVertexAttribArray;
- glDrawArrays_client_proc_t glDrawArrays;
- glDrawElements_client_proc_t glDrawElements;
- glEnable_client_proc_t glEnable;
- glEnableVertexAttribArray_client_proc_t glEnableVertexAttribArray;
- glFinish_client_proc_t glFinish;
- glFlush_client_proc_t glFlush;
- glFramebufferRenderbuffer_client_proc_t glFramebufferRenderbuffer;
- glFramebufferTexture2D_client_proc_t glFramebufferTexture2D;
- glFrontFace_client_proc_t glFrontFace;
- glGenBuffers_client_proc_t glGenBuffers;
- glGenerateMipmap_client_proc_t glGenerateMipmap;
- glGenFramebuffers_client_proc_t glGenFramebuffers;
- glGenRenderbuffers_client_proc_t glGenRenderbuffers;
- glGenTextures_client_proc_t glGenTextures;
- glGetActiveAttrib_client_proc_t glGetActiveAttrib;
- glGetActiveUniform_client_proc_t glGetActiveUniform;
- glGetAttachedShaders_client_proc_t glGetAttachedShaders;
- glGetAttribLocation_client_proc_t glGetAttribLocation;
- glGetBooleanv_client_proc_t glGetBooleanv;
- glGetBufferParameteriv_client_proc_t glGetBufferParameteriv;
- glGetError_client_proc_t glGetError;
- glGetFloatv_client_proc_t glGetFloatv;
- glGetFramebufferAttachmentParameteriv_client_proc_t glGetFramebufferAttachmentParameteriv;
- glGetIntegerv_client_proc_t glGetIntegerv;
- glGetProgramiv_client_proc_t glGetProgramiv;
- glGetProgramInfoLog_client_proc_t glGetProgramInfoLog;
- glGetRenderbufferParameteriv_client_proc_t glGetRenderbufferParameteriv;
- glGetShaderiv_client_proc_t glGetShaderiv;
- glGetShaderInfoLog_client_proc_t glGetShaderInfoLog;
- glGetShaderPrecisionFormat_client_proc_t glGetShaderPrecisionFormat;
- glGetShaderSource_client_proc_t glGetShaderSource;
- glGetString_client_proc_t glGetString;
- glGetTexParameterfv_client_proc_t glGetTexParameterfv;
- glGetTexParameteriv_client_proc_t glGetTexParameteriv;
- glGetUniformfv_client_proc_t glGetUniformfv;
- glGetUniformiv_client_proc_t glGetUniformiv;
- glGetUniformLocation_client_proc_t glGetUniformLocation;
- glGetVertexAttribfv_client_proc_t glGetVertexAttribfv;
- glGetVertexAttribiv_client_proc_t glGetVertexAttribiv;
- glGetVertexAttribPointerv_client_proc_t glGetVertexAttribPointerv;
- glHint_client_proc_t glHint;
- glIsBuffer_client_proc_t glIsBuffer;
- glIsEnabled_client_proc_t glIsEnabled;
- glIsFramebuffer_client_proc_t glIsFramebuffer;
- glIsProgram_client_proc_t glIsProgram;
- glIsRenderbuffer_client_proc_t glIsRenderbuffer;
- glIsShader_client_proc_t glIsShader;
- glIsTexture_client_proc_t glIsTexture;
- glLineWidth_client_proc_t glLineWidth;
- glLinkProgram_client_proc_t glLinkProgram;
- glPixelStorei_client_proc_t glPixelStorei;
- glPolygonOffset_client_proc_t glPolygonOffset;
- glReadPixels_client_proc_t glReadPixels;
- glReleaseShaderCompiler_client_proc_t glReleaseShaderCompiler;
- glRenderbufferStorage_client_proc_t glRenderbufferStorage;
- glSampleCoverage_client_proc_t glSampleCoverage;
- glScissor_client_proc_t glScissor;
- glShaderBinary_client_proc_t glShaderBinary;
- glShaderSource_client_proc_t glShaderSource;
- glStencilFunc_client_proc_t glStencilFunc;
- glStencilFuncSeparate_client_proc_t glStencilFuncSeparate;
- glStencilMask_client_proc_t glStencilMask;
- glStencilMaskSeparate_client_proc_t glStencilMaskSeparate;
- glStencilOp_client_proc_t glStencilOp;
- glStencilOpSeparate_client_proc_t glStencilOpSeparate;
- glTexImage2D_client_proc_t glTexImage2D;
- glTexParameterf_client_proc_t glTexParameterf;
- glTexParameterfv_client_proc_t glTexParameterfv;
- glTexParameteri_client_proc_t glTexParameteri;
- glTexParameteriv_client_proc_t glTexParameteriv;
- glTexSubImage2D_client_proc_t glTexSubImage2D;
- glUniform1f_client_proc_t glUniform1f;
- glUniform1fv_client_proc_t glUniform1fv;
- glUniform1i_client_proc_t glUniform1i;
- glUniform1iv_client_proc_t glUniform1iv;
- glUniform2f_client_proc_t glUniform2f;
- glUniform2fv_client_proc_t glUniform2fv;
- glUniform2i_client_proc_t glUniform2i;
- glUniform2iv_client_proc_t glUniform2iv;
- glUniform3f_client_proc_t glUniform3f;
- glUniform3fv_client_proc_t glUniform3fv;
- glUniform3i_client_proc_t glUniform3i;
- glUniform3iv_client_proc_t glUniform3iv;
- glUniform4f_client_proc_t glUniform4f;
- glUniform4fv_client_proc_t glUniform4fv;
- glUniform4i_client_proc_t glUniform4i;
- glUniform4iv_client_proc_t glUniform4iv;
- glUniformMatrix2fv_client_proc_t glUniformMatrix2fv;
- glUniformMatrix3fv_client_proc_t glUniformMatrix3fv;
- glUniformMatrix4fv_client_proc_t glUniformMatrix4fv;
- glUseProgram_client_proc_t glUseProgram;
- glValidateProgram_client_proc_t glValidateProgram;
- glVertexAttrib1f_client_proc_t glVertexAttrib1f;
- glVertexAttrib1fv_client_proc_t glVertexAttrib1fv;
- glVertexAttrib2f_client_proc_t glVertexAttrib2f;
- glVertexAttrib2fv_client_proc_t glVertexAttrib2fv;
- glVertexAttrib3f_client_proc_t glVertexAttrib3f;
- glVertexAttrib3fv_client_proc_t glVertexAttrib3fv;
- glVertexAttrib4f_client_proc_t glVertexAttrib4f;
- glVertexAttrib4fv_client_proc_t glVertexAttrib4fv;
- glVertexAttribPointer_client_proc_t glVertexAttribPointer;
- glViewport_client_proc_t glViewport;
- glEGLImageTargetTexture2DOES_client_proc_t glEGLImageTargetTexture2DOES;
- glEGLImageTargetRenderbufferStorageOES_client_proc_t glEGLImageTargetRenderbufferStorageOES;
- glGetProgramBinaryOES_client_proc_t glGetProgramBinaryOES;
- glProgramBinaryOES_client_proc_t glProgramBinaryOES;
- glMapBufferOES_client_proc_t glMapBufferOES;
- glUnmapBufferOES_client_proc_t glUnmapBufferOES;
- glTexImage3DOES_client_proc_t glTexImage3DOES;
- glTexSubImage3DOES_client_proc_t glTexSubImage3DOES;
- glCopyTexSubImage3DOES_client_proc_t glCopyTexSubImage3DOES;
- glCompressedTexImage3DOES_client_proc_t glCompressedTexImage3DOES;
- glCompressedTexSubImage3DOES_client_proc_t glCompressedTexSubImage3DOES;
- glFramebufferTexture3DOES_client_proc_t glFramebufferTexture3DOES;
- glBindVertexArrayOES_client_proc_t glBindVertexArrayOES;
- glDeleteVertexArraysOES_client_proc_t glDeleteVertexArraysOES;
- glGenVertexArraysOES_client_proc_t glGenVertexArraysOES;
- glIsVertexArrayOES_client_proc_t glIsVertexArrayOES;
- glDiscardFramebufferEXT_client_proc_t glDiscardFramebufferEXT;
- glMultiDrawArraysEXT_client_proc_t glMultiDrawArraysEXT;
- glMultiDrawElementsEXT_client_proc_t glMultiDrawElementsEXT;
- glGetPerfMonitorGroupsAMD_client_proc_t glGetPerfMonitorGroupsAMD;
- glGetPerfMonitorCountersAMD_client_proc_t glGetPerfMonitorCountersAMD;
- glGetPerfMonitorGroupStringAMD_client_proc_t glGetPerfMonitorGroupStringAMD;
- glGetPerfMonitorCounterStringAMD_client_proc_t glGetPerfMonitorCounterStringAMD;
- glGetPerfMonitorCounterInfoAMD_client_proc_t glGetPerfMonitorCounterInfoAMD;
- glGenPerfMonitorsAMD_client_proc_t glGenPerfMonitorsAMD;
- glDeletePerfMonitorsAMD_client_proc_t glDeletePerfMonitorsAMD;
- glSelectPerfMonitorCountersAMD_client_proc_t glSelectPerfMonitorCountersAMD;
- glBeginPerfMonitorAMD_client_proc_t glBeginPerfMonitorAMD;
- glEndPerfMonitorAMD_client_proc_t glEndPerfMonitorAMD;
- glGetPerfMonitorCounterDataAMD_client_proc_t glGetPerfMonitorCounterDataAMD;
- glRenderbufferStorageMultisampleIMG_client_proc_t glRenderbufferStorageMultisampleIMG;
- glFramebufferTexture2DMultisampleIMG_client_proc_t glFramebufferTexture2DMultisampleIMG;
- glDeleteFencesNV_client_proc_t glDeleteFencesNV;
- glGenFencesNV_client_proc_t glGenFencesNV;
- glIsFenceNV_client_proc_t glIsFenceNV;
- glTestFenceNV_client_proc_t glTestFenceNV;
- glGetFenceivNV_client_proc_t glGetFenceivNV;
- glFinishFenceNV_client_proc_t glFinishFenceNV;
- glSetFenceNV_client_proc_t glSetFenceNV;
- glCoverageMaskNV_client_proc_t glCoverageMaskNV;
- glCoverageOperationNV_client_proc_t glCoverageOperationNV;
- glGetDriverControlsQCOM_client_proc_t glGetDriverControlsQCOM;
- glGetDriverControlStringQCOM_client_proc_t glGetDriverControlStringQCOM;
- glEnableDriverControlQCOM_client_proc_t glEnableDriverControlQCOM;
- glDisableDriverControlQCOM_client_proc_t glDisableDriverControlQCOM;
- glExtGetTexturesQCOM_client_proc_t glExtGetTexturesQCOM;
- glExtGetBuffersQCOM_client_proc_t glExtGetBuffersQCOM;
- glExtGetRenderbuffersQCOM_client_proc_t glExtGetRenderbuffersQCOM;
- glExtGetFramebuffersQCOM_client_proc_t glExtGetFramebuffersQCOM;
- glExtGetTexLevelParameterivQCOM_client_proc_t glExtGetTexLevelParameterivQCOM;
- glExtTexObjectStateOverrideiQCOM_client_proc_t glExtTexObjectStateOverrideiQCOM;
- glExtGetTexSubImageQCOM_client_proc_t glExtGetTexSubImageQCOM;
- glExtGetBufferPointervQCOM_client_proc_t glExtGetBufferPointervQCOM;
- glExtGetShadersQCOM_client_proc_t glExtGetShadersQCOM;
- glExtGetProgramsQCOM_client_proc_t glExtGetProgramsQCOM;
- glExtIsProgramBinaryQCOM_client_proc_t glExtIsProgramBinaryQCOM;
- glExtGetProgramBinarySourceQCOM_client_proc_t glExtGetProgramBinarySourceQCOM;
- glStartTilingQCOM_client_proc_t glStartTilingQCOM;
- glEndTilingQCOM_client_proc_t glEndTilingQCOM;
- glVertexAttribPointerData_client_proc_t glVertexAttribPointerData;
- glVertexAttribPointerOffset_client_proc_t glVertexAttribPointerOffset;
- glDrawElementsOffset_client_proc_t glDrawElementsOffset;
- glDrawElementsData_client_proc_t glDrawElementsData;
- glGetCompressedTextureFormats_client_proc_t glGetCompressedTextureFormats;
- glShaderString_client_proc_t glShaderString;
- glFinishRoundTrip_client_proc_t glFinishRoundTrip;
- virtual ~gl2_client_context_t() {}
-
- typedef gl2_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
- static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
- int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
- virtual void setError(unsigned int error){ (void)error; };
- virtual unsigned int getError(){ return 0; };
-};
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __gl2_client_proc_t_h
-#define __gl2_client_proc_t_h
-
-
-
-#include "gl2_types.h"
-#ifndef gl2_APIENTRY
-#define gl2_APIENTRY
-#endif
-typedef void (gl2_APIENTRY *glActiveTexture_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glAttachShader_client_proc_t) (void * ctx, GLuint, GLuint);
-typedef void (gl2_APIENTRY *glBindAttribLocation_client_proc_t) (void * ctx, GLuint, GLuint, const GLchar*);
-typedef void (gl2_APIENTRY *glBindBuffer_client_proc_t) (void * ctx, GLenum, GLuint);
-typedef void (gl2_APIENTRY *glBindFramebuffer_client_proc_t) (void * ctx, GLenum, GLuint);
-typedef void (gl2_APIENTRY *glBindRenderbuffer_client_proc_t) (void * ctx, GLenum, GLuint);
-typedef void (gl2_APIENTRY *glBindTexture_client_proc_t) (void * ctx, GLenum, GLuint);
-typedef void (gl2_APIENTRY *glBlendColor_client_proc_t) (void * ctx, GLclampf, GLclampf, GLclampf, GLclampf);
-typedef void (gl2_APIENTRY *glBlendEquation_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glBlendEquationSeparate_client_proc_t) (void * ctx, GLenum, GLenum);
-typedef void (gl2_APIENTRY *glBlendFunc_client_proc_t) (void * ctx, GLenum, GLenum);
-typedef void (gl2_APIENTRY *glBlendFuncSeparate_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLenum);
-typedef void (gl2_APIENTRY *glBufferData_client_proc_t) (void * ctx, GLenum, GLsizeiptr, const GLvoid*, GLenum);
-typedef void (gl2_APIENTRY *glBufferSubData_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, const GLvoid*);
-typedef GLenum (gl2_APIENTRY *glCheckFramebufferStatus_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glClear_client_proc_t) (void * ctx, GLbitfield);
-typedef void (gl2_APIENTRY *glClearColor_client_proc_t) (void * ctx, GLclampf, GLclampf, GLclampf, GLclampf);
-typedef void (gl2_APIENTRY *glClearDepthf_client_proc_t) (void * ctx, GLclampf);
-typedef void (gl2_APIENTRY *glClearStencil_client_proc_t) (void * ctx, GLint);
-typedef void (gl2_APIENTRY *glColorMask_client_proc_t) (void * ctx, GLboolean, GLboolean, GLboolean, GLboolean);
-typedef void (gl2_APIENTRY *glCompileShader_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glCompressedTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
-typedef void (gl2_APIENTRY *glCompressedTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
-typedef void (gl2_APIENTRY *glCopyTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
-typedef void (gl2_APIENTRY *glCopyTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-typedef GLuint (gl2_APIENTRY *glCreateProgram_client_proc_t) (void * ctx);
-typedef GLuint (gl2_APIENTRY *glCreateShader_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glCullFace_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glDeleteBuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl2_APIENTRY *glDeleteFramebuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl2_APIENTRY *glDeleteProgram_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glDeleteRenderbuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl2_APIENTRY *glDeleteShader_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glDeleteTextures_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl2_APIENTRY *glDepthFunc_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glDepthMask_client_proc_t) (void * ctx, GLboolean);
-typedef void (gl2_APIENTRY *glDepthRangef_client_proc_t) (void * ctx, GLclampf, GLclampf);
-typedef void (gl2_APIENTRY *glDetachShader_client_proc_t) (void * ctx, GLuint, GLuint);
-typedef void (gl2_APIENTRY *glDisable_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glDisableVertexAttribArray_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glDrawArrays_client_proc_t) (void * ctx, GLenum, GLint, GLsizei);
-typedef void (gl2_APIENTRY *glDrawElements_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const GLvoid*);
-typedef void (gl2_APIENTRY *glEnable_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glEnableVertexAttribArray_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glFinish_client_proc_t) (void * ctx);
-typedef void (gl2_APIENTRY *glFlush_client_proc_t) (void * ctx);
-typedef void (gl2_APIENTRY *glFramebufferRenderbuffer_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint);
-typedef void (gl2_APIENTRY *glFramebufferTexture2D_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint);
-typedef void (gl2_APIENTRY *glFrontFace_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glGenBuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef void (gl2_APIENTRY *glGenerateMipmap_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glGenFramebuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef void (gl2_APIENTRY *glGenRenderbuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef void (gl2_APIENTRY *glGenTextures_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef void (gl2_APIENTRY *glGetActiveAttrib_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
-typedef void (gl2_APIENTRY *glGetActiveUniform_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
-typedef void (gl2_APIENTRY *glGetAttachedShaders_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLuint*);
-typedef int (gl2_APIENTRY *glGetAttribLocation_client_proc_t) (void * ctx, GLuint, const GLchar*);
-typedef void (gl2_APIENTRY *glGetBooleanv_client_proc_t) (void * ctx, GLenum, GLboolean*);
-typedef void (gl2_APIENTRY *glGetBufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
-typedef GLenum (gl2_APIENTRY *glGetError_client_proc_t) (void * ctx);
-typedef void (gl2_APIENTRY *glGetFloatv_client_proc_t) (void * ctx, GLenum, GLfloat*);
-typedef void (gl2_APIENTRY *glGetFramebufferAttachmentParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLint*);
-typedef void (gl2_APIENTRY *glGetIntegerv_client_proc_t) (void * ctx, GLenum, GLint*);
-typedef void (gl2_APIENTRY *glGetProgramiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
-typedef void (gl2_APIENTRY *glGetProgramInfoLog_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
-typedef void (gl2_APIENTRY *glGetRenderbufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
-typedef void (gl2_APIENTRY *glGetShaderiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
-typedef void (gl2_APIENTRY *glGetShaderInfoLog_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
-typedef void (gl2_APIENTRY *glGetShaderPrecisionFormat_client_proc_t) (void * ctx, GLenum, GLenum, GLint*, GLint*);
-typedef void (gl2_APIENTRY *glGetShaderSource_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
-typedef const GLubyte* (gl2_APIENTRY *glGetString_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glGetTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
-typedef void (gl2_APIENTRY *glGetTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
-typedef void (gl2_APIENTRY *glGetUniformfv_client_proc_t) (void * ctx, GLuint, GLint, GLfloat*);
-typedef void (gl2_APIENTRY *glGetUniformiv_client_proc_t) (void * ctx, GLuint, GLint, GLint*);
-typedef int (gl2_APIENTRY *glGetUniformLocation_client_proc_t) (void * ctx, GLuint, const GLchar*);
-typedef void (gl2_APIENTRY *glGetVertexAttribfv_client_proc_t) (void * ctx, GLuint, GLenum, GLfloat*);
-typedef void (gl2_APIENTRY *glGetVertexAttribiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
-typedef void (gl2_APIENTRY *glGetVertexAttribPointerv_client_proc_t) (void * ctx, GLuint, GLenum, GLvoid**);
-typedef void (gl2_APIENTRY *glHint_client_proc_t) (void * ctx, GLenum, GLenum);
-typedef GLboolean (gl2_APIENTRY *glIsBuffer_client_proc_t) (void * ctx, GLuint);
-typedef GLboolean (gl2_APIENTRY *glIsEnabled_client_proc_t) (void * ctx, GLenum);
-typedef GLboolean (gl2_APIENTRY *glIsFramebuffer_client_proc_t) (void * ctx, GLuint);
-typedef GLboolean (gl2_APIENTRY *glIsProgram_client_proc_t) (void * ctx, GLuint);
-typedef GLboolean (gl2_APIENTRY *glIsRenderbuffer_client_proc_t) (void * ctx, GLuint);
-typedef GLboolean (gl2_APIENTRY *glIsShader_client_proc_t) (void * ctx, GLuint);
-typedef GLboolean (gl2_APIENTRY *glIsTexture_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glLineWidth_client_proc_t) (void * ctx, GLfloat);
-typedef void (gl2_APIENTRY *glLinkProgram_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glPixelStorei_client_proc_t) (void * ctx, GLenum, GLint);
-typedef void (gl2_APIENTRY *glPolygonOffset_client_proc_t) (void * ctx, GLfloat, GLfloat);
-typedef void (gl2_APIENTRY *glReadPixels_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
-typedef void (gl2_APIENTRY *glReleaseShaderCompiler_client_proc_t) (void * ctx);
-typedef void (gl2_APIENTRY *glRenderbufferStorage_client_proc_t) (void * ctx, GLenum, GLenum, GLsizei, GLsizei);
-typedef void (gl2_APIENTRY *glSampleCoverage_client_proc_t) (void * ctx, GLclampf, GLboolean);
-typedef void (gl2_APIENTRY *glScissor_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
-typedef void (gl2_APIENTRY *glShaderBinary_client_proc_t) (void * ctx, GLsizei, const GLuint*, GLenum, const GLvoid*, GLsizei);
-typedef void (gl2_APIENTRY *glShaderSource_client_proc_t) (void * ctx, GLuint, GLsizei, const GLchar* const*, const GLint*);
-typedef void (gl2_APIENTRY *glStencilFunc_client_proc_t) (void * ctx, GLenum, GLint, GLuint);
-typedef void (gl2_APIENTRY *glStencilFuncSeparate_client_proc_t) (void * ctx, GLenum, GLenum, GLint, GLuint);
-typedef void (gl2_APIENTRY *glStencilMask_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glStencilMaskSeparate_client_proc_t) (void * ctx, GLenum, GLuint);
-typedef void (gl2_APIENTRY *glStencilOp_client_proc_t) (void * ctx, GLenum, GLenum, GLenum);
-typedef void (gl2_APIENTRY *glStencilOpSeparate_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLenum);
-typedef void (gl2_APIENTRY *glTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
-typedef void (gl2_APIENTRY *glTexParameterf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
-typedef void (gl2_APIENTRY *glTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
-typedef void (gl2_APIENTRY *glTexParameteri_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
-typedef void (gl2_APIENTRY *glTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
-typedef void (gl2_APIENTRY *glTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
-typedef void (gl2_APIENTRY *glUniform1f_client_proc_t) (void * ctx, GLint, GLfloat);
-typedef void (gl2_APIENTRY *glUniform1fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
-typedef void (gl2_APIENTRY *glUniform1i_client_proc_t) (void * ctx, GLint, GLint);
-typedef void (gl2_APIENTRY *glUniform1iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
-typedef void (gl2_APIENTRY *glUniform2f_client_proc_t) (void * ctx, GLint, GLfloat, GLfloat);
-typedef void (gl2_APIENTRY *glUniform2fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
-typedef void (gl2_APIENTRY *glUniform2i_client_proc_t) (void * ctx, GLint, GLint, GLint);
-typedef void (gl2_APIENTRY *glUniform2iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
-typedef void (gl2_APIENTRY *glUniform3f_client_proc_t) (void * ctx, GLint, GLfloat, GLfloat, GLfloat);
-typedef void (gl2_APIENTRY *glUniform3fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
-typedef void (gl2_APIENTRY *glUniform3i_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint);
-typedef void (gl2_APIENTRY *glUniform3iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
-typedef void (gl2_APIENTRY *glUniform4f_client_proc_t) (void * ctx, GLint, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (gl2_APIENTRY *glUniform4fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
-typedef void (gl2_APIENTRY *glUniform4i_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint, GLint);
-typedef void (gl2_APIENTRY *glUniform4iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
-typedef void (gl2_APIENTRY *glUniformMatrix2fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
-typedef void (gl2_APIENTRY *glUniformMatrix3fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
-typedef void (gl2_APIENTRY *glUniformMatrix4fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
-typedef void (gl2_APIENTRY *glUseProgram_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glValidateProgram_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glVertexAttrib1f_client_proc_t) (void * ctx, GLuint, GLfloat);
-typedef void (gl2_APIENTRY *glVertexAttrib1fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
-typedef void (gl2_APIENTRY *glVertexAttrib2f_client_proc_t) (void * ctx, GLuint, GLfloat, GLfloat);
-typedef void (gl2_APIENTRY *glVertexAttrib2fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
-typedef void (gl2_APIENTRY *glVertexAttrib3f_client_proc_t) (void * ctx, GLuint, GLfloat, GLfloat, GLfloat);
-typedef void (gl2_APIENTRY *glVertexAttrib3fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
-typedef void (gl2_APIENTRY *glVertexAttrib4f_client_proc_t) (void * ctx, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (gl2_APIENTRY *glVertexAttrib4fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
-typedef void (gl2_APIENTRY *glVertexAttribPointer_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*);
-typedef void (gl2_APIENTRY *glViewport_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
-typedef void (gl2_APIENTRY *glEGLImageTargetTexture2DOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
-typedef void (gl2_APIENTRY *glEGLImageTargetRenderbufferStorageOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
-typedef void (gl2_APIENTRY *glGetProgramBinaryOES_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLenum*, GLvoid*);
-typedef void (gl2_APIENTRY *glProgramBinaryOES_client_proc_t) (void * ctx, GLuint, GLenum, const GLvoid*, GLint);
-typedef void* (gl2_APIENTRY *glMapBufferOES_client_proc_t) (void * ctx, GLenum, GLenum);
-typedef GLboolean (gl2_APIENTRY *glUnmapBufferOES_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glTexImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
-typedef void (gl2_APIENTRY *glTexSubImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
-typedef void (gl2_APIENTRY *glCopyTexSubImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-typedef void (gl2_APIENTRY *glCompressedTexImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
-typedef void (gl2_APIENTRY *glCompressedTexSubImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
-typedef void (gl2_APIENTRY *glFramebufferTexture3DOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint, GLint);
-typedef void (gl2_APIENTRY *glBindVertexArrayOES_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glDeleteVertexArraysOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl2_APIENTRY *glGenVertexArraysOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef GLboolean (gl2_APIENTRY *glIsVertexArrayOES_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glDiscardFramebufferEXT_client_proc_t) (void * ctx, GLenum, GLsizei, const GLenum*);
-typedef void (gl2_APIENTRY *glMultiDrawArraysEXT_client_proc_t) (void * ctx, GLenum, const GLint*, const GLsizei*, GLsizei);
-typedef void (gl2_APIENTRY *glMultiDrawElementsEXT_client_proc_t) (void * ctx, GLenum, const GLsizei*, GLenum, const GLvoid* const*, GLsizei);
-typedef void (gl2_APIENTRY *glGetPerfMonitorGroupsAMD_client_proc_t) (void * ctx, GLint*, GLsizei, GLuint*);
-typedef void (gl2_APIENTRY *glGetPerfMonitorCountersAMD_client_proc_t) (void * ctx, GLuint, GLint*, GLint*, GLsizei, GLuint*);
-typedef void (gl2_APIENTRY *glGetPerfMonitorGroupStringAMD_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
-typedef void (gl2_APIENTRY *glGetPerfMonitorCounterStringAMD_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLchar*);
-typedef void (gl2_APIENTRY *glGetPerfMonitorCounterInfoAMD_client_proc_t) (void * ctx, GLuint, GLuint, GLenum, GLvoid*);
-typedef void (gl2_APIENTRY *glGenPerfMonitorsAMD_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef void (gl2_APIENTRY *glDeletePerfMonitorsAMD_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef void (gl2_APIENTRY *glSelectPerfMonitorCountersAMD_client_proc_t) (void * ctx, GLuint, GLboolean, GLuint, GLint, GLuint*);
-typedef void (gl2_APIENTRY *glBeginPerfMonitorAMD_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glEndPerfMonitorAMD_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glGetPerfMonitorCounterDataAMD_client_proc_t) (void * ctx, GLuint, GLenum, GLsizei, GLuint*, GLint*);
-typedef void (gl2_APIENTRY *glRenderbufferStorageMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei);
-typedef void (gl2_APIENTRY *glFramebufferTexture2DMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
-typedef void (gl2_APIENTRY *glDeleteFencesNV_client_proc_t) (void * ctx, GLsizei, const GLuint*);
-typedef void (gl2_APIENTRY *glGenFencesNV_client_proc_t) (void * ctx, GLsizei, GLuint*);
-typedef GLboolean (gl2_APIENTRY *glIsFenceNV_client_proc_t) (void * ctx, GLuint);
-typedef GLboolean (gl2_APIENTRY *glTestFenceNV_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glGetFenceivNV_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
-typedef void (gl2_APIENTRY *glFinishFenceNV_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glSetFenceNV_client_proc_t) (void * ctx, GLuint, GLenum);
-typedef void (gl2_APIENTRY *glCoverageMaskNV_client_proc_t) (void * ctx, GLboolean);
-typedef void (gl2_APIENTRY *glCoverageOperationNV_client_proc_t) (void * ctx, GLenum);
-typedef void (gl2_APIENTRY *glGetDriverControlsQCOM_client_proc_t) (void * ctx, GLint*, GLsizei, GLuint*);
-typedef void (gl2_APIENTRY *glGetDriverControlStringQCOM_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
-typedef void (gl2_APIENTRY *glEnableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glDisableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glExtGetTexturesQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef void (gl2_APIENTRY *glExtGetBuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef void (gl2_APIENTRY *glExtGetRenderbuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef void (gl2_APIENTRY *glExtGetFramebuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef void (gl2_APIENTRY *glExtGetTexLevelParameterivQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLint, GLenum, GLint*);
-typedef void (gl2_APIENTRY *glExtTexObjectStateOverrideiQCOM_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
-typedef void (gl2_APIENTRY *glExtGetTexSubImageQCOM_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
-typedef void (gl2_APIENTRY *glExtGetBufferPointervQCOM_client_proc_t) (void * ctx, GLenum, GLvoidptr*);
-typedef void (gl2_APIENTRY *glExtGetShadersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef void (gl2_APIENTRY *glExtGetProgramsQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
-typedef GLboolean (gl2_APIENTRY *glExtIsProgramBinaryQCOM_client_proc_t) (void * ctx, GLuint);
-typedef void (gl2_APIENTRY *glExtGetProgramBinarySourceQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLchar*, GLint*);
-typedef void (gl2_APIENTRY *glStartTilingQCOM_client_proc_t) (void * ctx, GLuint, GLuint, GLuint, GLuint, GLbitfield);
-typedef void (gl2_APIENTRY *glEndTilingQCOM_client_proc_t) (void * ctx, GLbitfield);
-typedef void (gl2_APIENTRY *glVertexAttribPointerData_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLsizei, void*, GLuint);
-typedef void (gl2_APIENTRY *glVertexAttribPointerOffset_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint);
-typedef void (gl2_APIENTRY *glDrawElementsOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLuint);
-typedef void (gl2_APIENTRY *glDrawElementsData_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, void*, GLuint);
-typedef void (gl2_APIENTRY *glGetCompressedTextureFormats_client_proc_t) (void * ctx, int, GLint*);
-typedef void (gl2_APIENTRY *glShaderString_client_proc_t) (void * ctx, GLuint, const GLchar*, GLsizei);
-typedef int (gl2_APIENTRY *glFinishRoundTrip_client_proc_t) (void * ctx);
-
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-
-
-#include <memory>
-#include <string.h>
-#include "gl2_opcodes.h"
-
-#include "gl2_enc.h"
-
-
-#include <stdio.h>
-
-namespace {
-
-void enc_unsupported()
-{
- ALOGE("Function is unsupported\n");
-}
-
-void glActiveTexture_enc(void *self , GLenum texture)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &texture, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glAttachShader_enc(void *self , GLuint program, GLuint shader)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glAttachShader;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- memcpy(ptr, &shader, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBindAttribLocation_enc(void *self , GLuint program, GLuint index, const GLchar* name)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_name = (strlen(name) + 1);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_name + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindAttribLocation;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- memcpy(ptr, &index, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_name; ptr += 4;
- memcpy(ptr, name, __size_name);ptr += __size_name;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBindBuffer_enc(void *self , GLenum target, GLuint buffer)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &buffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBindFramebuffer_enc(void *self , GLenum target, GLuint framebuffer)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &framebuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBindRenderbuffer_enc(void *self , GLenum target, GLuint renderbuffer)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &renderbuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBindTexture_enc(void *self , GLenum target, GLuint texture)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindTexture;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &texture, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBlendColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBlendColor;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 4); ptr += 4;
- memcpy(ptr, &green, 4); ptr += 4;
- memcpy(ptr, &blue, 4); ptr += 4;
- memcpy(ptr, &alpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBlendEquation_enc(void *self , GLenum mode)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBlendEquation;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBlendEquationSeparate_enc(void *self , GLenum modeRGB, GLenum modeAlpha)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBlendEquationSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &modeRGB, 4); ptr += 4;
- memcpy(ptr, &modeAlpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBlendFunc_enc(void *self , GLenum sfactor, GLenum dfactor)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBlendFunc;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &sfactor, 4); ptr += 4;
- memcpy(ptr, &dfactor, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBlendFuncSeparate_enc(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBlendFuncSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &srcRGB, 4); ptr += 4;
- memcpy(ptr, &dstRGB, 4); ptr += 4;
- memcpy(ptr, &srcAlpha, 4); ptr += 4;
- memcpy(ptr, &dstAlpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBufferData_enc(void *self , GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = ((data != NULL) ? size : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4);
- ptr = buf;
- int tmp = OP_glBufferData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &size, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_data,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
- if (data != NULL) {
- stream->writeFully(data, __size_data);
- if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
- }
- buf = stream->alloc(4);
- ptr = buf;
- memcpy(ptr, &usage, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glBufferSubData_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = ((data != NULL) ? size : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glBufferSubData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
- memcpy(ptr, &size, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_data,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
- if (data != NULL) {
- stream->writeFully(data, __size_data);
- if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-GLenum glCheckFramebufferStatus_enc(void *self , GLenum target)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCheckFramebufferStatus;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLenum retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glCheckFramebufferStatus: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glClear_enc(void *self , GLbitfield mask)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClear;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mask, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClearColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearColor;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 4); ptr += 4;
- memcpy(ptr, &green, 4); ptr += 4;
- memcpy(ptr, &blue, 4); ptr += 4;
- memcpy(ptr, &alpha, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClearDepthf_enc(void *self , GLclampf depth)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearDepthf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &depth, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glClearStencil_enc(void *self , GLint s)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glClearStencil;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &s, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glColorMask_enc(void *self , GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 1 + 1 + 1 + 1;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glColorMask;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &red, 1); ptr += 1;
- memcpy(ptr, &green, 1); ptr += 1;
- memcpy(ptr, &blue, 1); ptr += 1;
- memcpy(ptr, &alpha, 1); ptr += 1;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glCompileShader_enc(void *self , GLuint shader)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCompileShader;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &shader, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glCompressedTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = ((data != NULL) ? imageSize : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glCompressedTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &border, 4); ptr += 4;
- memcpy(ptr, &imageSize, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_data,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
- if (data != NULL) {
- stream->writeFully(data, __size_data);
- if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glCompressedTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = ((data != NULL) ? imageSize : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glCompressedTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &xoffset, 4); ptr += 4;
- memcpy(ptr, &yoffset, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &imageSize, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_data,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
- if (data != NULL) {
- stream->writeFully(data, __size_data);
- if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glCopyTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCopyTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &border, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glCopyTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCopyTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &xoffset, 4); ptr += 4;
- memcpy(ptr, &yoffset, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-GLuint glCreateProgram_enc(void *self )
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCreateProgram;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLuint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glCreateProgram: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-GLuint glCreateShader_enc(void *self , GLenum type)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCreateShader;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &type, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLuint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glCreateShader: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glCullFace_enc(void *self , GLenum mode)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCullFace;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteBuffers_enc(void *self , GLsizei n, const GLuint* buffers)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_buffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_buffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_buffers; ptr += 4;
- memcpy(ptr, buffers, __size_buffers);ptr += __size_buffers;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteFramebuffers_enc(void *self , GLsizei n, const GLuint* framebuffers)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_framebuffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_framebuffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteFramebuffers;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
- memcpy(ptr, framebuffers, __size_framebuffers);ptr += __size_framebuffers;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteProgram_enc(void *self , GLuint program)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteProgram;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteRenderbuffers_enc(void *self , GLsizei n, const GLuint* renderbuffers)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_renderbuffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_renderbuffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteRenderbuffers;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
- memcpy(ptr, renderbuffers, __size_renderbuffers);ptr += __size_renderbuffers;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteShader_enc(void *self , GLuint shader)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteShader;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &shader, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteTextures_enc(void *self , GLsizei n, const GLuint* textures)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_textures = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_textures + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteTextures;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_textures; ptr += 4;
- memcpy(ptr, textures, __size_textures);ptr += __size_textures;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDepthFunc_enc(void *self , GLenum func)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDepthFunc;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &func, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDepthMask_enc(void *self , GLboolean flag)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 1;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDepthMask;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &flag, 1); ptr += 1;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDepthRangef_enc(void *self , GLclampf zNear, GLclampf zFar)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDepthRangef;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &zNear, 4); ptr += 4;
- memcpy(ptr, &zFar, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDetachShader_enc(void *self , GLuint program, GLuint shader)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDetachShader;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- memcpy(ptr, &shader, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDisable_enc(void *self , GLenum cap)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDisable;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &cap, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDisableVertexAttribArray_enc(void *self , GLuint index)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDisableVertexAttribArray;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &index, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawArrays_enc(void *self , GLenum mode, GLint first, GLsizei count)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawArrays;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
- memcpy(ptr, &first, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glEnable_enc(void *self , GLenum cap)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glEnable;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &cap, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glEnableVertexAttribArray_enc(void *self , GLuint index)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glEnableVertexAttribArray;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &index, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFinish_enc(void *self )
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFinish;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFlush_enc(void *self )
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFlush;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFramebufferRenderbuffer_enc(void *self , GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFramebufferRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &attachment, 4); ptr += 4;
- memcpy(ptr, &renderbuffertarget, 4); ptr += 4;
- memcpy(ptr, &renderbuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFramebufferTexture2D_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFramebufferTexture2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &attachment, 4); ptr += 4;
- memcpy(ptr, &textarget, 4); ptr += 4;
- memcpy(ptr, &texture, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glFrontFace_enc(void *self , GLenum mode)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFrontFace;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGenBuffers_enc(void *self , GLsizei n, GLuint* buffers)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_buffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_buffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_buffers; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(buffers, __size_buffers);
- if (useChecksum) checksumCalculator->addBuffer(buffers, __size_buffers);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGenBuffers: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGenerateMipmap_enc(void *self , GLenum target)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenerateMipmap;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGenFramebuffers_enc(void *self , GLsizei n, GLuint* framebuffers)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_framebuffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_framebuffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenFramebuffers;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(framebuffers, __size_framebuffers);
- if (useChecksum) checksumCalculator->addBuffer(framebuffers, __size_framebuffers);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGenFramebuffers: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGenRenderbuffers_enc(void *self , GLsizei n, GLuint* renderbuffers)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_renderbuffers = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_renderbuffers + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenRenderbuffers;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(renderbuffers, __size_renderbuffers);
- if (useChecksum) checksumCalculator->addBuffer(renderbuffers, __size_renderbuffers);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGenRenderbuffers: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGenTextures_enc(void *self , GLsizei n, GLuint* textures)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_textures = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_textures + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenTextures;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_textures; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(textures, __size_textures);
- if (useChecksum) checksumCalculator->addBuffer(textures, __size_textures);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGenTextures: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetActiveAttrib_enc(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_length = ((length != NULL) ? (sizeof(GLsizei)) : 0);
- const unsigned int __size_size = ((size != NULL) ? (sizeof(GLint)) : 0);
- const unsigned int __size_type = ((type != NULL) ? (sizeof(GLenum)) : 0);
- const unsigned int __size_name = ((name != NULL) ? bufsize : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_length + __size_size + __size_type + __size_name + 4*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetActiveAttrib;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- memcpy(ptr, &index, 4); ptr += 4;
- memcpy(ptr, &bufsize, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_length; ptr += 4;
- *(unsigned int *)(ptr) = __size_size; ptr += 4;
- *(unsigned int *)(ptr) = __size_type; ptr += 4;
- *(unsigned int *)(ptr) = __size_name; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- if (length != NULL) {
- stream->readback(length, __size_length);
- if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
- }
- if (size != NULL) {
- stream->readback(size, __size_size);
- if (useChecksum) checksumCalculator->addBuffer(size, __size_size);
- }
- if (type != NULL) {
- stream->readback(type, __size_type);
- if (useChecksum) checksumCalculator->addBuffer(type, __size_type);
- }
- if (name != NULL) {
- stream->readback(name, __size_name);
- if (useChecksum) checksumCalculator->addBuffer(name, __size_name);
- }
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetActiveAttrib: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetActiveUniform_enc(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_length = ((length != NULL) ? (sizeof(GLsizei)) : 0);
- const unsigned int __size_size = ((size != NULL) ? (sizeof(GLint)) : 0);
- const unsigned int __size_type = ((type != NULL) ? (sizeof(GLenum)) : 0);
- const unsigned int __size_name = ((name != NULL) ? bufsize : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_length + __size_size + __size_type + __size_name + 4*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetActiveUniform;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- memcpy(ptr, &index, 4); ptr += 4;
- memcpy(ptr, &bufsize, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_length; ptr += 4;
- *(unsigned int *)(ptr) = __size_size; ptr += 4;
- *(unsigned int *)(ptr) = __size_type; ptr += 4;
- *(unsigned int *)(ptr) = __size_name; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- if (length != NULL) {
- stream->readback(length, __size_length);
- if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
- }
- if (size != NULL) {
- stream->readback(size, __size_size);
- if (useChecksum) checksumCalculator->addBuffer(size, __size_size);
- }
- if (type != NULL) {
- stream->readback(type, __size_type);
- if (useChecksum) checksumCalculator->addBuffer(type, __size_type);
- }
- if (name != NULL) {
- stream->readback(name, __size_name);
- if (useChecksum) checksumCalculator->addBuffer(name, __size_name);
- }
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetActiveUniform: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetAttachedShaders_enc(void *self , GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_count = ((count != NULL) ? (sizeof(GLsizei)) : 0);
- const unsigned int __size_shaders = (maxcount*sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_count + __size_shaders + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetAttachedShaders;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- memcpy(ptr, &maxcount, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_count; ptr += 4;
- *(unsigned int *)(ptr) = __size_shaders; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- if (count != NULL) {
- stream->readback(count, __size_count);
- if (useChecksum) checksumCalculator->addBuffer(count, __size_count);
- }
- stream->readback(shaders, __size_shaders);
- if (useChecksum) checksumCalculator->addBuffer(shaders, __size_shaders);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetAttachedShaders: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-int glGetAttribLocation_enc(void *self , GLuint program, const GLchar* name)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_name = (strlen(name) + 1);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_name + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetAttribLocation;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_name; ptr += 4;
- memcpy(ptr, name, __size_name);ptr += __size_name;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- int retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetAttribLocation: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glGetBooleanv_enc(void *self , GLenum pname, GLboolean* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLboolean));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetBooleanv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetBooleanv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetBufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetBufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetBufferParameteriv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-GLenum glGetError_enc(void *self )
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetError;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLenum retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetError: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glGetFloatv_enc(void *self , GLenum pname, GLfloat* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetFloatv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetFloatv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetFramebufferAttachmentParameteriv_enc(void *self , GLenum target, GLenum attachment, GLenum pname, GLint* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetFramebufferAttachmentParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &attachment, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetFramebufferAttachmentParameteriv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetIntegerv_enc(void *self , GLenum pname, GLint* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetIntegerv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetIntegerv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetProgramiv_enc(void *self , GLuint program, GLenum pname, GLint* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = sizeof(GLint);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetProgramiv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetProgramiv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetProgramInfoLog_enc(void *self , GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_length = ((length != NULL) ? sizeof(GLsizei) : 0);
- const unsigned int __size_infolog = bufsize;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_length + __size_infolog + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetProgramInfoLog;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- memcpy(ptr, &bufsize, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_length; ptr += 4;
- *(unsigned int *)(ptr) = __size_infolog; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- if (length != NULL) {
- stream->readback(length, __size_length);
- if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
- }
- stream->readback(infolog, __size_infolog);
- if (useChecksum) checksumCalculator->addBuffer(infolog, __size_infolog);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetProgramInfoLog: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetRenderbufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = sizeof(GLint);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetRenderbufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetRenderbufferParameteriv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetShaderiv_enc(void *self , GLuint shader, GLenum pname, GLint* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = sizeof(GLint);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetShaderiv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &shader, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetShaderiv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetShaderInfoLog_enc(void *self , GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_length = ((length != NULL) ? (sizeof(GLsizei)) : 0);
- const unsigned int __size_infolog = bufsize;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_length + __size_infolog + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetShaderInfoLog;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &shader, 4); ptr += 4;
- memcpy(ptr, &bufsize, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_length; ptr += 4;
- *(unsigned int *)(ptr) = __size_infolog; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- if (length != NULL) {
- stream->readback(length, __size_length);
- if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
- }
- stream->readback(infolog, __size_infolog);
- if (useChecksum) checksumCalculator->addBuffer(infolog, __size_infolog);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetShaderInfoLog: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetShaderPrecisionFormat_enc(void *self , GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_range = (2 * sizeof(GLint));
- const unsigned int __size_precision = (sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_range + __size_precision + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetShaderPrecisionFormat;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &shadertype, 4); ptr += 4;
- memcpy(ptr, &precisiontype, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_range; ptr += 4;
- *(unsigned int *)(ptr) = __size_precision; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(range, __size_range);
- if (useChecksum) checksumCalculator->addBuffer(range, __size_range);
- stream->readback(precision, __size_precision);
- if (useChecksum) checksumCalculator->addBuffer(precision, __size_precision);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetShaderPrecisionFormat: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetShaderSource_enc(void *self , GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_length = ((length != NULL) ? (sizeof(GLsizei)) : 0);
- const unsigned int __size_source = bufsize;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_length + __size_source + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetShaderSource;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &shader, 4); ptr += 4;
- memcpy(ptr, &bufsize, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_length; ptr += 4;
- *(unsigned int *)(ptr) = __size_source; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- if (length != NULL) {
- stream->readback(length, __size_length);
- if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
- }
- stream->readback(source, __size_source);
- if (useChecksum) checksumCalculator->addBuffer(source, __size_source);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetShaderSource: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetTexParameterfv_enc(void *self , GLenum target, GLenum pname, GLfloat* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetTexParameterfv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetTexParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetTexParameteriv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetUniformfv_enc(void *self , GLuint program, GLint location, GLfloat* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = glSizeof(glesv2_enc::uniformType(self, program, location));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetUniformfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- memcpy(ptr, &location, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetUniformfv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetUniformiv_enc(void *self , GLuint program, GLint location, GLint* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = glSizeof(glesv2_enc::uniformType(self, program, location));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetUniformiv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- memcpy(ptr, &location, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetUniformiv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-int glGetUniformLocation_enc(void *self , GLuint program, const GLchar* name)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_name = (strlen(name) + 1);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_name + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetUniformLocation;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_name; ptr += 4;
- memcpy(ptr, name, __size_name);ptr += __size_name;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- int retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetUniformLocation: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glGetVertexAttribfv_enc(void *self , GLuint index, GLenum pname, GLfloat* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetVertexAttribfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &index, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetVertexAttribfv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glGetVertexAttribiv_enc(void *self , GLuint index, GLenum pname, GLint* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetVertexAttribiv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &index, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(params, __size_params);
- if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetVertexAttribiv: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glHint_enc(void *self , GLenum target, GLenum mode)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glHint;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &mode, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-GLboolean glIsBuffer_enc(void *self , GLuint buffer)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &buffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsBuffer: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-GLboolean glIsEnabled_enc(void *self , GLenum cap)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsEnabled;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &cap, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsEnabled: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-GLboolean glIsFramebuffer_enc(void *self , GLuint framebuffer)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &framebuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsFramebuffer: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-GLboolean glIsProgram_enc(void *self , GLuint program)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsProgram;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsProgram: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-GLboolean glIsRenderbuffer_enc(void *self , GLuint renderbuffer)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &renderbuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsRenderbuffer: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-GLboolean glIsShader_enc(void *self , GLuint shader)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsShader;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &shader, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsShader: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-GLboolean glIsTexture_enc(void *self , GLuint texture)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsTexture;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &texture, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsTexture: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glLineWidth_enc(void *self , GLfloat width)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLineWidth;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &width, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glLinkProgram_enc(void *self , GLuint program)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glLinkProgram;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPixelStorei_enc(void *self , GLenum pname, GLint param)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPixelStorei;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glPolygonOffset_enc(void *self , GLfloat factor, GLfloat units)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glPolygonOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &factor, 4); ptr += 4;
- memcpy(ptr, &units, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glReadPixels_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_pixels = glesv2_enc::pixelDataSize(self, width, height, format, type, 1);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glReadPixels;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_pixels; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(pixels, __size_pixels);
- if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glReadPixels: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glReleaseShaderCompiler_enc(void *self )
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glReleaseShaderCompiler;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glRenderbufferStorage_enc(void *self , GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glRenderbufferStorage;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glSampleCoverage_enc(void *self , GLclampf value, GLboolean invert)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 1;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glSampleCoverage;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &value, 4); ptr += 4;
- memcpy(ptr, &invert, 1); ptr += 1;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glScissor_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glScissor;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glStencilFunc_enc(void *self , GLenum func, GLint ref, GLuint mask)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glStencilFunc;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &func, 4); ptr += 4;
- memcpy(ptr, &ref, 4); ptr += 4;
- memcpy(ptr, &mask, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glStencilFuncSeparate_enc(void *self , GLenum face, GLenum func, GLint ref, GLuint mask)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glStencilFuncSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &func, 4); ptr += 4;
- memcpy(ptr, &ref, 4); ptr += 4;
- memcpy(ptr, &mask, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glStencilMask_enc(void *self , GLuint mask)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glStencilMask;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mask, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glStencilMaskSeparate_enc(void *self , GLenum face, GLuint mask)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glStencilMaskSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &mask, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glStencilOp_enc(void *self , GLenum fail, GLenum zfail, GLenum zpass)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glStencilOp;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &fail, 4); ptr += 4;
- memcpy(ptr, &zfail, 4); ptr += 4;
- memcpy(ptr, &zpass, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glStencilOpSeparate_enc(void *self , GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glStencilOpSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &face, 4); ptr += 4;
- memcpy(ptr, &fail, 4); ptr += 4;
- memcpy(ptr, &zfail, 4); ptr += 4;
- memcpy(ptr, &zpass, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexImage2D_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_pixels = ((pixels != NULL) ? glesv2_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &border, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_pixels,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
- if (pixels != NULL) {
- stream->writeFully(pixels, __size_pixels);
- if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glTexParameterf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexParameterfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexParameteri_enc(void *self , GLenum target, GLenum pname, GLint param)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexParameteriv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_params = (glUtilsParamSize(pname) * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &pname, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_params; ptr += 4;
- memcpy(ptr, params, __size_params);ptr += __size_params;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_pixels = ((pixels != NULL) ? glesv2_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &xoffset, 4); ptr += 4;
- memcpy(ptr, &yoffset, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_pixels,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
- if (pixels != NULL) {
- stream->writeFully(pixels, __size_pixels);
- if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glUniform1f_enc(void *self , GLint location, GLfloat x)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform1f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform1fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_v = (count * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform1fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_v; ptr += 4;
- memcpy(ptr, v, __size_v);ptr += __size_v;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform1i_enc(void *self , GLint location, GLint x)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform1i;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform1iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_v = (count * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform1iv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_v; ptr += 4;
- memcpy(ptr, v, __size_v);ptr += __size_v;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform2f_enc(void *self , GLint location, GLfloat x, GLfloat y)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform2f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform2fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_v = (count * 2 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform2fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_v; ptr += 4;
- memcpy(ptr, v, __size_v);ptr += __size_v;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform2i_enc(void *self , GLint location, GLint x, GLint y)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform2i;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform2iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_v = (count * 2 * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform2iv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_v; ptr += 4;
- memcpy(ptr, v, __size_v);ptr += __size_v;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform3f_enc(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform3f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform3fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_v = (count * 3 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform3fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_v; ptr += 4;
- memcpy(ptr, v, __size_v);ptr += __size_v;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform3i_enc(void *self , GLint location, GLint x, GLint y, GLint z)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform3i;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform3iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_v = (3 * count * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform3iv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_v; ptr += 4;
- memcpy(ptr, v, __size_v);ptr += __size_v;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform4f_enc(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform4f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
- memcpy(ptr, &w, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform4fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_v = (4 * count * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform4fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_v; ptr += 4;
- memcpy(ptr, v, __size_v);ptr += __size_v;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform4i_enc(void *self , GLint location, GLint x, GLint y, GLint z, GLint w)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform4i;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
- memcpy(ptr, &w, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniform4iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_v = (4 * count * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniform4iv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_v; ptr += 4;
- memcpy(ptr, v, __size_v);ptr += __size_v;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniformMatrix2fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_value = (count * 4 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniformMatrix2fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- memcpy(ptr, &transpose, 1); ptr += 1;
- *(unsigned int *)(ptr) = __size_value; ptr += 4;
- memcpy(ptr, value, __size_value);ptr += __size_value;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniformMatrix3fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_value = (count * 9 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniformMatrix3fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- memcpy(ptr, &transpose, 1); ptr += 1;
- *(unsigned int *)(ptr) = __size_value; ptr += 4;
- memcpy(ptr, value, __size_value);ptr += __size_value;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUniformMatrix4fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_value = (count * 16 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUniformMatrix4fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &location, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- memcpy(ptr, &transpose, 1); ptr += 1;
- *(unsigned int *)(ptr) = __size_value; ptr += 4;
- memcpy(ptr, value, __size_value);ptr += __size_value;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glUseProgram_enc(void *self , GLuint program)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUseProgram;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glValidateProgram_enc(void *self , GLuint program)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glValidateProgram;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &program, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexAttrib1f_enc(void *self , GLuint indx, GLfloat x)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexAttrib1f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &indx, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexAttrib1fv_enc(void *self , GLuint indx, const GLfloat* values)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_values = (sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_values + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexAttrib1fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &indx, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_values; ptr += 4;
- memcpy(ptr, values, __size_values);ptr += __size_values;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexAttrib2f_enc(void *self , GLuint indx, GLfloat x, GLfloat y)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexAttrib2f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &indx, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexAttrib2fv_enc(void *self , GLuint indx, const GLfloat* values)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_values = (2 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_values + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexAttrib2fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &indx, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_values; ptr += 4;
- memcpy(ptr, values, __size_values);ptr += __size_values;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexAttrib3f_enc(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexAttrib3f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &indx, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexAttrib3fv_enc(void *self , GLuint indx, const GLfloat* values)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_values = (3 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_values + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexAttrib3fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &indx, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_values; ptr += 4;
- memcpy(ptr, values, __size_values);ptr += __size_values;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexAttrib4f_enc(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexAttrib4f;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &indx, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &z, 4); ptr += 4;
- memcpy(ptr, &w, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexAttrib4fv_enc(void *self , GLuint indx, const GLfloat* values)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_values = (4 * sizeof(GLfloat));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_values + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexAttrib4fv;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &indx, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_values; ptr += 4;
- memcpy(ptr, values, __size_values);ptr += __size_values;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glViewport_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glViewport;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glEGLImageTargetTexture2DOES_enc(void *self , GLenum target, GLeglImageOES image)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glEGLImageTargetTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &image, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glEGLImageTargetRenderbufferStorageOES_enc(void *self , GLenum target, GLeglImageOES image)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glEGLImageTargetRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &image, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-GLboolean glUnmapBufferOES_enc(void *self , GLenum target)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glUnmapBufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glUnmapBufferOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glTexImage3DOES_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_pixels = ((pixels != NULL) ? glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glTexImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &depth, 4); ptr += 4;
- memcpy(ptr, &border, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_pixels,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
- if (pixels != NULL) {
- stream->writeFully(pixels, __size_pixels);
- if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_pixels = ((pixels != NULL) ? glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glTexSubImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &xoffset, 4); ptr += 4;
- memcpy(ptr, &yoffset, 4); ptr += 4;
- memcpy(ptr, &zoffset, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &depth, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_pixels,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
- if (pixels != NULL) {
- stream->writeFully(pixels, __size_pixels);
- if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glCopyTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glCopyTexSubImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &xoffset, 4); ptr += 4;
- memcpy(ptr, &yoffset, 4); ptr += 4;
- memcpy(ptr, &zoffset, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glCompressedTexImage3DOES_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = ((data != NULL) ? imageSize : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glCompressedTexImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &internalformat, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &depth, 4); ptr += 4;
- memcpy(ptr, &border, 4); ptr += 4;
- memcpy(ptr, &imageSize, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_data,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
- if (data != NULL) {
- stream->writeFully(data, __size_data);
- if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glCompressedTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = ((data != NULL) ? imageSize : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_glCompressedTexSubImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &xoffset, 4); ptr += 4;
- memcpy(ptr, &yoffset, 4); ptr += 4;
- memcpy(ptr, &zoffset, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &depth, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &imageSize, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_data,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
- if (data != NULL) {
- stream->writeFully(data, __size_data);
- if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
- }
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-}
-
-void glFramebufferTexture3DOES_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFramebufferTexture3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &attachment, 4); ptr += 4;
- memcpy(ptr, &textarget, 4); ptr += 4;
- memcpy(ptr, &texture, 4); ptr += 4;
- memcpy(ptr, &level, 4); ptr += 4;
- memcpy(ptr, &zoffset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glBindVertexArrayOES_enc(void *self , GLuint array)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glBindVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &array, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDeleteVertexArraysOES_enc(void *self , GLsizei n, const GLuint* arrays)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_arrays = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_arrays + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDeleteVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_arrays; ptr += 4;
- memcpy(ptr, arrays, __size_arrays);ptr += __size_arrays;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGenVertexArraysOES_enc(void *self , GLsizei n, GLuint* arrays)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_arrays = (n * sizeof(GLuint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_arrays + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGenVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &n, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_arrays; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(arrays, __size_arrays);
- if (useChecksum) checksumCalculator->addBuffer(arrays, __size_arrays);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGenVertexArraysOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-GLboolean glIsVertexArrayOES_enc(void *self , GLuint array)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glIsVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &array, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLboolean retval;
- stream->readback(&retval, 1);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glIsVertexArrayOES: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void glDiscardFramebufferEXT_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_attachments = (numAttachments * sizeof(GLenum));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_attachments + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDiscardFramebufferEXT;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &numAttachments, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_attachments; ptr += 4;
- memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexAttribPointerData_enc(void *self , GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = datalen;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexAttribPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &indx, 4); ptr += 4;
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &normalized, 1); ptr += 1;
- memcpy(ptr, &stride, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
- memcpy(ptr, &datalen, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glVertexAttribPointerOffset_enc(void *self , GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glVertexAttribPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &indx, 4); ptr += 4;
- memcpy(ptr, &size, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &normalized, 1); ptr += 1;
- memcpy(ptr, &stride, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawElementsOffset_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawElementsOffset;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- memcpy(ptr, &offset, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glDrawElementsData_enc(void *self , GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_data = datalen;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glDrawElementsData;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &mode, 4); ptr += 4;
- memcpy(ptr, &count, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_data; ptr += 4;
- memcpy(ptr, data, __size_data);ptr += __size_data;
- memcpy(ptr, &datalen, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void glGetCompressedTextureFormats_enc(void *self , int count, GLint* formats)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_formats = (count * sizeof(GLint));
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_formats + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glGetCompressedTextureFormats;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &count, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_formats; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(formats, __size_formats);
- if (useChecksum) checksumCalculator->addBuffer(formats, __size_formats);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glGetCompressedTextureFormats: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-void glShaderString_enc(void *self , GLuint shader, const GLchar* string, GLsizei len)
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_string = len;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_string + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glShaderString;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &shader, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_string; ptr += 4;
- memcpy(ptr, string, __size_string);ptr += __size_string;
- memcpy(ptr, &len, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-int glFinishRoundTrip_enc(void *self )
-{
-
- gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_glFinishRoundTrip;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- int retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("glFinishRoundTrip: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-} // namespace
-
-gl2_encoder_context_t::gl2_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
-{
- m_stream = stream;
- m_checksumCalculator = checksumCalculator;
-
- this->glActiveTexture = &glActiveTexture_enc;
- this->glAttachShader = &glAttachShader_enc;
- this->glBindAttribLocation = &glBindAttribLocation_enc;
- this->glBindBuffer = &glBindBuffer_enc;
- this->glBindFramebuffer = &glBindFramebuffer_enc;
- this->glBindRenderbuffer = &glBindRenderbuffer_enc;
- this->glBindTexture = &glBindTexture_enc;
- this->glBlendColor = &glBlendColor_enc;
- this->glBlendEquation = &glBlendEquation_enc;
- this->glBlendEquationSeparate = &glBlendEquationSeparate_enc;
- this->glBlendFunc = &glBlendFunc_enc;
- this->glBlendFuncSeparate = &glBlendFuncSeparate_enc;
- this->glBufferData = &glBufferData_enc;
- this->glBufferSubData = &glBufferSubData_enc;
- this->glCheckFramebufferStatus = &glCheckFramebufferStatus_enc;
- this->glClear = &glClear_enc;
- this->glClearColor = &glClearColor_enc;
- this->glClearDepthf = &glClearDepthf_enc;
- this->glClearStencil = &glClearStencil_enc;
- this->glColorMask = &glColorMask_enc;
- this->glCompileShader = &glCompileShader_enc;
- this->glCompressedTexImage2D = &glCompressedTexImage2D_enc;
- this->glCompressedTexSubImage2D = &glCompressedTexSubImage2D_enc;
- this->glCopyTexImage2D = &glCopyTexImage2D_enc;
- this->glCopyTexSubImage2D = &glCopyTexSubImage2D_enc;
- this->glCreateProgram = &glCreateProgram_enc;
- this->glCreateShader = &glCreateShader_enc;
- this->glCullFace = &glCullFace_enc;
- this->glDeleteBuffers = &glDeleteBuffers_enc;
- this->glDeleteFramebuffers = &glDeleteFramebuffers_enc;
- this->glDeleteProgram = &glDeleteProgram_enc;
- this->glDeleteRenderbuffers = &glDeleteRenderbuffers_enc;
- this->glDeleteShader = &glDeleteShader_enc;
- this->glDeleteTextures = &glDeleteTextures_enc;
- this->glDepthFunc = &glDepthFunc_enc;
- this->glDepthMask = &glDepthMask_enc;
- this->glDepthRangef = &glDepthRangef_enc;
- this->glDetachShader = &glDetachShader_enc;
- this->glDisable = &glDisable_enc;
- this->glDisableVertexAttribArray = &glDisableVertexAttribArray_enc;
- this->glDrawArrays = &glDrawArrays_enc;
- this->glDrawElements = (glDrawElements_client_proc_t) &enc_unsupported;
- this->glEnable = &glEnable_enc;
- this->glEnableVertexAttribArray = &glEnableVertexAttribArray_enc;
- this->glFinish = &glFinish_enc;
- this->glFlush = &glFlush_enc;
- this->glFramebufferRenderbuffer = &glFramebufferRenderbuffer_enc;
- this->glFramebufferTexture2D = &glFramebufferTexture2D_enc;
- this->glFrontFace = &glFrontFace_enc;
- this->glGenBuffers = &glGenBuffers_enc;
- this->glGenerateMipmap = &glGenerateMipmap_enc;
- this->glGenFramebuffers = &glGenFramebuffers_enc;
- this->glGenRenderbuffers = &glGenRenderbuffers_enc;
- this->glGenTextures = &glGenTextures_enc;
- this->glGetActiveAttrib = &glGetActiveAttrib_enc;
- this->glGetActiveUniform = &glGetActiveUniform_enc;
- this->glGetAttachedShaders = &glGetAttachedShaders_enc;
- this->glGetAttribLocation = &glGetAttribLocation_enc;
- this->glGetBooleanv = &glGetBooleanv_enc;
- this->glGetBufferParameteriv = &glGetBufferParameteriv_enc;
- this->glGetError = &glGetError_enc;
- this->glGetFloatv = &glGetFloatv_enc;
- this->glGetFramebufferAttachmentParameteriv = &glGetFramebufferAttachmentParameteriv_enc;
- this->glGetIntegerv = &glGetIntegerv_enc;
- this->glGetProgramiv = &glGetProgramiv_enc;
- this->glGetProgramInfoLog = &glGetProgramInfoLog_enc;
- this->glGetRenderbufferParameteriv = &glGetRenderbufferParameteriv_enc;
- this->glGetShaderiv = &glGetShaderiv_enc;
- this->glGetShaderInfoLog = &glGetShaderInfoLog_enc;
- this->glGetShaderPrecisionFormat = &glGetShaderPrecisionFormat_enc;
- this->glGetShaderSource = &glGetShaderSource_enc;
- this->glGetString = (glGetString_client_proc_t) &enc_unsupported;
- this->glGetTexParameterfv = &glGetTexParameterfv_enc;
- this->glGetTexParameteriv = &glGetTexParameteriv_enc;
- this->glGetUniformfv = &glGetUniformfv_enc;
- this->glGetUniformiv = &glGetUniformiv_enc;
- this->glGetUniformLocation = &glGetUniformLocation_enc;
- this->glGetVertexAttribfv = &glGetVertexAttribfv_enc;
- this->glGetVertexAttribiv = &glGetVertexAttribiv_enc;
- this->glGetVertexAttribPointerv = (glGetVertexAttribPointerv_client_proc_t) &enc_unsupported;
- this->glHint = &glHint_enc;
- this->glIsBuffer = &glIsBuffer_enc;
- this->glIsEnabled = &glIsEnabled_enc;
- this->glIsFramebuffer = &glIsFramebuffer_enc;
- this->glIsProgram = &glIsProgram_enc;
- this->glIsRenderbuffer = &glIsRenderbuffer_enc;
- this->glIsShader = &glIsShader_enc;
- this->glIsTexture = &glIsTexture_enc;
- this->glLineWidth = &glLineWidth_enc;
- this->glLinkProgram = &glLinkProgram_enc;
- this->glPixelStorei = &glPixelStorei_enc;
- this->glPolygonOffset = &glPolygonOffset_enc;
- this->glReadPixels = &glReadPixels_enc;
- this->glReleaseShaderCompiler = &glReleaseShaderCompiler_enc;
- this->glRenderbufferStorage = &glRenderbufferStorage_enc;
- this->glSampleCoverage = &glSampleCoverage_enc;
- this->glScissor = &glScissor_enc;
- this->glShaderBinary = (glShaderBinary_client_proc_t) &enc_unsupported;
- this->glShaderSource = (glShaderSource_client_proc_t) &enc_unsupported;
- this->glStencilFunc = &glStencilFunc_enc;
- this->glStencilFuncSeparate = &glStencilFuncSeparate_enc;
- this->glStencilMask = &glStencilMask_enc;
- this->glStencilMaskSeparate = &glStencilMaskSeparate_enc;
- this->glStencilOp = &glStencilOp_enc;
- this->glStencilOpSeparate = &glStencilOpSeparate_enc;
- this->glTexImage2D = &glTexImage2D_enc;
- this->glTexParameterf = &glTexParameterf_enc;
- this->glTexParameterfv = &glTexParameterfv_enc;
- this->glTexParameteri = &glTexParameteri_enc;
- this->glTexParameteriv = &glTexParameteriv_enc;
- this->glTexSubImage2D = &glTexSubImage2D_enc;
- this->glUniform1f = &glUniform1f_enc;
- this->glUniform1fv = &glUniform1fv_enc;
- this->glUniform1i = &glUniform1i_enc;
- this->glUniform1iv = &glUniform1iv_enc;
- this->glUniform2f = &glUniform2f_enc;
- this->glUniform2fv = &glUniform2fv_enc;
- this->glUniform2i = &glUniform2i_enc;
- this->glUniform2iv = &glUniform2iv_enc;
- this->glUniform3f = &glUniform3f_enc;
- this->glUniform3fv = &glUniform3fv_enc;
- this->glUniform3i = &glUniform3i_enc;
- this->glUniform3iv = &glUniform3iv_enc;
- this->glUniform4f = &glUniform4f_enc;
- this->glUniform4fv = &glUniform4fv_enc;
- this->glUniform4i = &glUniform4i_enc;
- this->glUniform4iv = &glUniform4iv_enc;
- this->glUniformMatrix2fv = &glUniformMatrix2fv_enc;
- this->glUniformMatrix3fv = &glUniformMatrix3fv_enc;
- this->glUniformMatrix4fv = &glUniformMatrix4fv_enc;
- this->glUseProgram = &glUseProgram_enc;
- this->glValidateProgram = &glValidateProgram_enc;
- this->glVertexAttrib1f = &glVertexAttrib1f_enc;
- this->glVertexAttrib1fv = &glVertexAttrib1fv_enc;
- this->glVertexAttrib2f = &glVertexAttrib2f_enc;
- this->glVertexAttrib2fv = &glVertexAttrib2fv_enc;
- this->glVertexAttrib3f = &glVertexAttrib3f_enc;
- this->glVertexAttrib3fv = &glVertexAttrib3fv_enc;
- this->glVertexAttrib4f = &glVertexAttrib4f_enc;
- this->glVertexAttrib4fv = &glVertexAttrib4fv_enc;
- this->glVertexAttribPointer = (glVertexAttribPointer_client_proc_t) &enc_unsupported;
- this->glViewport = &glViewport_enc;
- this->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES_enc;
- this->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES_enc;
- this->glGetProgramBinaryOES = (glGetProgramBinaryOES_client_proc_t) &enc_unsupported;
- this->glProgramBinaryOES = (glProgramBinaryOES_client_proc_t) &enc_unsupported;
- this->glMapBufferOES = (glMapBufferOES_client_proc_t) &enc_unsupported;
- this->glUnmapBufferOES = &glUnmapBufferOES_enc;
- this->glTexImage3DOES = &glTexImage3DOES_enc;
- this->glTexSubImage3DOES = &glTexSubImage3DOES_enc;
- this->glCopyTexSubImage3DOES = &glCopyTexSubImage3DOES_enc;
- this->glCompressedTexImage3DOES = &glCompressedTexImage3DOES_enc;
- this->glCompressedTexSubImage3DOES = &glCompressedTexSubImage3DOES_enc;
- this->glFramebufferTexture3DOES = &glFramebufferTexture3DOES_enc;
- this->glBindVertexArrayOES = &glBindVertexArrayOES_enc;
- this->glDeleteVertexArraysOES = &glDeleteVertexArraysOES_enc;
- this->glGenVertexArraysOES = &glGenVertexArraysOES_enc;
- this->glIsVertexArrayOES = &glIsVertexArrayOES_enc;
- this->glDiscardFramebufferEXT = &glDiscardFramebufferEXT_enc;
- this->glMultiDrawArraysEXT = (glMultiDrawArraysEXT_client_proc_t) &enc_unsupported;
- this->glMultiDrawElementsEXT = (glMultiDrawElementsEXT_client_proc_t) &enc_unsupported;
- this->glGetPerfMonitorGroupsAMD = (glGetPerfMonitorGroupsAMD_client_proc_t) &enc_unsupported;
- this->glGetPerfMonitorCountersAMD = (glGetPerfMonitorCountersAMD_client_proc_t) &enc_unsupported;
- this->glGetPerfMonitorGroupStringAMD = (glGetPerfMonitorGroupStringAMD_client_proc_t) &enc_unsupported;
- this->glGetPerfMonitorCounterStringAMD = (glGetPerfMonitorCounterStringAMD_client_proc_t) &enc_unsupported;
- this->glGetPerfMonitorCounterInfoAMD = (glGetPerfMonitorCounterInfoAMD_client_proc_t) &enc_unsupported;
- this->glGenPerfMonitorsAMD = (glGenPerfMonitorsAMD_client_proc_t) &enc_unsupported;
- this->glDeletePerfMonitorsAMD = (glDeletePerfMonitorsAMD_client_proc_t) &enc_unsupported;
- this->glSelectPerfMonitorCountersAMD = (glSelectPerfMonitorCountersAMD_client_proc_t) &enc_unsupported;
- this->glBeginPerfMonitorAMD = (glBeginPerfMonitorAMD_client_proc_t) &enc_unsupported;
- this->glEndPerfMonitorAMD = (glEndPerfMonitorAMD_client_proc_t) &enc_unsupported;
- this->glGetPerfMonitorCounterDataAMD = (glGetPerfMonitorCounterDataAMD_client_proc_t) &enc_unsupported;
- this->glRenderbufferStorageMultisampleIMG = (glRenderbufferStorageMultisampleIMG_client_proc_t) &enc_unsupported;
- this->glFramebufferTexture2DMultisampleIMG = (glFramebufferTexture2DMultisampleIMG_client_proc_t) &enc_unsupported;
- this->glDeleteFencesNV = (glDeleteFencesNV_client_proc_t) &enc_unsupported;
- this->glGenFencesNV = (glGenFencesNV_client_proc_t) &enc_unsupported;
- this->glIsFenceNV = (glIsFenceNV_client_proc_t) &enc_unsupported;
- this->glTestFenceNV = (glTestFenceNV_client_proc_t) &enc_unsupported;
- this->glGetFenceivNV = (glGetFenceivNV_client_proc_t) &enc_unsupported;
- this->glFinishFenceNV = (glFinishFenceNV_client_proc_t) &enc_unsupported;
- this->glSetFenceNV = (glSetFenceNV_client_proc_t) &enc_unsupported;
- this->glCoverageMaskNV = (glCoverageMaskNV_client_proc_t) &enc_unsupported;
- this->glCoverageOperationNV = (glCoverageOperationNV_client_proc_t) &enc_unsupported;
- this->glGetDriverControlsQCOM = (glGetDriverControlsQCOM_client_proc_t) &enc_unsupported;
- this->glGetDriverControlStringQCOM = (glGetDriverControlStringQCOM_client_proc_t) &enc_unsupported;
- this->glEnableDriverControlQCOM = (glEnableDriverControlQCOM_client_proc_t) &enc_unsupported;
- this->glDisableDriverControlQCOM = (glDisableDriverControlQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetTexturesQCOM = (glExtGetTexturesQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetBuffersQCOM = (glExtGetBuffersQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetRenderbuffersQCOM = (glExtGetRenderbuffersQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetFramebuffersQCOM = (glExtGetFramebuffersQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetTexLevelParameterivQCOM = (glExtGetTexLevelParameterivQCOM_client_proc_t) &enc_unsupported;
- this->glExtTexObjectStateOverrideiQCOM = (glExtTexObjectStateOverrideiQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetTexSubImageQCOM = (glExtGetTexSubImageQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetBufferPointervQCOM = (glExtGetBufferPointervQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetShadersQCOM = (glExtGetShadersQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetProgramsQCOM = (glExtGetProgramsQCOM_client_proc_t) &enc_unsupported;
- this->glExtIsProgramBinaryQCOM = (glExtIsProgramBinaryQCOM_client_proc_t) &enc_unsupported;
- this->glExtGetProgramBinarySourceQCOM = (glExtGetProgramBinarySourceQCOM_client_proc_t) &enc_unsupported;
- this->glStartTilingQCOM = (glStartTilingQCOM_client_proc_t) &enc_unsupported;
- this->glEndTilingQCOM = (glEndTilingQCOM_client_proc_t) &enc_unsupported;
- this->glVertexAttribPointerData = &glVertexAttribPointerData_enc;
- this->glVertexAttribPointerOffset = &glVertexAttribPointerOffset_enc;
- this->glDrawElementsOffset = &glDrawElementsOffset_enc;
- this->glDrawElementsData = &glDrawElementsData_enc;
- this->glGetCompressedTextureFormats = &glGetCompressedTextureFormats_enc;
- this->glShaderString = &glShaderString_enc;
- this->glFinishRoundTrip = &glFinishRoundTrip_enc;
-}
-
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-
-#ifndef GUARD_gl2_encoder_context_t
-#define GUARD_gl2_encoder_context_t
-
-#include "IOStream.h"
-#include "ChecksumCalculator.h"
-#include "gl2_client_context.h"
-
-
-#include <string.h>
-#include "glUtils.h"
-#include "GL2EncoderUtils.h"
-
-struct gl2_encoder_context_t : public gl2_client_context_t {
-
- IOStream *m_stream;
- ChecksumCalculator *m_checksumCalculator;
-
- gl2_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator);
-};
-
-#endif // GUARD_gl2_encoder_context_t
\ No newline at end of file
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#include <stdio.h>
-#include <stdlib.h>
-#include "gl2_client_context.h"
-
-#ifndef GL_TRUE
-extern "C" {
- void glActiveTexture(GLenum texture);
- void glAttachShader(GLuint program, GLuint shader);
- void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name);
- void glBindBuffer(GLenum target, GLuint buffer);
- void glBindFramebuffer(GLenum target, GLuint framebuffer);
- void glBindRenderbuffer(GLenum target, GLuint renderbuffer);
- void glBindTexture(GLenum target, GLuint texture);
- void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- void glBlendEquation(GLenum mode);
- void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
- void glBlendFunc(GLenum sfactor, GLenum dfactor);
- void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
- void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
- void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
- GLenum glCheckFramebufferStatus(GLenum target);
- void glClear(GLbitfield mask);
- void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- void glClearDepthf(GLclampf depth);
- void glClearStencil(GLint s);
- void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
- void glCompileShader(GLuint shader);
- void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
- void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
- void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
- void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
- GLuint glCreateProgram();
- GLuint glCreateShader(GLenum type);
- void glCullFace(GLenum mode);
- void glDeleteBuffers(GLsizei n, const GLuint* buffers);
- void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
- void glDeleteProgram(GLuint program);
- void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
- void glDeleteShader(GLuint shader);
- void glDeleteTextures(GLsizei n, const GLuint* textures);
- void glDepthFunc(GLenum func);
- void glDepthMask(GLboolean flag);
- void glDepthRangef(GLclampf zNear, GLclampf zFar);
- void glDetachShader(GLuint program, GLuint shader);
- void glDisable(GLenum cap);
- void glDisableVertexAttribArray(GLuint index);
- void glDrawArrays(GLenum mode, GLint first, GLsizei count);
- void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
- void glEnable(GLenum cap);
- void glEnableVertexAttribArray(GLuint index);
- void glFinish();
- void glFlush();
- void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
- void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
- void glFrontFace(GLenum mode);
- void glGenBuffers(GLsizei n, GLuint* buffers);
- void glGenerateMipmap(GLenum target);
- void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
- void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
- void glGenTextures(GLsizei n, GLuint* textures);
- void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
- void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
- void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
- int glGetAttribLocation(GLuint program, const GLchar* name);
- void glGetBooleanv(GLenum pname, GLboolean* params);
- void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
- GLenum glGetError();
- void glGetFloatv(GLenum pname, GLfloat* params);
- void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
- void glGetIntegerv(GLenum pname, GLint* params);
- void glGetProgramiv(GLuint program, GLenum pname, GLint* params);
- void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
- void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
- void glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
- void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
- void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
- void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
- const GLubyte* glGetString(GLenum name);
- void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
- void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
- void glGetUniformfv(GLuint program, GLint location, GLfloat* params);
- void glGetUniformiv(GLuint program, GLint location, GLint* params);
- int glGetUniformLocation(GLuint program, const GLchar* name);
- void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
- void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
- void glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer);
- void glHint(GLenum target, GLenum mode);
- GLboolean glIsBuffer(GLuint buffer);
- GLboolean glIsEnabled(GLenum cap);
- GLboolean glIsFramebuffer(GLuint framebuffer);
- GLboolean glIsProgram(GLuint program);
- GLboolean glIsRenderbuffer(GLuint renderbuffer);
- GLboolean glIsShader(GLuint shader);
- GLboolean glIsTexture(GLuint texture);
- void glLineWidth(GLfloat width);
- void glLinkProgram(GLuint program);
- void glPixelStorei(GLenum pname, GLint param);
- void glPolygonOffset(GLfloat factor, GLfloat units);
- void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
- void glReleaseShaderCompiler();
- void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
- void glSampleCoverage(GLclampf value, GLboolean invert);
- void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
- void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
- void glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
- void glStencilFunc(GLenum func, GLint ref, GLuint mask);
- void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
- void glStencilMask(GLuint mask);
- void glStencilMaskSeparate(GLenum face, GLuint mask);
- void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
- void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
- void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
- void glTexParameterf(GLenum target, GLenum pname, GLfloat param);
- void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
- void glTexParameteri(GLenum target, GLenum pname, GLint param);
- void glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
- void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
- void glUniform1f(GLint location, GLfloat x);
- void glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
- void glUniform1i(GLint location, GLint x);
- void glUniform1iv(GLint location, GLsizei count, const GLint* v);
- void glUniform2f(GLint location, GLfloat x, GLfloat y);
- void glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
- void glUniform2i(GLint location, GLint x, GLint y);
- void glUniform2iv(GLint location, GLsizei count, const GLint* v);
- void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
- void glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
- void glUniform3i(GLint location, GLint x, GLint y, GLint z);
- void glUniform3iv(GLint location, GLsizei count, const GLint* v);
- void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- void glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
- void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
- void glUniform4iv(GLint location, GLsizei count, const GLint* v);
- void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- void glUseProgram(GLuint program);
- void glValidateProgram(GLuint program);
- void glVertexAttrib1f(GLuint indx, GLfloat x);
- void glVertexAttrib1fv(GLuint indx, const GLfloat* values);
- void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
- void glVertexAttrib2fv(GLuint indx, const GLfloat* values);
- void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
- void glVertexAttrib3fv(GLuint indx, const GLfloat* values);
- void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- void glVertexAttrib4fv(GLuint indx, const GLfloat* values);
- void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
- void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
- void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
- void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
- void glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary);
- void glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLint length);
- void* glMapBufferOES(GLenum target, GLenum access);
- GLboolean glUnmapBufferOES(GLenum target);
- void glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
- 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);
- void glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
- void glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
- 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);
- void glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
- void glBindVertexArrayOES(GLuint array);
- void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays);
- void glGenVertexArraysOES(GLsizei n, GLuint* arrays);
- GLboolean glIsVertexArrayOES(GLuint array);
- void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments);
- void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount);
- void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount);
- void glGetPerfMonitorGroupsAMD(GLint* numGroups, GLsizei groupsSize, GLuint* groups);
- void glGetPerfMonitorCountersAMD(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters);
- void glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString);
- void glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString);
- void glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid* data);
- void glGenPerfMonitorsAMD(GLsizei n, GLuint* monitors);
- void glDeletePerfMonitorsAMD(GLsizei n, GLuint* monitors);
- void glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList);
- void glBeginPerfMonitorAMD(GLuint monitor);
- void glEndPerfMonitorAMD(GLuint monitor);
- void glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten);
- void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
- void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
- void glDeleteFencesNV(GLsizei n, const GLuint* fences);
- void glGenFencesNV(GLsizei n, GLuint* fences);
- GLboolean glIsFenceNV(GLuint fence);
- GLboolean glTestFenceNV(GLuint fence);
- void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params);
- void glFinishFenceNV(GLuint fence);
- void glSetFenceNV(GLuint fence, GLenum condition);
- void glCoverageMaskNV(GLboolean mask);
- void glCoverageOperationNV(GLenum operation);
- void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls);
- void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString);
- void glEnableDriverControlQCOM(GLuint driverControl);
- void glDisableDriverControlQCOM(GLuint driverControl);
- void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures);
- void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
- void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
- void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
- void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
- void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param);
- void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels);
- void glExtGetBufferPointervQCOM(GLenum target, GLvoidptr* params);
- void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders);
- void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms);
- GLboolean glExtIsProgramBinaryQCOM(GLuint program);
- void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length);
- void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
- void glEndTilingQCOM(GLbitfield preserveMask);
- void glVertexAttribPointerData(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen);
- void glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset);
- void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset);
- void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen);
- void glGetCompressedTextureFormats(int count, GLint* formats);
- void glShaderString(GLuint shader, const GLchar* string, GLsizei len);
- int glFinishRoundTrip();
-};
-
-#endif
-#ifndef GET_CONTEXT
-static gl2_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
-void gl2_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
-#define GET_CONTEXT gl2_client_context_t * ctx = getCurrentContext()
-#endif
-
-void glActiveTexture(GLenum texture)
-{
- GET_CONTEXT;
- ctx->glActiveTexture(ctx, texture);
-}
-
-void glAttachShader(GLuint program, GLuint shader)
-{
- GET_CONTEXT;
- ctx->glAttachShader(ctx, program, shader);
-}
-
-void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name)
-{
- GET_CONTEXT;
- ctx->glBindAttribLocation(ctx, program, index, name);
-}
-
-void glBindBuffer(GLenum target, GLuint buffer)
-{
- GET_CONTEXT;
- ctx->glBindBuffer(ctx, target, buffer);
-}
-
-void glBindFramebuffer(GLenum target, GLuint framebuffer)
-{
- GET_CONTEXT;
- ctx->glBindFramebuffer(ctx, target, framebuffer);
-}
-
-void glBindRenderbuffer(GLenum target, GLuint renderbuffer)
-{
- GET_CONTEXT;
- ctx->glBindRenderbuffer(ctx, target, renderbuffer);
-}
-
-void glBindTexture(GLenum target, GLuint texture)
-{
- GET_CONTEXT;
- ctx->glBindTexture(ctx, target, texture);
-}
-
-void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- GET_CONTEXT;
- ctx->glBlendColor(ctx, red, green, blue, alpha);
-}
-
-void glBlendEquation(GLenum mode)
-{
- GET_CONTEXT;
- ctx->glBlendEquation(ctx, mode);
-}
-
-void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
-{
- GET_CONTEXT;
- ctx->glBlendEquationSeparate(ctx, modeRGB, modeAlpha);
-}
-
-void glBlendFunc(GLenum sfactor, GLenum dfactor)
-{
- GET_CONTEXT;
- ctx->glBlendFunc(ctx, sfactor, dfactor);
-}
-
-void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-{
- GET_CONTEXT;
- ctx->glBlendFuncSeparate(ctx, srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-
-void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
-{
- GET_CONTEXT;
- ctx->glBufferData(ctx, target, size, data, usage);
-}
-
-void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
-{
- GET_CONTEXT;
- ctx->glBufferSubData(ctx, target, offset, size, data);
-}
-
-GLenum glCheckFramebufferStatus(GLenum target)
-{
- GET_CONTEXT;
- return ctx->glCheckFramebufferStatus(ctx, target);
-}
-
-void glClear(GLbitfield mask)
-{
- GET_CONTEXT;
- ctx->glClear(ctx, mask);
-}
-
-void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- GET_CONTEXT;
- ctx->glClearColor(ctx, red, green, blue, alpha);
-}
-
-void glClearDepthf(GLclampf depth)
-{
- GET_CONTEXT;
- ctx->glClearDepthf(ctx, depth);
-}
-
-void glClearStencil(GLint s)
-{
- GET_CONTEXT;
- ctx->glClearStencil(ctx, s);
-}
-
-void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-{
- GET_CONTEXT;
- ctx->glColorMask(ctx, red, green, blue, alpha);
-}
-
-void glCompileShader(GLuint shader)
-{
- GET_CONTEXT;
- ctx->glCompileShader(ctx, shader);
-}
-
-void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
-{
- GET_CONTEXT;
- ctx->glCompressedTexImage2D(ctx, target, level, internalformat, width, height, border, imageSize, data);
-}
-
-void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
-{
- GET_CONTEXT;
- ctx->glCompressedTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, data);
-}
-
-void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
- GET_CONTEXT;
- ctx->glCopyTexImage2D(ctx, target, level, internalformat, x, y, width, height, border);
-}
-
-void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glCopyTexSubImage2D(ctx, target, level, xoffset, yoffset, x, y, width, height);
-}
-
-GLuint glCreateProgram()
-{
- GET_CONTEXT;
- return ctx->glCreateProgram(ctx);
-}
-
-GLuint glCreateShader(GLenum type)
-{
- GET_CONTEXT;
- return ctx->glCreateShader(ctx, type);
-}
-
-void glCullFace(GLenum mode)
-{
- GET_CONTEXT;
- ctx->glCullFace(ctx, mode);
-}
-
-void glDeleteBuffers(GLsizei n, const GLuint* buffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteBuffers(ctx, n, buffers);
-}
-
-void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteFramebuffers(ctx, n, framebuffers);
-}
-
-void glDeleteProgram(GLuint program)
-{
- GET_CONTEXT;
- ctx->glDeleteProgram(ctx, program);
-}
-
-void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteRenderbuffers(ctx, n, renderbuffers);
-}
-
-void glDeleteShader(GLuint shader)
-{
- GET_CONTEXT;
- ctx->glDeleteShader(ctx, shader);
-}
-
-void glDeleteTextures(GLsizei n, const GLuint* textures)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteTextures(ctx, n, textures);
-}
-
-void glDepthFunc(GLenum func)
-{
- GET_CONTEXT;
- ctx->glDepthFunc(ctx, func);
-}
-
-void glDepthMask(GLboolean flag)
-{
- GET_CONTEXT;
- ctx->glDepthMask(ctx, flag);
-}
-
-void glDepthRangef(GLclampf zNear, GLclampf zFar)
-{
- GET_CONTEXT;
- ctx->glDepthRangef(ctx, zNear, zFar);
-}
-
-void glDetachShader(GLuint program, GLuint shader)
-{
- GET_CONTEXT;
- ctx->glDetachShader(ctx, program, shader);
-}
-
-void glDisable(GLenum cap)
-{
- GET_CONTEXT;
- ctx->glDisable(ctx, cap);
-}
-
-void glDisableVertexAttribArray(GLuint index)
-{
- GET_CONTEXT;
- ctx->glDisableVertexAttribArray(ctx, index);
-}
-
-void glDrawArrays(GLenum mode, GLint first, GLsizei count)
-{
- GET_CONTEXT;
- ctx->glDrawArrays(ctx, mode, first, count);
-}
-
-void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
-{
- GET_CONTEXT;
- ctx->glDrawElements(ctx, mode, count, type, indices);
-}
-
-void glEnable(GLenum cap)
-{
- GET_CONTEXT;
- ctx->glEnable(ctx, cap);
-}
-
-void glEnableVertexAttribArray(GLuint index)
-{
- GET_CONTEXT;
- ctx->glEnableVertexAttribArray(ctx, index);
-}
-
-void glFinish()
-{
- GET_CONTEXT;
- ctx->glFinish(ctx);
-}
-
-void glFlush()
-{
- GET_CONTEXT;
- ctx->glFlush(ctx);
-}
-
-void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
- GET_CONTEXT;
- ctx->glFramebufferRenderbuffer(ctx, target, attachment, renderbuffertarget, renderbuffer);
-}
-
-void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- GET_CONTEXT;
- ctx->glFramebufferTexture2D(ctx, target, attachment, textarget, texture, level);
-}
-
-void glFrontFace(GLenum mode)
-{
- GET_CONTEXT;
- ctx->glFrontFace(ctx, mode);
-}
-
-void glGenBuffers(GLsizei n, GLuint* buffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenBuffers(ctx, n, buffers);
-}
-
-void glGenerateMipmap(GLenum target)
-{
- GET_CONTEXT;
- ctx->glGenerateMipmap(ctx, target);
-}
-
-void glGenFramebuffers(GLsizei n, GLuint* framebuffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenFramebuffers(ctx, n, framebuffers);
-}
-
-void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenRenderbuffers(ctx, n, renderbuffers);
-}
-
-void glGenTextures(GLsizei n, GLuint* textures)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenTextures(ctx, n, textures);
-}
-
-void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-{
- GET_CONTEXT;
- ctx->glGetActiveAttrib(ctx, program, index, bufsize, length, size, type, name);
-}
-
-void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-{
- GET_CONTEXT;
- ctx->glGetActiveUniform(ctx, program, index, bufsize, length, size, type, name);
-}
-
-void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
-{
- GET_CONTEXT;
- ctx->glGetAttachedShaders(ctx, program, maxcount, count, shaders);
-}
-
-int glGetAttribLocation(GLuint program, const GLchar* name)
-{
- GET_CONTEXT;
- return ctx->glGetAttribLocation(ctx, program, name);
-}
-
-void glGetBooleanv(GLenum pname, GLboolean* params)
-{
- GET_CONTEXT;
- ctx->glGetBooleanv(ctx, pname, params);
-}
-
-void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetBufferParameteriv(ctx, target, pname, params);
-}
-
-GLenum glGetError()
-{
- GET_CONTEXT;
- return ctx->glGetError(ctx);
-}
-
-void glGetFloatv(GLenum pname, GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glGetFloatv(ctx, pname, params);
-}
-
-void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetFramebufferAttachmentParameteriv(ctx, target, attachment, pname, params);
-}
-
-void glGetIntegerv(GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetIntegerv(ctx, pname, params);
-}
-
-void glGetProgramiv(GLuint program, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetProgramiv(ctx, program, pname, params);
-}
-
-void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-{
- GET_CONTEXT;
- ctx->glGetProgramInfoLog(ctx, program, bufsize, length, infolog);
-}
-
-void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetRenderbufferParameteriv(ctx, target, pname, params);
-}
-
-void glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetShaderiv(ctx, shader, pname, params);
-}
-
-void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-{
- GET_CONTEXT;
- ctx->glGetShaderInfoLog(ctx, shader, bufsize, length, infolog);
-}
-
-void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
-{
- GET_CONTEXT;
- ctx->glGetShaderPrecisionFormat(ctx, shadertype, precisiontype, range, precision);
-}
-
-void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
-{
- GET_CONTEXT;
- ctx->glGetShaderSource(ctx, shader, bufsize, length, source);
-}
-
-const GLubyte* glGetString(GLenum name)
-{
- GET_CONTEXT;
- return ctx->glGetString(ctx, name);
-}
-
-void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glGetTexParameterfv(ctx, target, pname, params);
-}
-
-void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetTexParameteriv(ctx, target, pname, params);
-}
-
-void glGetUniformfv(GLuint program, GLint location, GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glGetUniformfv(ctx, program, location, params);
-}
-
-void glGetUniformiv(GLuint program, GLint location, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetUniformiv(ctx, program, location, params);
-}
-
-int glGetUniformLocation(GLuint program, const GLchar* name)
-{
- GET_CONTEXT;
- return ctx->glGetUniformLocation(ctx, program, name);
-}
-
-void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glGetVertexAttribfv(ctx, index, pname, params);
-}
-
-void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetVertexAttribiv(ctx, index, pname, params);
-}
-
-void glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer)
-{
- GET_CONTEXT;
- ctx->glGetVertexAttribPointerv(ctx, index, pname, pointer);
-}
-
-void glHint(GLenum target, GLenum mode)
-{
- GET_CONTEXT;
- ctx->glHint(ctx, target, mode);
-}
-
-GLboolean glIsBuffer(GLuint buffer)
-{
- GET_CONTEXT;
- return ctx->glIsBuffer(ctx, buffer);
-}
-
-GLboolean glIsEnabled(GLenum cap)
-{
- GET_CONTEXT;
- return ctx->glIsEnabled(ctx, cap);
-}
-
-GLboolean glIsFramebuffer(GLuint framebuffer)
-{
- GET_CONTEXT;
- return ctx->glIsFramebuffer(ctx, framebuffer);
-}
-
-GLboolean glIsProgram(GLuint program)
-{
- GET_CONTEXT;
- return ctx->glIsProgram(ctx, program);
-}
-
-GLboolean glIsRenderbuffer(GLuint renderbuffer)
-{
- GET_CONTEXT;
- return ctx->glIsRenderbuffer(ctx, renderbuffer);
-}
-
-GLboolean glIsShader(GLuint shader)
-{
- GET_CONTEXT;
- return ctx->glIsShader(ctx, shader);
-}
-
-GLboolean glIsTexture(GLuint texture)
-{
- GET_CONTEXT;
- return ctx->glIsTexture(ctx, texture);
-}
-
-void glLineWidth(GLfloat width)
-{
- GET_CONTEXT;
- ctx->glLineWidth(ctx, width);
-}
-
-void glLinkProgram(GLuint program)
-{
- GET_CONTEXT;
- ctx->glLinkProgram(ctx, program);
-}
-
-void glPixelStorei(GLenum pname, GLint param)
-{
- GET_CONTEXT;
- ctx->glPixelStorei(ctx, pname, param);
-}
-
-void glPolygonOffset(GLfloat factor, GLfloat units)
-{
- GET_CONTEXT;
- ctx->glPolygonOffset(ctx, factor, units);
-}
-
-void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
-{
- GET_CONTEXT;
- ctx->glReadPixels(ctx, x, y, width, height, format, type, pixels);
-}
-
-void glReleaseShaderCompiler()
-{
- GET_CONTEXT;
- ctx->glReleaseShaderCompiler(ctx);
-}
-
-void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glRenderbufferStorage(ctx, target, internalformat, width, height);
-}
-
-void glSampleCoverage(GLclampf value, GLboolean invert)
-{
- GET_CONTEXT;
- ctx->glSampleCoverage(ctx, value, invert);
-}
-
-void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glScissor(ctx, x, y, width, height);
-}
-
-void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
-{
- GET_CONTEXT;
- ctx->glShaderBinary(ctx, n, shaders, binaryformat, binary, length);
-}
-
-void glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length)
-{
- GET_CONTEXT;
- ctx->glShaderSource(ctx, shader, count, string, length);
-}
-
-void glStencilFunc(GLenum func, GLint ref, GLuint mask)
-{
- GET_CONTEXT;
- ctx->glStencilFunc(ctx, func, ref, mask);
-}
-
-void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
-{
- GET_CONTEXT;
- ctx->glStencilFuncSeparate(ctx, face, func, ref, mask);
-}
-
-void glStencilMask(GLuint mask)
-{
- GET_CONTEXT;
- ctx->glStencilMask(ctx, mask);
-}
-
-void glStencilMaskSeparate(GLenum face, GLuint mask)
-{
- GET_CONTEXT;
- ctx->glStencilMaskSeparate(ctx, face, mask);
-}
-
-void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
-{
- GET_CONTEXT;
- ctx->glStencilOp(ctx, fail, zfail, zpass);
-}
-
-void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
-{
- GET_CONTEXT;
- ctx->glStencilOpSeparate(ctx, face, fail, zfail, zpass);
-}
-
-void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
-{
- GET_CONTEXT;
- ctx->glTexImage2D(ctx, target, level, internalformat, width, height, border, format, type, pixels);
-}
-
-void glTexParameterf(GLenum target, GLenum pname, GLfloat param)
-{
- GET_CONTEXT;
- ctx->glTexParameterf(ctx, target, pname, param);
-}
-
-void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
-{
- GET_CONTEXT;
- ctx->glTexParameterfv(ctx, target, pname, params);
-}
-
-void glTexParameteri(GLenum target, GLenum pname, GLint param)
-{
- GET_CONTEXT;
- ctx->glTexParameteri(ctx, target, pname, param);
-}
-
-void glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
-{
- GET_CONTEXT;
- ctx->glTexParameteriv(ctx, target, pname, params);
-}
-
-void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
-{
- GET_CONTEXT;
- ctx->glTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels);
-}
-
-void glUniform1f(GLint location, GLfloat x)
-{
- GET_CONTEXT;
- ctx->glUniform1f(ctx, location, x);
-}
-
-void glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
-{
- GET_CONTEXT;
- ctx->glUniform1fv(ctx, location, count, v);
-}
-
-void glUniform1i(GLint location, GLint x)
-{
- GET_CONTEXT;
- ctx->glUniform1i(ctx, location, x);
-}
-
-void glUniform1iv(GLint location, GLsizei count, const GLint* v)
-{
- GET_CONTEXT;
- ctx->glUniform1iv(ctx, location, count, v);
-}
-
-void glUniform2f(GLint location, GLfloat x, GLfloat y)
-{
- GET_CONTEXT;
- ctx->glUniform2f(ctx, location, x, y);
-}
-
-void glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
-{
- GET_CONTEXT;
- ctx->glUniform2fv(ctx, location, count, v);
-}
-
-void glUniform2i(GLint location, GLint x, GLint y)
-{
- GET_CONTEXT;
- ctx->glUniform2i(ctx, location, x, y);
-}
-
-void glUniform2iv(GLint location, GLsizei count, const GLint* v)
-{
- GET_CONTEXT;
- ctx->glUniform2iv(ctx, location, count, v);
-}
-
-void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CONTEXT;
- ctx->glUniform3f(ctx, location, x, y, z);
-}
-
-void glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
-{
- GET_CONTEXT;
- ctx->glUniform3fv(ctx, location, count, v);
-}
-
-void glUniform3i(GLint location, GLint x, GLint y, GLint z)
-{
- GET_CONTEXT;
- ctx->glUniform3i(ctx, location, x, y, z);
-}
-
-void glUniform3iv(GLint location, GLsizei count, const GLint* v)
-{
- GET_CONTEXT;
- ctx->glUniform3iv(ctx, location, count, v);
-}
-
-void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CONTEXT;
- ctx->glUniform4f(ctx, location, x, y, z, w);
-}
-
-void glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
-{
- GET_CONTEXT;
- ctx->glUniform4fv(ctx, location, count, v);
-}
-
-void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
-{
- GET_CONTEXT;
- ctx->glUniform4i(ctx, location, x, y, z, w);
-}
-
-void glUniform4iv(GLint location, GLsizei count, const GLint* v)
-{
- GET_CONTEXT;
- ctx->glUniform4iv(ctx, location, count, v);
-}
-
-void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
- GET_CONTEXT;
- ctx->glUniformMatrix2fv(ctx, location, count, transpose, value);
-}
-
-void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
- GET_CONTEXT;
- ctx->glUniformMatrix3fv(ctx, location, count, transpose, value);
-}
-
-void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
- GET_CONTEXT;
- ctx->glUniformMatrix4fv(ctx, location, count, transpose, value);
-}
-
-void glUseProgram(GLuint program)
-{
- GET_CONTEXT;
- ctx->glUseProgram(ctx, program);
-}
-
-void glValidateProgram(GLuint program)
-{
- GET_CONTEXT;
- ctx->glValidateProgram(ctx, program);
-}
-
-void glVertexAttrib1f(GLuint indx, GLfloat x)
-{
- GET_CONTEXT;
- ctx->glVertexAttrib1f(ctx, indx, x);
-}
-
-void glVertexAttrib1fv(GLuint indx, const GLfloat* values)
-{
- GET_CONTEXT;
- ctx->glVertexAttrib1fv(ctx, indx, values);
-}
-
-void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
-{
- GET_CONTEXT;
- ctx->glVertexAttrib2f(ctx, indx, x, y);
-}
-
-void glVertexAttrib2fv(GLuint indx, const GLfloat* values)
-{
- GET_CONTEXT;
- ctx->glVertexAttrib2fv(ctx, indx, values);
-}
-
-void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CONTEXT;
- ctx->glVertexAttrib3f(ctx, indx, x, y, z);
-}
-
-void glVertexAttrib3fv(GLuint indx, const GLfloat* values)
-{
- GET_CONTEXT;
- ctx->glVertexAttrib3fv(ctx, indx, values);
-}
-
-void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CONTEXT;
- ctx->glVertexAttrib4f(ctx, indx, x, y, z, w);
-}
-
-void glVertexAttrib4fv(GLuint indx, const GLfloat* values)
-{
- GET_CONTEXT;
- ctx->glVertexAttrib4fv(ctx, indx, values);
-}
-
-void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
-{
- GET_CONTEXT;
- ctx->glVertexAttribPointer(ctx, indx, size, type, normalized, stride, ptr);
-}
-
-void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glViewport(ctx, x, y, width, height);
-}
-
-void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
-{
- GET_CONTEXT;
- ctx->glEGLImageTargetTexture2DOES(ctx, target, image);
-}
-
-void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
-{
- GET_CONTEXT;
- ctx->glEGLImageTargetRenderbufferStorageOES(ctx, target, image);
-}
-
-void glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
-{
- GET_CONTEXT;
- ctx->glGetProgramBinaryOES(ctx, program, bufSize, length, binaryFormat, binary);
-}
-
-void glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLint length)
-{
- GET_CONTEXT;
- ctx->glProgramBinaryOES(ctx, program, binaryFormat, binary, length);
-}
-
-void* glMapBufferOES(GLenum target, GLenum access)
-{
- GET_CONTEXT;
- return ctx->glMapBufferOES(ctx, target, access);
-}
-
-GLboolean glUnmapBufferOES(GLenum target)
-{
- GET_CONTEXT;
- return ctx->glUnmapBufferOES(ctx, target);
-}
-
-void glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
-{
- GET_CONTEXT;
- ctx->glTexImage3DOES(ctx, target, level, internalformat, width, height, depth, border, format, type, pixels);
-}
-
-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)
-{
- GET_CONTEXT;
- ctx->glTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
-}
-
-void glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glCopyTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, x, y, width, height);
-}
-
-void glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
-{
- GET_CONTEXT;
- ctx->glCompressedTexImage3DOES(ctx, target, level, internalformat, width, height, depth, border, imageSize, data);
-}
-
-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)
-{
- GET_CONTEXT;
- ctx->glCompressedTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
-}
-
-void glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
-{
- GET_CONTEXT;
- ctx->glFramebufferTexture3DOES(ctx, target, attachment, textarget, texture, level, zoffset);
-}
-
-void glBindVertexArrayOES(GLuint array)
-{
- GET_CONTEXT;
- ctx->glBindVertexArrayOES(ctx, array);
-}
-
-void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glDeleteVertexArraysOES(ctx, n, arrays);
-}
-
-void glGenVertexArraysOES(GLsizei n, GLuint* arrays)
-{
- GET_CONTEXT;
- if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
- ctx->glGenVertexArraysOES(ctx, n, arrays);
-}
-
-GLboolean glIsVertexArrayOES(GLuint array)
-{
- GET_CONTEXT;
- return ctx->glIsVertexArrayOES(ctx, array);
-}
-
-void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments)
-{
- GET_CONTEXT;
- ctx->glDiscardFramebufferEXT(ctx, target, numAttachments, attachments);
-}
-
-void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount)
-{
- GET_CONTEXT;
- ctx->glMultiDrawArraysEXT(ctx, mode, first, count, primcount);
-}
-
-void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount)
-{
- GET_CONTEXT;
- ctx->glMultiDrawElementsEXT(ctx, mode, count, type, indices, primcount);
-}
-
-void glGetPerfMonitorGroupsAMD(GLint* numGroups, GLsizei groupsSize, GLuint* groups)
-{
- GET_CONTEXT;
- ctx->glGetPerfMonitorGroupsAMD(ctx, numGroups, groupsSize, groups);
-}
-
-void glGetPerfMonitorCountersAMD(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters)
-{
- GET_CONTEXT;
- ctx->glGetPerfMonitorCountersAMD(ctx, group, numCounters, maxActiveCounters, counterSize, counters);
-}
-
-void glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString)
-{
- GET_CONTEXT;
- ctx->glGetPerfMonitorGroupStringAMD(ctx, group, bufSize, length, groupString);
-}
-
-void glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString)
-{
- GET_CONTEXT;
- ctx->glGetPerfMonitorCounterStringAMD(ctx, group, counter, bufSize, length, counterString);
-}
-
-void glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid* data)
-{
- GET_CONTEXT;
- ctx->glGetPerfMonitorCounterInfoAMD(ctx, group, counter, pname, data);
-}
-
-void glGenPerfMonitorsAMD(GLsizei n, GLuint* monitors)
-{
- GET_CONTEXT;
- ctx->glGenPerfMonitorsAMD(ctx, n, monitors);
-}
-
-void glDeletePerfMonitorsAMD(GLsizei n, GLuint* monitors)
-{
- GET_CONTEXT;
- ctx->glDeletePerfMonitorsAMD(ctx, n, monitors);
-}
-
-void glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList)
-{
- GET_CONTEXT;
- ctx->glSelectPerfMonitorCountersAMD(ctx, monitor, enable, group, numCounters, countersList);
-}
-
-void glBeginPerfMonitorAMD(GLuint monitor)
-{
- GET_CONTEXT;
- ctx->glBeginPerfMonitorAMD(ctx, monitor);
-}
-
-void glEndPerfMonitorAMD(GLuint monitor)
-{
- GET_CONTEXT;
- ctx->glEndPerfMonitorAMD(ctx, monitor);
-}
-
-void glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten)
-{
- GET_CONTEXT;
- ctx->glGetPerfMonitorCounterDataAMD(ctx, monitor, pname, dataSize, data, bytesWritten);
-}
-
-void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- ctx->glRenderbufferStorageMultisampleIMG(ctx, target, samples, internalformat, width, height);
-}
-
-void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
-{
- GET_CONTEXT;
- ctx->glFramebufferTexture2DMultisampleIMG(ctx, target, attachment, textarget, texture, level, samples);
-}
-
-void glDeleteFencesNV(GLsizei n, const GLuint* fences)
-{
- GET_CONTEXT;
- ctx->glDeleteFencesNV(ctx, n, fences);
-}
-
-void glGenFencesNV(GLsizei n, GLuint* fences)
-{
- GET_CONTEXT;
- ctx->glGenFencesNV(ctx, n, fences);
-}
-
-GLboolean glIsFenceNV(GLuint fence)
-{
- GET_CONTEXT;
- return ctx->glIsFenceNV(ctx, fence);
-}
-
-GLboolean glTestFenceNV(GLuint fence)
-{
- GET_CONTEXT;
- return ctx->glTestFenceNV(ctx, fence);
-}
-
-void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glGetFenceivNV(ctx, fence, pname, params);
-}
-
-void glFinishFenceNV(GLuint fence)
-{
- GET_CONTEXT;
- ctx->glFinishFenceNV(ctx, fence);
-}
-
-void glSetFenceNV(GLuint fence, GLenum condition)
-{
- GET_CONTEXT;
- ctx->glSetFenceNV(ctx, fence, condition);
-}
-
-void glCoverageMaskNV(GLboolean mask)
-{
- GET_CONTEXT;
- ctx->glCoverageMaskNV(ctx, mask);
-}
-
-void glCoverageOperationNV(GLenum operation)
-{
- GET_CONTEXT;
- ctx->glCoverageOperationNV(ctx, operation);
-}
-
-void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls)
-{
- GET_CONTEXT;
- ctx->glGetDriverControlsQCOM(ctx, num, size, driverControls);
-}
-
-void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString)
-{
- GET_CONTEXT;
- ctx->glGetDriverControlStringQCOM(ctx, driverControl, bufSize, length, driverControlString);
-}
-
-void glEnableDriverControlQCOM(GLuint driverControl)
-{
- GET_CONTEXT;
- ctx->glEnableDriverControlQCOM(ctx, driverControl);
-}
-
-void glDisableDriverControlQCOM(GLuint driverControl)
-{
- GET_CONTEXT;
- ctx->glDisableDriverControlQCOM(ctx, driverControl);
-}
-
-void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures)
-{
- GET_CONTEXT;
- ctx->glExtGetTexturesQCOM(ctx, textures, maxTextures, numTextures);
-}
-
-void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
-{
- GET_CONTEXT;
- ctx->glExtGetBuffersQCOM(ctx, buffers, maxBuffers, numBuffers);
-}
-
-void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
-{
- GET_CONTEXT;
- ctx->glExtGetRenderbuffersQCOM(ctx, renderbuffers, maxRenderbuffers, numRenderbuffers);
-}
-
-void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
-{
- GET_CONTEXT;
- ctx->glExtGetFramebuffersQCOM(ctx, framebuffers, maxFramebuffers, numFramebuffers);
-}
-
-void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
-{
- GET_CONTEXT;
- ctx->glExtGetTexLevelParameterivQCOM(ctx, texture, face, level, pname, params);
-}
-
-void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param)
-{
- GET_CONTEXT;
- ctx->glExtTexObjectStateOverrideiQCOM(ctx, target, pname, param);
-}
-
-void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels)
-{
- GET_CONTEXT;
- ctx->glExtGetTexSubImageQCOM(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
-}
-
-void glExtGetBufferPointervQCOM(GLenum target, GLvoidptr* params)
-{
- GET_CONTEXT;
- ctx->glExtGetBufferPointervQCOM(ctx, target, params);
-}
-
-void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders)
-{
- GET_CONTEXT;
- ctx->glExtGetShadersQCOM(ctx, shaders, maxShaders, numShaders);
-}
-
-void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms)
-{
- GET_CONTEXT;
- ctx->glExtGetProgramsQCOM(ctx, programs, maxPrograms, numPrograms);
-}
-
-GLboolean glExtIsProgramBinaryQCOM(GLuint program)
-{
- GET_CONTEXT;
- return ctx->glExtIsProgramBinaryQCOM(ctx, program);
-}
-
-void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length)
-{
- GET_CONTEXT;
- ctx->glExtGetProgramBinarySourceQCOM(ctx, program, shadertype, source, length);
-}
-
-void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
-{
- GET_CONTEXT;
- ctx->glStartTilingQCOM(ctx, x, y, width, height, preserveMask);
-}
-
-void glEndTilingQCOM(GLbitfield preserveMask)
-{
- GET_CONTEXT;
- ctx->glEndTilingQCOM(ctx, preserveMask);
-}
-
-void glVertexAttribPointerData(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen)
-{
- GET_CONTEXT;
- ctx->glVertexAttribPointerData(ctx, indx, size, type, normalized, stride, data, datalen);
-}
-
-void glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset)
-{
- GET_CONTEXT;
- ctx->glVertexAttribPointerOffset(ctx, indx, size, type, normalized, stride, offset);
-}
-
-void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset)
-{
- GET_CONTEXT;
- ctx->glDrawElementsOffset(ctx, mode, count, type, offset);
-}
-
-void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
-{
- GET_CONTEXT;
- ctx->glDrawElementsData(ctx, mode, count, type, data, datalen);
-}
-
-void glGetCompressedTextureFormats(int count, GLint* formats)
-{
- GET_CONTEXT;
- ctx->glGetCompressedTextureFormats(ctx, count, formats);
-}
-
-void glShaderString(GLuint shader, const GLchar* string, GLsizei len)
-{
- GET_CONTEXT;
- ctx->glShaderString(ctx, shader, string, len);
-}
-
-int glFinishRoundTrip()
-{
- GET_CONTEXT;
- return ctx->glFinishRoundTrip(ctx);
-}
-
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __gl2_client_ftable_t_h
-#define __gl2_client_ftable_t_h
-
-
-static const struct _gl2_funcs_by_name {
- const char *name;
- void *proc;
-} gl2_funcs_by_name[] = {
- {"glActiveTexture", (void*)glActiveTexture},
- {"glAttachShader", (void*)glAttachShader},
- {"glBindAttribLocation", (void*)glBindAttribLocation},
- {"glBindBuffer", (void*)glBindBuffer},
- {"glBindFramebuffer", (void*)glBindFramebuffer},
- {"glBindRenderbuffer", (void*)glBindRenderbuffer},
- {"glBindTexture", (void*)glBindTexture},
- {"glBlendColor", (void*)glBlendColor},
- {"glBlendEquation", (void*)glBlendEquation},
- {"glBlendEquationSeparate", (void*)glBlendEquationSeparate},
- {"glBlendFunc", (void*)glBlendFunc},
- {"glBlendFuncSeparate", (void*)glBlendFuncSeparate},
- {"glBufferData", (void*)glBufferData},
- {"glBufferSubData", (void*)glBufferSubData},
- {"glCheckFramebufferStatus", (void*)glCheckFramebufferStatus},
- {"glClear", (void*)glClear},
- {"glClearColor", (void*)glClearColor},
- {"glClearDepthf", (void*)glClearDepthf},
- {"glClearStencil", (void*)glClearStencil},
- {"glColorMask", (void*)glColorMask},
- {"glCompileShader", (void*)glCompileShader},
- {"glCompressedTexImage2D", (void*)glCompressedTexImage2D},
- {"glCompressedTexSubImage2D", (void*)glCompressedTexSubImage2D},
- {"glCopyTexImage2D", (void*)glCopyTexImage2D},
- {"glCopyTexSubImage2D", (void*)glCopyTexSubImage2D},
- {"glCreateProgram", (void*)glCreateProgram},
- {"glCreateShader", (void*)glCreateShader},
- {"glCullFace", (void*)glCullFace},
- {"glDeleteBuffers", (void*)glDeleteBuffers},
- {"glDeleteFramebuffers", (void*)glDeleteFramebuffers},
- {"glDeleteProgram", (void*)glDeleteProgram},
- {"glDeleteRenderbuffers", (void*)glDeleteRenderbuffers},
- {"glDeleteShader", (void*)glDeleteShader},
- {"glDeleteTextures", (void*)glDeleteTextures},
- {"glDepthFunc", (void*)glDepthFunc},
- {"glDepthMask", (void*)glDepthMask},
- {"glDepthRangef", (void*)glDepthRangef},
- {"glDetachShader", (void*)glDetachShader},
- {"glDisable", (void*)glDisable},
- {"glDisableVertexAttribArray", (void*)glDisableVertexAttribArray},
- {"glDrawArrays", (void*)glDrawArrays},
- {"glDrawElements", (void*)glDrawElements},
- {"glEnable", (void*)glEnable},
- {"glEnableVertexAttribArray", (void*)glEnableVertexAttribArray},
- {"glFinish", (void*)glFinish},
- {"glFlush", (void*)glFlush},
- {"glFramebufferRenderbuffer", (void*)glFramebufferRenderbuffer},
- {"glFramebufferTexture2D", (void*)glFramebufferTexture2D},
- {"glFrontFace", (void*)glFrontFace},
- {"glGenBuffers", (void*)glGenBuffers},
- {"glGenerateMipmap", (void*)glGenerateMipmap},
- {"glGenFramebuffers", (void*)glGenFramebuffers},
- {"glGenRenderbuffers", (void*)glGenRenderbuffers},
- {"glGenTextures", (void*)glGenTextures},
- {"glGetActiveAttrib", (void*)glGetActiveAttrib},
- {"glGetActiveUniform", (void*)glGetActiveUniform},
- {"glGetAttachedShaders", (void*)glGetAttachedShaders},
- {"glGetAttribLocation", (void*)glGetAttribLocation},
- {"glGetBooleanv", (void*)glGetBooleanv},
- {"glGetBufferParameteriv", (void*)glGetBufferParameteriv},
- {"glGetError", (void*)glGetError},
- {"glGetFloatv", (void*)glGetFloatv},
- {"glGetFramebufferAttachmentParameteriv", (void*)glGetFramebufferAttachmentParameteriv},
- {"glGetIntegerv", (void*)glGetIntegerv},
- {"glGetProgramiv", (void*)glGetProgramiv},
- {"glGetProgramInfoLog", (void*)glGetProgramInfoLog},
- {"glGetRenderbufferParameteriv", (void*)glGetRenderbufferParameteriv},
- {"glGetShaderiv", (void*)glGetShaderiv},
- {"glGetShaderInfoLog", (void*)glGetShaderInfoLog},
- {"glGetShaderPrecisionFormat", (void*)glGetShaderPrecisionFormat},
- {"glGetShaderSource", (void*)glGetShaderSource},
- {"glGetString", (void*)glGetString},
- {"glGetTexParameterfv", (void*)glGetTexParameterfv},
- {"glGetTexParameteriv", (void*)glGetTexParameteriv},
- {"glGetUniformfv", (void*)glGetUniformfv},
- {"glGetUniformiv", (void*)glGetUniformiv},
- {"glGetUniformLocation", (void*)glGetUniformLocation},
- {"glGetVertexAttribfv", (void*)glGetVertexAttribfv},
- {"glGetVertexAttribiv", (void*)glGetVertexAttribiv},
- {"glGetVertexAttribPointerv", (void*)glGetVertexAttribPointerv},
- {"glHint", (void*)glHint},
- {"glIsBuffer", (void*)glIsBuffer},
- {"glIsEnabled", (void*)glIsEnabled},
- {"glIsFramebuffer", (void*)glIsFramebuffer},
- {"glIsProgram", (void*)glIsProgram},
- {"glIsRenderbuffer", (void*)glIsRenderbuffer},
- {"glIsShader", (void*)glIsShader},
- {"glIsTexture", (void*)glIsTexture},
- {"glLineWidth", (void*)glLineWidth},
- {"glLinkProgram", (void*)glLinkProgram},
- {"glPixelStorei", (void*)glPixelStorei},
- {"glPolygonOffset", (void*)glPolygonOffset},
- {"glReadPixels", (void*)glReadPixels},
- {"glReleaseShaderCompiler", (void*)glReleaseShaderCompiler},
- {"glRenderbufferStorage", (void*)glRenderbufferStorage},
- {"glSampleCoverage", (void*)glSampleCoverage},
- {"glScissor", (void*)glScissor},
- {"glShaderBinary", (void*)glShaderBinary},
- {"glShaderSource", (void*)glShaderSource},
- {"glStencilFunc", (void*)glStencilFunc},
- {"glStencilFuncSeparate", (void*)glStencilFuncSeparate},
- {"glStencilMask", (void*)glStencilMask},
- {"glStencilMaskSeparate", (void*)glStencilMaskSeparate},
- {"glStencilOp", (void*)glStencilOp},
- {"glStencilOpSeparate", (void*)glStencilOpSeparate},
- {"glTexImage2D", (void*)glTexImage2D},
- {"glTexParameterf", (void*)glTexParameterf},
- {"glTexParameterfv", (void*)glTexParameterfv},
- {"glTexParameteri", (void*)glTexParameteri},
- {"glTexParameteriv", (void*)glTexParameteriv},
- {"glTexSubImage2D", (void*)glTexSubImage2D},
- {"glUniform1f", (void*)glUniform1f},
- {"glUniform1fv", (void*)glUniform1fv},
- {"glUniform1i", (void*)glUniform1i},
- {"glUniform1iv", (void*)glUniform1iv},
- {"glUniform2f", (void*)glUniform2f},
- {"glUniform2fv", (void*)glUniform2fv},
- {"glUniform2i", (void*)glUniform2i},
- {"glUniform2iv", (void*)glUniform2iv},
- {"glUniform3f", (void*)glUniform3f},
- {"glUniform3fv", (void*)glUniform3fv},
- {"glUniform3i", (void*)glUniform3i},
- {"glUniform3iv", (void*)glUniform3iv},
- {"glUniform4f", (void*)glUniform4f},
- {"glUniform4fv", (void*)glUniform4fv},
- {"glUniform4i", (void*)glUniform4i},
- {"glUniform4iv", (void*)glUniform4iv},
- {"glUniformMatrix2fv", (void*)glUniformMatrix2fv},
- {"glUniformMatrix3fv", (void*)glUniformMatrix3fv},
- {"glUniformMatrix4fv", (void*)glUniformMatrix4fv},
- {"glUseProgram", (void*)glUseProgram},
- {"glValidateProgram", (void*)glValidateProgram},
- {"glVertexAttrib1f", (void*)glVertexAttrib1f},
- {"glVertexAttrib1fv", (void*)glVertexAttrib1fv},
- {"glVertexAttrib2f", (void*)glVertexAttrib2f},
- {"glVertexAttrib2fv", (void*)glVertexAttrib2fv},
- {"glVertexAttrib3f", (void*)glVertexAttrib3f},
- {"glVertexAttrib3fv", (void*)glVertexAttrib3fv},
- {"glVertexAttrib4f", (void*)glVertexAttrib4f},
- {"glVertexAttrib4fv", (void*)glVertexAttrib4fv},
- {"glVertexAttribPointer", (void*)glVertexAttribPointer},
- {"glViewport", (void*)glViewport},
- {"glEGLImageTargetTexture2DOES", (void*)glEGLImageTargetTexture2DOES},
- {"glEGLImageTargetRenderbufferStorageOES", (void*)glEGLImageTargetRenderbufferStorageOES},
- {"glGetProgramBinaryOES", (void*)glGetProgramBinaryOES},
- {"glProgramBinaryOES", (void*)glProgramBinaryOES},
- {"glMapBufferOES", (void*)glMapBufferOES},
- {"glUnmapBufferOES", (void*)glUnmapBufferOES},
- {"glTexImage3DOES", (void*)glTexImage3DOES},
- {"glTexSubImage3DOES", (void*)glTexSubImage3DOES},
- {"glCopyTexSubImage3DOES", (void*)glCopyTexSubImage3DOES},
- {"glCompressedTexImage3DOES", (void*)glCompressedTexImage3DOES},
- {"glCompressedTexSubImage3DOES", (void*)glCompressedTexSubImage3DOES},
- {"glFramebufferTexture3DOES", (void*)glFramebufferTexture3DOES},
- {"glBindVertexArrayOES", (void*)glBindVertexArrayOES},
- {"glDeleteVertexArraysOES", (void*)glDeleteVertexArraysOES},
- {"glGenVertexArraysOES", (void*)glGenVertexArraysOES},
- {"glIsVertexArrayOES", (void*)glIsVertexArrayOES},
- {"glDiscardFramebufferEXT", (void*)glDiscardFramebufferEXT},
- {"glMultiDrawArraysEXT", (void*)glMultiDrawArraysEXT},
- {"glMultiDrawElementsEXT", (void*)glMultiDrawElementsEXT},
- {"glGetPerfMonitorGroupsAMD", (void*)glGetPerfMonitorGroupsAMD},
- {"glGetPerfMonitorCountersAMD", (void*)glGetPerfMonitorCountersAMD},
- {"glGetPerfMonitorGroupStringAMD", (void*)glGetPerfMonitorGroupStringAMD},
- {"glGetPerfMonitorCounterStringAMD", (void*)glGetPerfMonitorCounterStringAMD},
- {"glGetPerfMonitorCounterInfoAMD", (void*)glGetPerfMonitorCounterInfoAMD},
- {"glGenPerfMonitorsAMD", (void*)glGenPerfMonitorsAMD},
- {"glDeletePerfMonitorsAMD", (void*)glDeletePerfMonitorsAMD},
- {"glSelectPerfMonitorCountersAMD", (void*)glSelectPerfMonitorCountersAMD},
- {"glBeginPerfMonitorAMD", (void*)glBeginPerfMonitorAMD},
- {"glEndPerfMonitorAMD", (void*)glEndPerfMonitorAMD},
- {"glGetPerfMonitorCounterDataAMD", (void*)glGetPerfMonitorCounterDataAMD},
- {"glRenderbufferStorageMultisampleIMG", (void*)glRenderbufferStorageMultisampleIMG},
- {"glFramebufferTexture2DMultisampleIMG", (void*)glFramebufferTexture2DMultisampleIMG},
- {"glDeleteFencesNV", (void*)glDeleteFencesNV},
- {"glGenFencesNV", (void*)glGenFencesNV},
- {"glIsFenceNV", (void*)glIsFenceNV},
- {"glTestFenceNV", (void*)glTestFenceNV},
- {"glGetFenceivNV", (void*)glGetFenceivNV},
- {"glFinishFenceNV", (void*)glFinishFenceNV},
- {"glSetFenceNV", (void*)glSetFenceNV},
- {"glCoverageMaskNV", (void*)glCoverageMaskNV},
- {"glCoverageOperationNV", (void*)glCoverageOperationNV},
- {"glGetDriverControlsQCOM", (void*)glGetDriverControlsQCOM},
- {"glGetDriverControlStringQCOM", (void*)glGetDriverControlStringQCOM},
- {"glEnableDriverControlQCOM", (void*)glEnableDriverControlQCOM},
- {"glDisableDriverControlQCOM", (void*)glDisableDriverControlQCOM},
- {"glExtGetTexturesQCOM", (void*)glExtGetTexturesQCOM},
- {"glExtGetBuffersQCOM", (void*)glExtGetBuffersQCOM},
- {"glExtGetRenderbuffersQCOM", (void*)glExtGetRenderbuffersQCOM},
- {"glExtGetFramebuffersQCOM", (void*)glExtGetFramebuffersQCOM},
- {"glExtGetTexLevelParameterivQCOM", (void*)glExtGetTexLevelParameterivQCOM},
- {"glExtTexObjectStateOverrideiQCOM", (void*)glExtTexObjectStateOverrideiQCOM},
- {"glExtGetTexSubImageQCOM", (void*)glExtGetTexSubImageQCOM},
- {"glExtGetBufferPointervQCOM", (void*)glExtGetBufferPointervQCOM},
- {"glExtGetShadersQCOM", (void*)glExtGetShadersQCOM},
- {"glExtGetProgramsQCOM", (void*)glExtGetProgramsQCOM},
- {"glExtIsProgramBinaryQCOM", (void*)glExtIsProgramBinaryQCOM},
- {"glExtGetProgramBinarySourceQCOM", (void*)glExtGetProgramBinarySourceQCOM},
- {"glStartTilingQCOM", (void*)glStartTilingQCOM},
- {"glEndTilingQCOM", (void*)glEndTilingQCOM},
-};
-static const int gl2_num_funcs = sizeof(gl2_funcs_by_name) / sizeof(struct _gl2_funcs_by_name);
-
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __GUARD_gl2_opcodes_h_
-#define __GUARD_gl2_opcodes_h_
-
-#define OP_glActiveTexture 2048
-#define OP_glAttachShader 2049
-#define OP_glBindAttribLocation 2050
-#define OP_glBindBuffer 2051
-#define OP_glBindFramebuffer 2052
-#define OP_glBindRenderbuffer 2053
-#define OP_glBindTexture 2054
-#define OP_glBlendColor 2055
-#define OP_glBlendEquation 2056
-#define OP_glBlendEquationSeparate 2057
-#define OP_glBlendFunc 2058
-#define OP_glBlendFuncSeparate 2059
-#define OP_glBufferData 2060
-#define OP_glBufferSubData 2061
-#define OP_glCheckFramebufferStatus 2062
-#define OP_glClear 2063
-#define OP_glClearColor 2064
-#define OP_glClearDepthf 2065
-#define OP_glClearStencil 2066
-#define OP_glColorMask 2067
-#define OP_glCompileShader 2068
-#define OP_glCompressedTexImage2D 2069
-#define OP_glCompressedTexSubImage2D 2070
-#define OP_glCopyTexImage2D 2071
-#define OP_glCopyTexSubImage2D 2072
-#define OP_glCreateProgram 2073
-#define OP_glCreateShader 2074
-#define OP_glCullFace 2075
-#define OP_glDeleteBuffers 2076
-#define OP_glDeleteFramebuffers 2077
-#define OP_glDeleteProgram 2078
-#define OP_glDeleteRenderbuffers 2079
-#define OP_glDeleteShader 2080
-#define OP_glDeleteTextures 2081
-#define OP_glDepthFunc 2082
-#define OP_glDepthMask 2083
-#define OP_glDepthRangef 2084
-#define OP_glDetachShader 2085
-#define OP_glDisable 2086
-#define OP_glDisableVertexAttribArray 2087
-#define OP_glDrawArrays 2088
-#define OP_glDrawElements 2089
-#define OP_glEnable 2090
-#define OP_glEnableVertexAttribArray 2091
-#define OP_glFinish 2092
-#define OP_glFlush 2093
-#define OP_glFramebufferRenderbuffer 2094
-#define OP_glFramebufferTexture2D 2095
-#define OP_glFrontFace 2096
-#define OP_glGenBuffers 2097
-#define OP_glGenerateMipmap 2098
-#define OP_glGenFramebuffers 2099
-#define OP_glGenRenderbuffers 2100
-#define OP_glGenTextures 2101
-#define OP_glGetActiveAttrib 2102
-#define OP_glGetActiveUniform 2103
-#define OP_glGetAttachedShaders 2104
-#define OP_glGetAttribLocation 2105
-#define OP_glGetBooleanv 2106
-#define OP_glGetBufferParameteriv 2107
-#define OP_glGetError 2108
-#define OP_glGetFloatv 2109
-#define OP_glGetFramebufferAttachmentParameteriv 2110
-#define OP_glGetIntegerv 2111
-#define OP_glGetProgramiv 2112
-#define OP_glGetProgramInfoLog 2113
-#define OP_glGetRenderbufferParameteriv 2114
-#define OP_glGetShaderiv 2115
-#define OP_glGetShaderInfoLog 2116
-#define OP_glGetShaderPrecisionFormat 2117
-#define OP_glGetShaderSource 2118
-#define OP_glGetString 2119
-#define OP_glGetTexParameterfv 2120
-#define OP_glGetTexParameteriv 2121
-#define OP_glGetUniformfv 2122
-#define OP_glGetUniformiv 2123
-#define OP_glGetUniformLocation 2124
-#define OP_glGetVertexAttribfv 2125
-#define OP_glGetVertexAttribiv 2126
-#define OP_glGetVertexAttribPointerv 2127
-#define OP_glHint 2128
-#define OP_glIsBuffer 2129
-#define OP_glIsEnabled 2130
-#define OP_glIsFramebuffer 2131
-#define OP_glIsProgram 2132
-#define OP_glIsRenderbuffer 2133
-#define OP_glIsShader 2134
-#define OP_glIsTexture 2135
-#define OP_glLineWidth 2136
-#define OP_glLinkProgram 2137
-#define OP_glPixelStorei 2138
-#define OP_glPolygonOffset 2139
-#define OP_glReadPixels 2140
-#define OP_glReleaseShaderCompiler 2141
-#define OP_glRenderbufferStorage 2142
-#define OP_glSampleCoverage 2143
-#define OP_glScissor 2144
-#define OP_glShaderBinary 2145
-#define OP_glShaderSource 2146
-#define OP_glStencilFunc 2147
-#define OP_glStencilFuncSeparate 2148
-#define OP_glStencilMask 2149
-#define OP_glStencilMaskSeparate 2150
-#define OP_glStencilOp 2151
-#define OP_glStencilOpSeparate 2152
-#define OP_glTexImage2D 2153
-#define OP_glTexParameterf 2154
-#define OP_glTexParameterfv 2155
-#define OP_glTexParameteri 2156
-#define OP_glTexParameteriv 2157
-#define OP_glTexSubImage2D 2158
-#define OP_glUniform1f 2159
-#define OP_glUniform1fv 2160
-#define OP_glUniform1i 2161
-#define OP_glUniform1iv 2162
-#define OP_glUniform2f 2163
-#define OP_glUniform2fv 2164
-#define OP_glUniform2i 2165
-#define OP_glUniform2iv 2166
-#define OP_glUniform3f 2167
-#define OP_glUniform3fv 2168
-#define OP_glUniform3i 2169
-#define OP_glUniform3iv 2170
-#define OP_glUniform4f 2171
-#define OP_glUniform4fv 2172
-#define OP_glUniform4i 2173
-#define OP_glUniform4iv 2174
-#define OP_glUniformMatrix2fv 2175
-#define OP_glUniformMatrix3fv 2176
-#define OP_glUniformMatrix4fv 2177
-#define OP_glUseProgram 2178
-#define OP_glValidateProgram 2179
-#define OP_glVertexAttrib1f 2180
-#define OP_glVertexAttrib1fv 2181
-#define OP_glVertexAttrib2f 2182
-#define OP_glVertexAttrib2fv 2183
-#define OP_glVertexAttrib3f 2184
-#define OP_glVertexAttrib3fv 2185
-#define OP_glVertexAttrib4f 2186
-#define OP_glVertexAttrib4fv 2187
-#define OP_glVertexAttribPointer 2188
-#define OP_glViewport 2189
-#define OP_glEGLImageTargetTexture2DOES 2190
-#define OP_glEGLImageTargetRenderbufferStorageOES 2191
-#define OP_glGetProgramBinaryOES 2192
-#define OP_glProgramBinaryOES 2193
-#define OP_glMapBufferOES 2194
-#define OP_glUnmapBufferOES 2195
-#define OP_glTexImage3DOES 2196
-#define OP_glTexSubImage3DOES 2197
-#define OP_glCopyTexSubImage3DOES 2198
-#define OP_glCompressedTexImage3DOES 2199
-#define OP_glCompressedTexSubImage3DOES 2200
-#define OP_glFramebufferTexture3DOES 2201
-#define OP_glBindVertexArrayOES 2202
-#define OP_glDeleteVertexArraysOES 2203
-#define OP_glGenVertexArraysOES 2204
-#define OP_glIsVertexArrayOES 2205
-#define OP_glDiscardFramebufferEXT 2206
-#define OP_glMultiDrawArraysEXT 2207
-#define OP_glMultiDrawElementsEXT 2208
-#define OP_glGetPerfMonitorGroupsAMD 2209
-#define OP_glGetPerfMonitorCountersAMD 2210
-#define OP_glGetPerfMonitorGroupStringAMD 2211
-#define OP_glGetPerfMonitorCounterStringAMD 2212
-#define OP_glGetPerfMonitorCounterInfoAMD 2213
-#define OP_glGenPerfMonitorsAMD 2214
-#define OP_glDeletePerfMonitorsAMD 2215
-#define OP_glSelectPerfMonitorCountersAMD 2216
-#define OP_glBeginPerfMonitorAMD 2217
-#define OP_glEndPerfMonitorAMD 2218
-#define OP_glGetPerfMonitorCounterDataAMD 2219
-#define OP_glRenderbufferStorageMultisampleIMG 2220
-#define OP_glFramebufferTexture2DMultisampleIMG 2221
-#define OP_glDeleteFencesNV 2222
-#define OP_glGenFencesNV 2223
-#define OP_glIsFenceNV 2224
-#define OP_glTestFenceNV 2225
-#define OP_glGetFenceivNV 2226
-#define OP_glFinishFenceNV 2227
-#define OP_glSetFenceNV 2228
-#define OP_glCoverageMaskNV 2229
-#define OP_glCoverageOperationNV 2230
-#define OP_glGetDriverControlsQCOM 2231
-#define OP_glGetDriverControlStringQCOM 2232
-#define OP_glEnableDriverControlQCOM 2233
-#define OP_glDisableDriverControlQCOM 2234
-#define OP_glExtGetTexturesQCOM 2235
-#define OP_glExtGetBuffersQCOM 2236
-#define OP_glExtGetRenderbuffersQCOM 2237
-#define OP_glExtGetFramebuffersQCOM 2238
-#define OP_glExtGetTexLevelParameterivQCOM 2239
-#define OP_glExtTexObjectStateOverrideiQCOM 2240
-#define OP_glExtGetTexSubImageQCOM 2241
-#define OP_glExtGetBufferPointervQCOM 2242
-#define OP_glExtGetShadersQCOM 2243
-#define OP_glExtGetProgramsQCOM 2244
-#define OP_glExtIsProgramBinaryQCOM 2245
-#define OP_glExtGetProgramBinarySourceQCOM 2246
-#define OP_glStartTilingQCOM 2247
-#define OP_glEndTilingQCOM 2248
-#define OP_glVertexAttribPointerData 2249
-#define OP_glVertexAttribPointerOffset 2250
-#define OP_glDrawElementsOffset 2251
-#define OP_glDrawElementsData 2252
-#define OP_glGetCompressedTextureFormats 2253
-#define OP_glShaderString 2254
-#define OP_glFinishRoundTrip 2255
-#define OP_last 2256
-
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _GL_2_TYPES_H_
-#define _GL_2_TYPES_H_
-#include "gl_base_types.h"
-
-typedef void *GLvoidptr;
-#endif
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-$(call emugl-begin-shared-library,libOpenglSystemCommon)
-$(call emugl-import,libGLESv1_enc libGLESv2_enc lib_renderControl_enc)
-
-LOCAL_SRC_FILES := \
- HostConnection.cpp \
- QemuPipeStream.cpp \
- ThreadInfo.cpp
-
-$(call emugl-export,C_INCLUDES,$(LOCAL_PATH) bionic/libc/private)
-
-$(call emugl-end-module)
+++ /dev/null
-/*
-* Copyright 2011 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 _SYSTEM_COMMON_EGL_CLIENT_IFACE_H
-#define _SYSTEM_COMMON_EGL_CLIENT_IFACE_H
-
-struct EGLThreadInfo; // defined in ThreadInfo.h
-
-typedef struct {
- EGLThreadInfo* (*getThreadInfo)();
- const char* (*getGLString)(int glEnum);
-} EGLClient_eglInterface;
-
-typedef struct {
- void* (*getProcAddress)(const char *funcName);
- void (*init)();
- void (*finish)();
-} EGLClient_glesInterface;
-
-//
-// Any GLES/GLES2 client API library should define a function named "init_emul_gles"
-// with the following prototype,
-// It will be called by EGL after loading the GLES library for initialization
-// and exchanging interface function pointers.
-//
-typedef EGLClient_glesInterface *(*init_emul_gles_t)(EGLClient_eglInterface *eglIface);
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2015 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 __COMMON_EGL_IMAGE_H
-#define __COMMON_EGL_IMAGE_H
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <system/window.h>
-
-struct EGLImage_t
-{
- EGLDisplay dpy;
- EGLenum target;
-
- union
- {
- android_native_buffer_t *native_buffer;
- uint32_t host_egl_image;
- };
-};
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "HostConnection.h"
-#include "TcpStream.h"
-#include "QemuPipeStream.h"
-#include "ThreadInfo.h"
-#include <cutils/log.h>
-#include "GLEncoder.h"
-#include "GL2Encoder.h"
-#include <memory>
-
-#define STREAM_BUFFER_SIZE 4*1024*1024
-#define STREAM_PORT_NUM 22468
-
-/* Set to 1 to use a QEMU pipe, or 0 for a TCP connection */
-#define USE_QEMU_PIPE 1
-
-HostConnection::HostConnection() :
- m_stream(NULL),
- m_glEnc(NULL),
- m_gl2Enc(NULL),
- m_rcEnc(NULL),
- m_checksumHelper()
-{
-}
-
-HostConnection::~HostConnection()
-{
- delete m_stream;
- delete m_glEnc;
- delete m_gl2Enc;
- delete m_rcEnc;
-}
-
-HostConnection *HostConnection::get()
-{
- /* TODO: Make this configurable with a system property */
- const int useQemuPipe = USE_QEMU_PIPE;
-
- // Get thread info
- EGLThreadInfo *tinfo = getEGLThreadInfo();
- if (!tinfo) {
- return NULL;
- }
-
- if (tinfo->hostConn == NULL) {
- HostConnection *con = new HostConnection();
- if (NULL == con) {
- return NULL;
- }
-
- if (useQemuPipe) {
- QemuPipeStream *stream = new QemuPipeStream(STREAM_BUFFER_SIZE);
- if (!stream) {
- ALOGE("Failed to create QemuPipeStream for host connection!!!\n");
- delete con;
- return NULL;
- }
- if (stream->connect() < 0) {
- ALOGE("Failed to connect to host (QemuPipeStream)!!!\n");
- delete stream;
- delete con;
- return NULL;
- }
- con->m_stream = stream;
- }
- else /* !useQemuPipe */
- {
- TcpStream *stream = new TcpStream(STREAM_BUFFER_SIZE);
- if (!stream) {
- ALOGE("Failed to create TcpStream for host connection!!!\n");
- delete con;
- return NULL;
- }
-
- if (stream->connect("10.0.2.2", STREAM_PORT_NUM) < 0) {
- ALOGE("Failed to connect to host (TcpStream)!!!\n");
- delete stream;
- delete con;
- return NULL;
- }
- con->m_stream = stream;
- }
-
- // send zero 'clientFlags' to the host.
- unsigned int *pClientFlags =
- (unsigned int *)con->m_stream->allocBuffer(sizeof(unsigned int));
- *pClientFlags = 0;
- con->m_stream->commitBuffer(sizeof(unsigned int));
-
- ALOGD("HostConnection::get() New Host Connection established %p, tid %d\n", con, gettid());
- tinfo->hostConn = con;
- }
-
- return tinfo->hostConn;
-}
-
-GLEncoder *HostConnection::glEncoder()
-{
- if (!m_glEnc) {
- m_glEnc = new GLEncoder(m_stream, checksumHelper());
- DBG("HostConnection::glEncoder new encoder %p, tid %d", m_glEnc, gettid());
- m_glEnc->setContextAccessor(s_getGLContext);
- }
- return m_glEnc;
-}
-
-GL2Encoder *HostConnection::gl2Encoder()
-{
- if (!m_gl2Enc) {
- m_gl2Enc = new GL2Encoder(m_stream, checksumHelper());
- DBG("HostConnection::gl2Encoder new encoder %p, tid %d", m_gl2Enc, gettid());
- m_gl2Enc->setContextAccessor(s_getGL2Context);
- }
- return m_gl2Enc;
-}
-
-renderControl_encoder_context_t *HostConnection::rcEncoder()
-{
- if (!m_rcEnc) {
- m_rcEnc = new renderControl_encoder_context_t(m_stream, checksumHelper());
- // TODO: disable checksum as a workaround in a glTexSubImage2D problem
- // Uncomment the following line when the root cause is solved
- //setChecksumHelper(m_rcEnc);
- }
- return m_rcEnc;
-}
-
-gl_client_context_t *HostConnection::s_getGLContext()
-{
- EGLThreadInfo *ti = getEGLThreadInfo();
- if (ti->hostConn) {
- return ti->hostConn->m_glEnc;
- }
- return NULL;
-}
-
-gl2_client_context_t *HostConnection::s_getGL2Context()
-{
- EGLThreadInfo *ti = getEGLThreadInfo();
- if (ti->hostConn) {
- return ti->hostConn->m_gl2Enc;
- }
- return NULL;
-}
-
-void HostConnection::setChecksumHelper(renderControl_encoder_context_t *rcEnc) {
- std::unique_ptr<char[]> glExtensions;
- int extensionSize = rcEnc->rcGetGLString(rcEnc, GL_EXTENSIONS, NULL, 0);
- if (extensionSize < 0) {
- glExtensions = std::unique_ptr<char[]>(new char[-extensionSize]);
- extensionSize = rcEnc->rcGetGLString(rcEnc, GL_EXTENSIONS, glExtensions.get(), -extensionSize);
- if (extensionSize <= 0) {
- glExtensions.reset();
- }
- }
- // check the host supported version
- uint32_t checksumVersion = 0;
- const char* checksumPrefix = ChecksumCalculator::getMaxVersionStrPrefix();
- const char* glProtocolStr = glExtensions.get() ?
- strstr(glExtensions.get(), checksumPrefix) : NULL;
- if (glProtocolStr) {
- uint32_t maxVersion = ChecksumCalculator::getMaxVersion();
- sscanf(glProtocolStr+strlen(checksumPrefix), "%d", &checksumVersion);
- if (maxVersion < checksumVersion) {
- checksumVersion = maxVersion;
- }
- // The ordering of the following two commands matters!
- // Must tell the host first before setting it in the guest
- rcEnc->rcSelectChecksumHelper(rcEnc, checksumVersion, 0);
- m_checksumHelper.setVersion(checksumVersion);
- }
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 __COMMON_HOST_CONNECTION_H
-#define __COMMON_HOST_CONNECTION_H
-
-#include "IOStream.h"
-#include "renderControl_enc.h"
-#include "ChecksumCalculator.h"
-
-class GLEncoder;
-class gl_client_context_t;
-class GL2Encoder;
-class gl2_client_context_t;
-
-class HostConnection
-{
-public:
- static HostConnection *get();
- ~HostConnection();
-
- GLEncoder *glEncoder();
- GL2Encoder *gl2Encoder();
- renderControl_encoder_context_t *rcEncoder();
- ChecksumCalculator *checksumHelper() { return &m_checksumHelper; }
-
- void flush() {
- if (m_stream) {
- m_stream->flush();
- }
- }
-
-private:
- HostConnection();
- static gl_client_context_t *s_getGLContext();
- static gl2_client_context_t *s_getGL2Context();
- // setProtocol initilizes GL communication protocol for checksums
- // should be called when m_rcEnc is created
- void setChecksumHelper(renderControl_encoder_context_t *rcEnc);
-
-private:
- IOStream *m_stream;
- GLEncoder *m_glEnc;
- GL2Encoder *m_gl2Enc;
- renderControl_encoder_context_t *m_rcEnc;
- ChecksumCalculator m_checksumHelper;
-};
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "QemuPipeStream.h"
-#include <hardware/qemu_pipe.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-QemuPipeStream::QemuPipeStream(size_t bufSize) :
- IOStream(bufSize),
- m_sock(-1),
- m_bufsize(bufSize),
- m_buf(NULL)
-{
-}
-
-QemuPipeStream::QemuPipeStream(int sock, size_t bufSize) :
- IOStream(bufSize),
- m_sock(sock),
- m_bufsize(bufSize),
- m_buf(NULL)
-{
-}
-
-QemuPipeStream::~QemuPipeStream()
-{
- if (m_sock >= 0) {
- flush();
- ::close(m_sock);
- }
- if (m_buf != NULL) {
- free(m_buf);
- }
-}
-
-
-int QemuPipeStream::connect(void)
-{
- m_sock = qemu_pipe_open("opengles");
- if (!valid()) return -1;
- return 0;
-}
-
-void *QemuPipeStream::allocBuffer(size_t minSize)
-{
- size_t allocSize = (m_bufsize < minSize ? minSize : m_bufsize);
- if (!m_buf) {
- m_buf = (unsigned char *)malloc(allocSize);
- }
- else if (m_bufsize < allocSize) {
- unsigned char *p = (unsigned char *)realloc(m_buf, allocSize);
- if (p != NULL) {
- m_buf = p;
- m_bufsize = allocSize;
- } else {
- ERR("realloc (%d) failed\n", allocSize);
- free(m_buf);
- m_buf = NULL;
- m_bufsize = 0;
- }
- }
-
- return m_buf;
-};
-
-int QemuPipeStream::commitBuffer(size_t size)
-{
- return writeFully(m_buf, size);
-}
-
-int QemuPipeStream::writeFully(const void *buf, size_t len)
-{
- //DBG(">> QemuPipeStream::writeFully %d\n", len);
- if (!valid()) return -1;
- if (!buf) {
- if (len>0) {
- // If len is non-zero, buf must not be NULL. Otherwise the pipe would be
- // in a corrupted state, which is lethal for the emulator.
- ERR("QemuPipeStream::writeFully failed, buf=NULL, len %d,"
- " lethal error, exiting", len);
- abort();
- }
- return 0;
- }
-
- size_t res = len;
- int retval = 0;
-
- while (res > 0) {
- ssize_t stat = ::write(m_sock, (const char *)(buf) + (len - res), res);
- if (stat > 0) {
- res -= stat;
- continue;
- }
- if (stat == 0) { /* EOF */
- ERR("QemuPipeStream::writeFully failed: premature EOF\n");
- retval = -1;
- break;
- }
- if (errno == EINTR) {
- continue;
- }
- retval = stat;
- ERR("QemuPipeStream::writeFully failed: %s, lethal error, exiting.\n",
- strerror(errno));
- abort();
- }
- //DBG("<< QemuPipeStream::writeFully %d\n", len );
- return retval;
-}
-
-const unsigned char *QemuPipeStream::readFully(void *buf, size_t len)
-{
- //DBG(">> QemuPipeStream::readFully %d\n", len);
- if (!valid()) return NULL;
- if (!buf) {
- if (len > 0) {
- // If len is non-zero, buf must not be NULL. Otherwise the pipe would be
- // in a corrupted state, which is lethal for the emulator.
- ERR("QemuPipeStream::readFully failed, buf=NULL, len %zu, lethal"
- " error, exiting.", len);
- abort();
- }
- return NULL; // do not allow NULL buf in that implementation
- }
- size_t res = len;
- while (res > 0) {
- ssize_t stat = ::read(m_sock, (char *)(buf) + len - res, res);
- if (stat == 0) {
- // client shutdown;
- return NULL;
- } else if (stat < 0) {
- if (errno == EINTR) {
- continue;
- } else {
- ERR("QemuPipeStream::readFully failed (buf %p, len %zu"
- ", res %zu): %s, lethal error, exiting.", buf, len, res,
- strerror(errno));
- abort();
- }
- } else {
- res -= stat;
- }
- }
- //DBG("<< QemuPipeStream::readFully %d\n", len);
- return (const unsigned char *)buf;
-}
-
-const unsigned char *QemuPipeStream::read( void *buf, size_t *inout_len)
-{
- //DBG(">> QemuPipeStream::read %d\n", *inout_len);
- if (!valid()) return NULL;
- if (!buf) {
- ERR("QemuPipeStream::read failed, buf=NULL");
- return NULL; // do not allow NULL buf in that implementation
- }
-
- int n = recv(buf, *inout_len);
-
- if (n > 0) {
- *inout_len = n;
- return (const unsigned char *)buf;
- }
-
- //DBG("<< QemuPipeStream::read %d\n", *inout_len);
- return NULL;
-}
-
-int QemuPipeStream::recv(void *buf, size_t len)
-{
- if (!valid()) return int(ERR_INVALID_SOCKET);
- char* p = (char *)buf;
- int ret = 0;
- while(len > 0) {
- int res = ::read(m_sock, p, len);
- if (res > 0) {
- p += res;
- ret += res;
- len -= res;
- continue;
- }
- if (res == 0) { /* EOF */
- break;
- }
- if (errno == EINTR)
- continue;
-
- /* A real error */
- if (ret == 0)
- ret = -1;
- break;
- }
- return ret;
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 __QEMU_PIPE_STREAM_H
-#define __QEMU_PIPE_STREAM_H
-
-/* This file implements an IOStream that uses a QEMU fast-pipe
- * to communicate with the emulator's 'opengles' service. See
- * <hardware/qemu_pipe.h> for more details.
- */
-#include <stdlib.h>
-#include "IOStream.h"
-
-class QemuPipeStream : public IOStream {
-public:
- typedef enum { ERR_INVALID_SOCKET = -1000 } QemuPipeStreamError;
-
- explicit QemuPipeStream(size_t bufsize = 10000);
- ~QemuPipeStream();
- int connect(void);
-
- virtual void *allocBuffer(size_t minSize);
- virtual int commitBuffer(size_t size);
- virtual const unsigned char *readFully( void *buf, size_t len);
- virtual const unsigned char *read( void *buf, size_t *inout_len);
-
- bool valid() { return m_sock >= 0; }
- int recv(void *buf, size_t len);
-
- virtual int writeFully(const void *buf, size_t len);
-
-private:
- int m_sock;
- size_t m_bufsize;
- unsigned char *m_buf;
- QemuPipeStream(int sock, size_t bufSize);
-};
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "ThreadInfo.h"
-#include "cutils/threads.h"
-
-thread_store_t s_tls = THREAD_STORE_INITIALIZER;
-
-static void tlsDestruct(void *ptr)
-{
- if (ptr) {
- EGLThreadInfo *ti = (EGLThreadInfo *)ptr;
- delete ti->hostConn;
- delete ti;
- ((void **)__get_tls())[TLS_SLOT_OPENGL] = NULL;
- }
-}
-
-EGLThreadInfo *slow_getEGLThreadInfo()
-{
- EGLThreadInfo *ti = (EGLThreadInfo *)thread_store_get(&s_tls);
- if (ti) return ti;
-
- ti = new EGLThreadInfo();
- thread_store_set(&s_tls, ti, tlsDestruct);
-
- return ti;
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _THREAD_INFO_H
-#define _THREAD_INFO_H
-
-#include "HostConnection.h"
-#include <pthread.h>
-#ifdef __ANDROID__
-#include <bionic_tls.h>
-#endif
-
-struct EGLContext_t;
-
-struct EGLThreadInfo
-{
- EGLThreadInfo() : currentContext(NULL), hostConn(NULL), eglError(EGL_SUCCESS) {}
-
- EGLContext_t *currentContext;
- HostConnection *hostConn;
- int eglError;
-};
-
-
-EGLThreadInfo *slow_getEGLThreadInfo();
-
-#ifdef __ANDROID__
- // We have a dedicated TLS slot in bionic
- inline EGLThreadInfo* getEGLThreadInfo() {
- EGLThreadInfo *tInfo =
- (EGLThreadInfo *)(((uintptr_t *)__get_tls())[TLS_SLOT_OPENGL]);
- if (!tInfo) {
- tInfo = slow_getEGLThreadInfo();
- ((uintptr_t *)__get_tls())[TLS_SLOT_OPENGL] = (uintptr_t)tInfo;
- }
- return tInfo;
- }
-#else
- inline EGLThreadInfo* getEGLThreadInfo() {
- return slow_getEGLThreadInfo();
- }
-#endif
-
-
-
-
-#endif // of _THREAD_INFO_H
+++ /dev/null
-/*
-* Copyright 2011 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 __GRALLOC_CB_H__
-#define __GRALLOC_CB_H__
-
-#include <hardware/hardware.h>
-#include <hardware/gralloc.h>
-#include <cutils/native_handle.h>
-
-#define BUFFER_HANDLE_MAGIC ((int)0xabfabfab)
-#define CB_HANDLE_NUM_INTS(nfds) (int)((sizeof(cb_handle_t) - (nfds)*sizeof(int)) / sizeof(int))
-
-//
-// Our buffer handle structure
-//
-struct cb_handle_t : public native_handle {
-
- cb_handle_t(int p_fd, int p_ashmemSize, int p_usage,
- int p_width, int p_height, int p_frameworkFormat,
- int p_format, int p_glFormat, int p_glType) :
- fd(p_fd),
- magic(BUFFER_HANDLE_MAGIC),
- usage(p_usage),
- width(p_width),
- height(p_height),
- frameworkFormat(p_frameworkFormat),
- format(p_format),
- glFormat(p_glFormat),
- glType(p_glType),
- ashmemSize(p_ashmemSize),
- ashmemBase(0),
- ashmemBasePid(0),
- mappedPid(0),
- lockedLeft(0),
- lockedTop(0),
- lockedWidth(0),
- lockedHeight(0),
- hostHandle(0)
- {
- version = sizeof(native_handle);
- numFds = 0;
- numInts = CB_HANDLE_NUM_INTS(numFds);
- }
-
- ~cb_handle_t() {
- magic = 0;
- }
-
- void setFd(int p_fd) {
- if (p_fd >= 0) {
- numFds = 1;
- }
- else {
- numFds = 0;
- }
- fd = p_fd;
- numInts = CB_HANDLE_NUM_INTS(numFds);
- }
-
- static bool validate(const cb_handle_t* hnd) {
- return (hnd &&
- hnd->version == sizeof(native_handle) &&
- hnd->magic == BUFFER_HANDLE_MAGIC &&
- hnd->numInts == CB_HANDLE_NUM_INTS(hnd->numFds));
- }
-
- bool canBePosted() {
- return (0 != (usage & GRALLOC_USAGE_HW_FB));
- }
-
- // file-descriptors
- int fd; // ashmem fd (-1 of ashmem region did not allocated, i.e. no SW access needed)
-
- // ints
- int magic; // magic number in order to validate a pointer to be a cb_handle_t
- int usage; // usage bits the buffer was created with
- int width; // buffer width
- int height; // buffer height
- int frameworkFormat; // format requested by the Android framework
- int format; // real internal pixel format format
- int glFormat; // OpenGL format enum used for host h/w color buffer
- int glType; // OpenGL type enum used when uploading to host
- int ashmemSize; // ashmem region size for the buffer (0 unless is HW_FB buffer or
- // s/w access is needed)
- union {
- intptr_t ashmemBase; // CPU address of the mapped ashmem region
- uint64_t padding; // enforce same size on 32-bit/64-bit
- } __attribute__((aligned(8)));
-
- int ashmemBasePid; // process id which mapped the ashmem region
- int mappedPid; // process id which succeeded gralloc_register call
- int lockedLeft; // region of buffer locked for s/w write
- int lockedTop;
- int lockedWidth;
- int lockedHeight;
- uint32_t hostHandle;
-};
-
-
-#endif //__GRALLOC_CB_H__
+++ /dev/null
-ifneq (false,$(BUILD_EMULATOR_OPENGL_DRIVER))
-
-LOCAL_PATH := $(call my-dir)
-
-$(call emugl-begin-shared-library,libEGL_emulation)
-$(call emugl-import,libOpenglSystemCommon)
-$(call emugl-set-shared-library-subpath,egl)
-
-LOCAL_CFLAGS += -DLOG_TAG=\"EGL_emulation\" -DEGL_EGLEXT_PROTOTYPES -DWITH_GLES2
-
-LOCAL_SRC_FILES := \
- eglDisplay.cpp \
- egl.cpp \
- ClientAPIExts.cpp
-
-LOCAL_SHARED_LIBRARIES += libdl
-
-# Used to access the Bionic private OpenGL TLS slot
-LOCAL_C_INCLUDES += bionic/libc/private
-
-$(call emugl-end-module)
-
-#### egl.cfg ####
-
-# Ensure that this file is only copied to emulator-specific builds.
-# Other builds are device-specific and will provide their own
-# version of this file to point to the appropriate HW EGL libraries.
-#
-ifneq (,$(filter aosp_arm aosp_x86 aosp_mips full full_x86 full_mips sdk sdk_x86 sdk_mips google_sdk google_sdk_x86 google_sdk_mips,$(TARGET_PRODUCT)))
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := egl.cfg
-LOCAL_SRC_FILES := $(LOCAL_MODULE)
-
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/egl
-LOCAL_MODULE_CLASS := ETC
-
-include $(BUILD_PREBUILT)
-endif # TARGET_PRODUCT in 'full full_x86 full_mips sdk sdk_x86 sdk_mips google_sdk google_sdk_x86 google_sdk_mips')
-
-endif # BUILD_EMULATOR_OPENGL_DRIVER != false
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "ClientAPIExts.h"
-#include "ThreadInfo.h"
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#include "eglContext.h"
-
-namespace ClientAPIExts
-{
-
-//
-// define function pointer type for each extention function
-// typename has the form __egl_{funcname}_t
-//
-#define FUNC_TYPE(fname) __egl_ ## fname ## _t
-#define API_ENTRY(fname,params,args) \
- typedef void (GL_APIENTRY *FUNC_TYPE(fname)) params;
-
-#define API_ENTRY_RET(rtype,fname,params,args) \
- typedef rtype (GL_APIENTRY *FUNC_TYPE(fname)) params;
-
-#include "ClientAPIExts.in"
-#undef API_ENTRY
-#undef API_ENTRY_RET
-
-/////
-// Define static table to store the function value for each
-// client API. functions pointers will get initialized through
-// ClientAPIExts::initClientFuncs function after each client API has been
-// loaded.
-/////
-#define API_ENTRY(fname,params,args) \
- FUNC_TYPE(fname) fname;
-
-#define API_ENTRY_RET(rtype,fname,params,args) \
- API_ENTRY(fname,params,args)
-
-static struct _ext_table
-{
-#include "ClientAPIExts.in"
-} s_client_extensions[2];
-
-#undef API_ENTRY
-#undef API_ENTRY_RET
-
-//
-// This function initialized each entry in the s_client_extensions
-// struct at the givven index using the givven client interface
-//
-void initClientFuncs(const EGLClient_glesInterface *iface, int idx)
-{
-#define API_ENTRY(fname,params,args) \
- s_client_extensions[idx].fname = \
- (FUNC_TYPE(fname))iface->getProcAddress(#fname);
-
-#define API_ENTRY_RET(rtype,fname,params,args) \
- API_ENTRY(fname,params,args)
-
- //
- // reset all func pointers to NULL
- //
- memset(&s_client_extensions[idx], 0, sizeof(struct _ext_table));
-
- //
- // And now query the GLES library for each proc address
- //
-#include "ClientAPIExts.in"
-#undef API_ENTRY
-#undef API_ENTRY_RET
-}
-
-//
-// Define implementation for each extension function which checks
-// the current context version and calls to the correct client API
-// function.
-//
-#define API_ENTRY(fname,params,args) \
- static void _egl_ ## fname params \
- { \
- EGLThreadInfo* thread = getEGLThreadInfo(); \
- if (!thread->currentContext) { \
- return; \
- } \
- int idx = (int)thread->currentContext->version - 1; \
- if (!s_client_extensions[idx].fname) { \
- return; \
- } \
- (*s_client_extensions[idx].fname) args; \
- }
-
-#define API_ENTRY_RET(rtype,fname,params,args) \
- static rtype _egl_ ## fname params \
- { \
- EGLThreadInfo* thread = getEGLThreadInfo(); \
- if (!thread->currentContext) { \
- return (rtype)0; \
- } \
- int idx = (int)thread->currentContext->version - 1; \
- if (!s_client_extensions[idx].fname) { \
- return (rtype)0; \
- } \
- return (*s_client_extensions[idx].fname) args; \
- }
-
-#include "ClientAPIExts.in"
-#undef API_ENTRY
-#undef API_ENTRY_RET
-
-//
-// Define a table to map function names to the local _egl_ version of
-// the extension function, to be used in eglGetProcAddress.
-//
-#define API_ENTRY(fname,params,args) \
- { #fname, (void*)_egl_ ## fname},
-#define API_ENTRY_RET(rtype,fname,params,args) \
- API_ENTRY(fname,params,args)
-
-static const struct _client_ext_funcs {
- const char *fname;
- void* proc;
-} s_client_ext_funcs[] = {
-#include "ClientAPIExts.in"
-};
-static const int numExtFuncs = sizeof(s_client_ext_funcs) /
- sizeof(s_client_ext_funcs[0]);
-
-#undef API_ENTRY
-#undef API_ENTRY_RET
-
-//
-// returns the __egl_ version of the givven extension function name.
-//
-void* getProcAddress(const char *fname)
-{
- for (int i=0; i<numExtFuncs; i++) {
- if (!strcmp(fname, s_client_ext_funcs[i].fname)) {
- return s_client_ext_funcs[i].proc;
- }
- }
- return NULL;
-}
-
-} // of namespace ClientAPIExts
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _CLIENT_APIS_EXTS_H
-#define _CLIENT_APIS_EXTS_H
-
-#include "EGLClientIface.h"
-
-namespace ClientAPIExts
-{
-
-void initClientFuncs(const EGLClient_glesInterface *iface, int idx);
-void* getProcAddress(const char *fname);
-
-} // of namespace ClientAPIExts
-
-#endif
+++ /dev/null
-//
-// Each extension function should have one of the following
-// macro definitions:
-// API_ENTRY(funcname, paramlist, arglist)
-// -or- (if the function has a return value)
-// API_ENTRY_RET(return_type,funcname, paramlist, arglist)
-//
-API_ENTRY(glEGLImageTargetTexture2DOES,
- (GLenum target, GLeglImageOES image),
- (target, image))
-
-API_ENTRY(glEGLImageTargetRenderbufferStorageOES,
- (GLenum target, GLeglImageOES image),
- (target, image))
-
-API_ENTRY(glBlendEquationSeparateOES,
- (GLenum modeRGB, GLenum modeAlpha),
- (modeRGB, modeAlpha))
-
-API_ENTRY(glBlendFuncSeparateOES,
- (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha),
- (srcRGB, dstRGB, srcAlpha, dstAlpha))
-
-API_ENTRY(glBlendEquationOES,
- (GLenum mode),
- (mode))
-
-API_ENTRY(glCurrentPaletteMatrixOES,
- (GLuint matrixpaletteindex),
- (matrixpaletteindex))
-
-API_ENTRY(glLoadPaletteFromModelViewMatrixOES,
- (void),
- ())
-
-API_ENTRY(glMatrixIndexPointerOES,
- (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer),
- (size, type, stride, pointer))
-
-API_ENTRY(glWeightPointerOES,
- (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer),
- (size, type, stride, pointer))
-
-API_ENTRY(glDepthRangefOES,
- (GLclampf zNear, GLclampf zFar),
- (zNear, zFar))
-
-API_ENTRY(glFrustumfOES,
- (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar),
- (left, right, bottom, top, zNear, zFar))
-
-API_ENTRY(glOrthofOES,
- (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar),
- (left, right, bottom, top, zNear, zFar))
-
-API_ENTRY(glClipPlanefOES,
- (GLenum plane, const GLfloat *equation),
- (plane, equation))
-
-API_ENTRY(glGetClipPlanefOES,
- (GLenum pname, GLfloat * eqn),
- (pname, eqn))
-
-API_ENTRY(glClearDepthfOES,
- (GLclampf depth),
- (depth))
-
-API_ENTRY(glPointSizePointerOES,
- (GLenum type, GLsizei stride, const GLvoid *pointer),
- (type, stride, pointer))
-
-API_ENTRY(glTexGenfOES,
- (GLenum coord, GLenum pname, GLfloat param),
- (coord, pname, param))
-
-API_ENTRY(glTexGenfvOES,
- (GLenum coord, GLenum pname, const GLfloat *params),
- (coord, pname, params))
-
-API_ENTRY(glTexGeniOES,
- (GLenum coord, GLenum pname, GLint param),
- (coord, pname, param))
-
-API_ENTRY(glTexGenivOES,
- (GLenum coord, GLenum pname, const GLint *params),
- (coord, pname, params))
-
-API_ENTRY(glTexGenxOES,
- (GLenum coord, GLenum pname, GLfixed param),
- (coord, pname, param))
-
-API_ENTRY(glTexGenxvOES,
- (GLenum coord, GLenum pname, const GLfixed *params),
- (coord, pname, params))
-
-API_ENTRY(glGetTexGenfvOES,
- (GLenum coord, GLenum pname, GLfloat *params),
- (coord, pname, params))
-
-API_ENTRY(glGetTexGenivOES,
- (GLenum coord, GLenum pname, GLint *params),
- (coord, pname, params))
-
-API_ENTRY(glGetTexGenxvOES,
- (GLenum coord, GLenum pname, GLfixed *params),
- (coord, pname, params))
-
-API_ENTRY_RET(GLboolean,
- glIsRenderbufferOES,
- (GLuint renderbuffer),
- (renderbuffer))
-
-API_ENTRY(glBindRenderbufferOES,
- (GLenum target, GLuint renderbuffer),
- (target, renderbuffer))
-
-API_ENTRY(glDeleteRenderbuffersOES,
- (GLsizei n, const GLuint* renderbuffers),
- (n, renderbuffers))
-
-API_ENTRY(glGenRenderbuffersOES,
- (GLsizei n, GLuint* renderbuffers),
- (n, renderbuffers))
-
-API_ENTRY(glRenderbufferStorageOES,
- (GLenum target, GLenum internalformat, GLsizei width, GLsizei height),
- (target, internalformat, width, height))
-
-API_ENTRY(glGetRenderbufferParameterivOES,
- (GLenum target, GLenum pname, GLint* params),
- (target, pname, params))
-
-API_ENTRY_RET(GLboolean,
- glIsFramebufferOES,
- (GLuint framebuffer),
- (framebuffer))
-
-API_ENTRY(glBindFramebufferOES,
- (GLenum target, GLuint framebuffer),
- (target, framebuffer))
-
-API_ENTRY(glDeleteFramebuffersOES,
- (GLsizei n, const GLuint* framebuffers),
- (n, framebuffers))
-
-API_ENTRY(glGenFramebuffersOES,
- (GLsizei n, GLuint* framebuffers),
- (n, framebuffers))
-
-API_ENTRY_RET(GLenum,
- glCheckFramebufferStatusOES,
- (GLenum target),
- (target))
-
-API_ENTRY(glFramebufferTexture2DOES,
- (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level),
- (target, attachment, textarget, texture, level))
-
-API_ENTRY(glFramebufferRenderbufferOES,
- (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer),
- (target, attachment, renderbuffertarget, renderbuffer))
-
-API_ENTRY(glGetFramebufferAttachmentParameterivOES,
- (GLenum target, GLenum attachment, GLenum pname, GLint* params),
- (target, attachment, pname, params))
-
-API_ENTRY(glGenerateMipmapOES,
- (GLenum target),
- (target))
-
-API_ENTRY(glDrawTexsOES,
- (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height),
- (x, y, z, width, height))
-
-API_ENTRY(glDrawTexiOES,
- (GLint x, GLint y, GLint z, GLint width, GLint height),
- (x, y, z, width, height))
-
-API_ENTRY(glDrawTexfOES,
- (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height),
- (x, y, z, width, height))
-
-API_ENTRY(glDrawTexxOES,
- (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height),
- (x, y, z, width, height))
-
-API_ENTRY(glDrawTexsvOES,
- (const GLshort *coords),
- (coords))
-
-API_ENTRY(glDrawTexivOES,
- (const GLint *coords),
- (coords))
-
-API_ENTRY(glDrawTexfvOES,
- (const GLfloat *coords),
- (coords))
-
-API_ENTRY(glDrawTexxvOES,
- (const GLfixed *coords),
- (coords))
+++ /dev/null
-0 0 emulation
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "HostConnection.h"
-#include "ThreadInfo.h"
-#include "eglDisplay.h"
-#include "egl_ftable.h"
-#include <cutils/log.h>
-#include "gralloc_cb.h"
-#include "GLClientState.h"
-#include "GLSharedGroup.h"
-#include "eglContext.h"
-#include "ClientAPIExts.h"
-#include "EGLImage.h"
-
-#include "GLEncoder.h"
-#ifdef WITH_GLES2
-#include "GL2Encoder.h"
-#endif
-
-#include <system/window.h>
-
-template<typename T>
-static T setErrorFunc(GLint error, T returnValue) {
- getEGLThreadInfo()->eglError = error;
- return returnValue;
-}
-
-const char * eglStrError(EGLint err)
-{
- switch (err){
- case EGL_SUCCESS: return "EGL_SUCCESS";
- case EGL_NOT_INITIALIZED: return "EGL_NOT_INITIALIZED";
- case EGL_BAD_ACCESS: return "EGL_BAD_ACCESS";
- case EGL_BAD_ALLOC: return "EGL_BAD_ALLOC";
- case EGL_BAD_ATTRIBUTE: return "EGL_BAD_ATTRIBUTE";
- case EGL_BAD_CONFIG: return "EGL_BAD_CONFIG";
- case EGL_BAD_CONTEXT: return "EGL_BAD_CONTEXT";
- case EGL_BAD_CURRENT_SURFACE: return "EGL_BAD_CURRENT_SURFACE";
- case EGL_BAD_DISPLAY: return "EGL_BAD_DISPLAY";
- case EGL_BAD_MATCH: return "EGL_BAD_MATCH";
- case EGL_BAD_NATIVE_PIXMAP: return "EGL_BAD_NATIVE_PIXMAP";
- case EGL_BAD_NATIVE_WINDOW: return "EGL_BAD_NATIVE_WINDOW";
- case EGL_BAD_PARAMETER: return "EGL_BAD_PARAMETER";
- case EGL_BAD_SURFACE: return "EGL_BAD_SURFACE";
- case EGL_CONTEXT_LOST: return "EGL_CONTEXT_LOST";
- default: return "UNKNOWN";
- }
-}
-
-#define LOG_EGL_ERRORS 1
-
-#ifdef LOG_EGL_ERRORS
-
-#define setErrorReturn(error, retVal) \
- { \
- ALOGE("tid %d: %s(%d): error 0x%x (%s)", gettid(), __FUNCTION__, __LINE__, error, eglStrError(error)); \
- return setErrorFunc(error, retVal); \
- }
-
-#define RETURN_ERROR(ret,err) \
- ALOGE("tid %d: %s(%d): error 0x%x (%s)", gettid(), __FUNCTION__, __LINE__, err, eglStrError(err)); \
- getEGLThreadInfo()->eglError = err; \
- return ret;
-
-#else //!LOG_EGL_ERRORS
-
-#define setErrorReturn(error, retVal) return setErrorFunc(error, retVal);
-
-#define RETURN_ERROR(ret,err) \
- getEGLThreadInfo()->eglError = err; \
- return ret;
-
-#endif //LOG_EGL_ERRORS
-
-#define VALIDATE_CONFIG(cfg,ret) \
- if(((intptr_t)cfg<0)||((intptr_t)cfg>s_display.getNumConfigs())) { \
- RETURN_ERROR(ret,EGL_BAD_CONFIG); \
- }
-
-#define VALIDATE_DISPLAY(dpy,ret) \
- if ((dpy) != (EGLDisplay)&s_display) { \
- RETURN_ERROR(ret, EGL_BAD_DISPLAY); \
- }
-
-#define VALIDATE_DISPLAY_INIT(dpy,ret) \
- VALIDATE_DISPLAY(dpy, ret) \
- if (!s_display.initialized()) { \
- RETURN_ERROR(ret, EGL_NOT_INITIALIZED); \
- }
-
-#define DEFINE_HOST_CONNECTION \
- HostConnection *hostCon = HostConnection::get(); \
- renderControl_encoder_context_t *rcEnc = (hostCon ? hostCon->rcEncoder() : NULL)
-
-#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
- HostConnection *hostCon = HostConnection::get(); \
- if (!hostCon) { \
- ALOGE("egl: Failed to get host connection\n"); \
- return ret; \
- } \
- renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
- if (!rcEnc) { \
- ALOGE("egl: Failed to get renderControl encoder context\n"); \
- return ret; \
- }
-
-#define VALIDATE_CONTEXT_RETURN(context,ret) \
- if (!context) { \
- RETURN_ERROR(ret,EGL_BAD_CONTEXT); \
- }
-
-#define VALIDATE_SURFACE_RETURN(surface, ret) \
- if (surface != EGL_NO_SURFACE) { \
- egl_surface_t* s( static_cast<egl_surface_t*>(surface) ); \
- if (s->dpy != (EGLDisplay)&s_display) \
- setErrorReturn(EGL_BAD_DISPLAY, EGL_FALSE); \
- }
-
-
-EGLContext_t::EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx) :
- dpy(dpy),
- config(config),
- read(EGL_NO_SURFACE),
- draw(EGL_NO_SURFACE),
- shareCtx(shareCtx),
- rcContext(0),
- versionString(NULL),
- vendorString(NULL),
- rendererString(NULL),
- shaderVersionString(NULL),
- extensionString(NULL),
- deletePending(0)
-{
- flags = 0;
- version = 1;
- clientState = new GLClientState();
- if (shareCtx)
- sharedGroup = shareCtx->getSharedGroup();
- else
- sharedGroup = GLSharedGroupPtr(new GLSharedGroup());
-};
-
-EGLContext_t::~EGLContext_t()
-{
- delete clientState;
- delete [] versionString;
- delete [] vendorString;
- delete [] rendererString;
- delete [] shaderVersionString;
- delete [] extensionString;
-}
-
-// ----------------------------------------------------------------------------
-//egl_surface_t
-
-//we don't need to handle depth since it's handled when window created on the host
-
-struct egl_surface_t {
-
- EGLDisplay dpy;
- EGLConfig config;
-
-
- egl_surface_t(EGLDisplay dpy, EGLConfig config, EGLint surfaceType);
- virtual ~egl_surface_t();
-
- virtual void setSwapInterval(int interval) = 0;
- virtual EGLBoolean swapBuffers() = 0;
-
- EGLint getSwapBehavior() const;
- uint32_t getRcSurface() { return rcSurface; }
- EGLint getSurfaceType() { return surfaceType; }
-
- EGLint getWidth(){ return width; }
- EGLint getHeight(){ return height; }
- void setTextureFormat(EGLint _texFormat) { texFormat = _texFormat; }
- EGLint getTextureFormat() { return texFormat; }
- void setTextureTarget(EGLint _texTarget) { texTarget = _texTarget; }
- EGLint getTextureTarget() { return texTarget; }
-
-private:
- //
- //Surface attributes
- //
- EGLint width;
- EGLint height;
- EGLint texFormat;
- EGLint texTarget;
-
-protected:
- void setWidth(EGLint w) { width = w; }
- void setHeight(EGLint h) { height = h; }
-
- EGLint surfaceType;
- uint32_t rcSurface; //handle to surface created via remote control
-};
-
-egl_surface_t::egl_surface_t(EGLDisplay dpy, EGLConfig config, EGLint surfaceType)
- : dpy(dpy), config(config), surfaceType(surfaceType), rcSurface(0)
-{
- width = 0;
- height = 0;
- texFormat = EGL_NO_TEXTURE;
- texTarget = EGL_NO_TEXTURE;
-}
-
-EGLint egl_surface_t::getSwapBehavior() const {
- return EGL_BUFFER_PRESERVED;
-}
-
-egl_surface_t::~egl_surface_t()
-{
-}
-
-// ----------------------------------------------------------------------------
-// egl_window_surface_t
-
-struct egl_window_surface_t : public egl_surface_t {
- static egl_window_surface_t* create(
- EGLDisplay dpy, EGLConfig config, EGLint surfType,
- ANativeWindow* window);
-
- virtual ~egl_window_surface_t();
-
- virtual void setSwapInterval(int interval);
- virtual EGLBoolean swapBuffers();
-
-private:
- egl_window_surface_t(
- EGLDisplay dpy, EGLConfig config, EGLint surfType,
- ANativeWindow* window);
- EGLBoolean init();
-
- ANativeWindow* nativeWindow;
- android_native_buffer_t* buffer;
-};
-
-egl_window_surface_t::egl_window_surface_t (
- EGLDisplay dpy, EGLConfig config, EGLint surfType,
- ANativeWindow* window)
-: egl_surface_t(dpy, config, surfType),
- nativeWindow(window),
- buffer(NULL)
-{
- // keep a reference on the window
- nativeWindow->common.incRef(&nativeWindow->common);
-}
-
-EGLBoolean egl_window_surface_t::init()
-{
- if (nativeWindow->dequeueBuffer_DEPRECATED(nativeWindow, &buffer) != NO_ERROR) {
- setErrorReturn(EGL_BAD_ALLOC, EGL_FALSE);
- }
- setWidth(buffer->width);
- setHeight(buffer->height);
-
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
- rcSurface = rcEnc->rcCreateWindowSurface(rcEnc, (uintptr_t)config,
- getWidth(), getHeight());
- if (!rcSurface) {
- ALOGE("rcCreateWindowSurface returned 0");
- return EGL_FALSE;
- }
- rcEnc->rcSetWindowColorBuffer(rcEnc, rcSurface,
- ((cb_handle_t*)(buffer->handle))->hostHandle);
-
- return EGL_TRUE;
-}
-
-egl_window_surface_t* egl_window_surface_t::create(
- EGLDisplay dpy, EGLConfig config, EGLint surfType,
- ANativeWindow* window)
-{
- egl_window_surface_t* wnd = new egl_window_surface_t(
- dpy, config, surfType, window);
- if (wnd && !wnd->init()) {
- delete wnd;
- wnd = NULL;
- }
- return wnd;
-}
-
-egl_window_surface_t::~egl_window_surface_t() {
- DEFINE_HOST_CONNECTION;
- if (rcSurface && rcEnc) {
- rcEnc->rcDestroyWindowSurface(rcEnc, rcSurface);
- }
- if (buffer) {
- nativeWindow->cancelBuffer_DEPRECATED(nativeWindow, buffer);
- }
- nativeWindow->common.decRef(&nativeWindow->common);
-}
-
-void egl_window_surface_t::setSwapInterval(int interval)
-{
- nativeWindow->setSwapInterval(nativeWindow, interval);
-}
-
-EGLBoolean egl_window_surface_t::swapBuffers()
-{
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
-
- rcEnc->rcFlushWindowColorBuffer(rcEnc, rcSurface);
-
- nativeWindow->queueBuffer_DEPRECATED(nativeWindow, buffer);
- if (nativeWindow->dequeueBuffer_DEPRECATED(nativeWindow, &buffer)) {
- buffer = NULL;
- setErrorReturn(EGL_BAD_ALLOC, EGL_FALSE);
- }
-
- rcEnc->rcSetWindowColorBuffer(rcEnc, rcSurface,
- ((cb_handle_t *)(buffer->handle))->hostHandle);
-
- setWidth(buffer->width);
- setHeight(buffer->height);
-
- return EGL_TRUE;
-}
-
-// ----------------------------------------------------------------------------
-//egl_pbuffer_surface_t
-
-struct egl_pbuffer_surface_t : public egl_surface_t {
- static egl_pbuffer_surface_t* create(EGLDisplay dpy, EGLConfig config,
- EGLint surfType, int32_t w, int32_t h, GLenum pixelFormat);
-
- virtual ~egl_pbuffer_surface_t();
-
- virtual void setSwapInterval(int interval) { (void)interval; }
- virtual EGLBoolean swapBuffers() { return EGL_TRUE; }
-
- uint32_t getRcColorBuffer() { return rcColorBuffer; }
-
-private:
- egl_pbuffer_surface_t(EGLDisplay dpy, EGLConfig config, EGLint surfType,
- int32_t w, int32_t h);
- EGLBoolean init(GLenum format);
-
- uint32_t rcColorBuffer;
-};
-
-egl_pbuffer_surface_t::egl_pbuffer_surface_t(EGLDisplay dpy, EGLConfig config,
- EGLint surfType, int32_t w, int32_t h)
-: egl_surface_t(dpy, config, surfType),
- rcColorBuffer(0)
-{
- setWidth(w);
- setHeight(h);
-}
-
-egl_pbuffer_surface_t::~egl_pbuffer_surface_t()
-{
- DEFINE_HOST_CONNECTION;
- if (rcEnc) {
- if (rcColorBuffer) rcEnc->rcCloseColorBuffer(rcEnc, rcColorBuffer);
- if (rcSurface) rcEnc->rcDestroyWindowSurface(rcEnc, rcSurface);
- }
-}
-
-EGLBoolean egl_pbuffer_surface_t::init(GLenum pixelFormat)
-{
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
-
- rcSurface = rcEnc->rcCreateWindowSurface(rcEnc, (uintptr_t)config,
- getWidth(), getHeight());
- if (!rcSurface) {
- ALOGE("rcCreateWindowSurface returned 0");
- return EGL_FALSE;
- }
-
- rcColorBuffer = rcEnc->rcCreateColorBuffer(rcEnc, getWidth(), getHeight(),
- pixelFormat);
- if (!rcColorBuffer) {
- ALOGE("rcCreateColorBuffer returned 0");
- return EGL_FALSE;
- }
-
- rcEnc->rcSetWindowColorBuffer(rcEnc, rcSurface, rcColorBuffer);
-
- return EGL_TRUE;
-}
-
-egl_pbuffer_surface_t* egl_pbuffer_surface_t::create(EGLDisplay dpy,
- EGLConfig config, EGLint surfType, int32_t w, int32_t h,
- GLenum pixelFormat)
-{
- egl_pbuffer_surface_t* pb = new egl_pbuffer_surface_t(dpy, config, surfType,
- w, h);
- if (pb && !pb->init(pixelFormat)) {
- delete pb;
- pb = NULL;
- }
- return pb;
-}
-
-static const char *getGLString(int glEnum)
-{
- EGLThreadInfo *tInfo = getEGLThreadInfo();
- if (!tInfo || !tInfo->currentContext) {
- return NULL;
- }
-
- const char** strPtr = NULL;
-
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_EXTENSIONS 0x1F03
-
- switch(glEnum) {
- case GL_VERSION:
- strPtr = &tInfo->currentContext->versionString;
- break;
- case GL_VENDOR:
- strPtr = &tInfo->currentContext->vendorString;
- break;
- case GL_RENDERER:
- strPtr = &tInfo->currentContext->rendererString;
- break;
- case GL_SHADING_LANGUAGE_VERSION:
- strPtr = &tInfo->currentContext->shaderVersionString;
- break;
- case GL_EXTENSIONS:
- strPtr = &tInfo->currentContext->extensionString;
- break;
- }
-
- if (!strPtr) {
- return NULL;
- }
-
- if (*strPtr != NULL) {
- //
- // string is already cached
- //
- return *strPtr;
- }
-
- //
- // first query of that string - need to query host
- //
- DEFINE_AND_VALIDATE_HOST_CONNECTION(NULL);
- char *hostStr = NULL;
- int n = rcEnc->rcGetGLString(rcEnc, glEnum, NULL, 0);
- if (n < 0) {
- hostStr = new char[-n+1];
- n = rcEnc->rcGetGLString(rcEnc, glEnum, hostStr, -n);
- if (n <= 0) {
- delete [] hostStr;
- hostStr = NULL;
- }
- }
-
- //
- // keep the string in the context and return its value
- //
- *strPtr = hostStr;
- return hostStr;
-}
-
-// ----------------------------------------------------------------------------
-
-// The one and only supported display object.
-static eglDisplay s_display;
-
-static EGLClient_eglInterface s_eglIface = {
- getThreadInfo: getEGLThreadInfo,
- getGLString: getGLString
-};
-
-#define DBG_FUNC DBG("%s\n", __FUNCTION__)
-EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
-{
- //
- // we support only EGL_DEFAULT_DISPLAY.
- //
- if (display_id != EGL_DEFAULT_DISPLAY) {
- return EGL_NO_DISPLAY;
- }
-
- return (EGLDisplay)&s_display;
-}
-
-EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
-{
- VALIDATE_DISPLAY(dpy,EGL_FALSE);
-
- if (!s_display.initialize(&s_eglIface)) {
- return EGL_FALSE;
- }
- if (major!=NULL)
- *major = s_display.getVersionMajor();
- if (minor!=NULL)
- *minor = s_display.getVersionMinor();
- return EGL_TRUE;
-}
-
-EGLBoolean eglTerminate(EGLDisplay dpy)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
-
- s_display.terminate();
- return EGL_TRUE;
-}
-
-EGLint eglGetError()
-{
- EGLint error = getEGLThreadInfo()->eglError;
- getEGLThreadInfo()->eglError = EGL_SUCCESS;
- return error;
-}
-
-__eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
-{
- // search in EGL function table
- for (int i=0; i<egl_num_funcs; i++) {
- if (!strcmp(egl_funcs_by_name[i].name, procname)) {
- return (__eglMustCastToProperFunctionPointerType)egl_funcs_by_name[i].proc;
- }
- }
-
- // look in gles client api's extensions table
- return (__eglMustCastToProperFunctionPointerType)ClientAPIExts::getProcAddress(procname);
-
- // Fail - function not found.
- return NULL;
-}
-
-const char* eglQueryString(EGLDisplay dpy, EGLint name)
-{
- VALIDATE_DISPLAY_INIT(dpy, NULL);
-
- return s_display.queryString(name);
-}
-
-EGLBoolean eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
-
- if(!num_config) {
- RETURN_ERROR(EGL_FALSE,EGL_BAD_PARAMETER);
- }
-
- GLint numConfigs = s_display.getNumConfigs();
- if (!configs) {
- *num_config = numConfigs;
- return EGL_TRUE;
- }
-
- EGLint i;
- for (i = 0 ; i < numConfigs && i < config_size ; i++) {
- *configs++ = (EGLConfig)(uintptr_t)i;
- }
- *num_config = i;
- return EGL_TRUE;
-}
-
-EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
-
- int attribs_size = 0;
- if (attrib_list) {
- const EGLint * attrib_p = attrib_list;
- while (attrib_p[0] != EGL_NONE) {
- attribs_size += 2;
- attrib_p += 2;
- }
- attribs_size++; //for the terminating EGL_NONE
- }
-
- uint32_t* tempConfigs[config_size];
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
- *num_config = rcEnc->rcChooseConfig(rcEnc, (EGLint*)attrib_list, attribs_size * sizeof(EGLint), (uint32_t*)tempConfigs, config_size);
- if (configs!=NULL) {
- EGLint i=0;
- for (i=0;i<(*num_config);i++) {
- *((uintptr_t*)configs+i) = *((uint32_t*)tempConfigs+i);
- }
- }
-
- if (*num_config <= 0)
- return EGL_FALSE;
- return EGL_TRUE;
-}
-
-EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- VALIDATE_CONFIG(config, EGL_FALSE);
-
- if (s_display.getConfigAttrib(config, attribute, value))
- {
- return EGL_TRUE;
- }
- else
- {
- RETURN_ERROR(EGL_FALSE, EGL_BAD_ATTRIBUTE);
- }
-}
-
-EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
-{
- (void)attrib_list;
-
- VALIDATE_DISPLAY_INIT(dpy, NULL);
- VALIDATE_CONFIG(config, EGL_FALSE);
- if (win == 0) {
- setErrorReturn(EGL_BAD_MATCH, EGL_NO_SURFACE);
- }
-
- EGLint surfaceType;
- if (s_display.getConfigAttrib(config, EGL_SURFACE_TYPE, &surfaceType) == EGL_FALSE) return EGL_FALSE;
-
- if (!(surfaceType & EGL_WINDOW_BIT)) {
- setErrorReturn(EGL_BAD_MATCH, EGL_NO_SURFACE);
- }
-
- if (static_cast<ANativeWindow*>(win)->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
- setErrorReturn(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
- }
-
- egl_surface_t* surface = egl_window_surface_t::create(
- &s_display, config, EGL_WINDOW_BIT, static_cast<ANativeWindow*>(win));
- if (!surface) {
- setErrorReturn(EGL_BAD_ALLOC, EGL_NO_SURFACE);
- }
-
- return surface;
-}
-
-EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
-{
- VALIDATE_DISPLAY_INIT(dpy, NULL);
- VALIDATE_CONFIG(config, EGL_FALSE);
-
- EGLint surfaceType;
- if (s_display.getConfigAttrib(config, EGL_SURFACE_TYPE, &surfaceType) == EGL_FALSE) return EGL_FALSE;
-
- if (!(surfaceType & EGL_PBUFFER_BIT)) {
- setErrorReturn(EGL_BAD_MATCH, EGL_NO_SURFACE);
- }
-
- int32_t w = 0;
- int32_t h = 0;
- EGLint texFormat = EGL_NO_TEXTURE;
- EGLint texTarget = EGL_NO_TEXTURE;
- while (attrib_list[0] != EGL_NONE) {
- switch (attrib_list[0]) {
- case EGL_WIDTH:
- w = attrib_list[1];
- break;
- case EGL_HEIGHT:
- h = attrib_list[1];
- break;
- case EGL_TEXTURE_FORMAT:
- texFormat = attrib_list[1];
- break;
- case EGL_TEXTURE_TARGET:
- texTarget = attrib_list[1];
- break;
- default:
- break;
- };
- attrib_list+=2;
- }
- if (((texFormat == EGL_NO_TEXTURE)&&(texTarget != EGL_NO_TEXTURE)) ||
- ((texFormat != EGL_NO_TEXTURE)&&(texTarget == EGL_NO_TEXTURE))) {
- setErrorReturn(EGL_BAD_MATCH, EGL_NO_SURFACE);
- }
- // TODO: check EGL_TEXTURE_FORMAT - need to support eglBindTexImage
-
- GLenum pixelFormat;
- if (s_display.getConfigGLPixelFormat(config, &pixelFormat) == EGL_FALSE)
- setErrorReturn(EGL_BAD_MATCH, EGL_NO_SURFACE);
-
- egl_surface_t* surface = egl_pbuffer_surface_t::create(dpy, config,
- EGL_PBUFFER_BIT, w, h, pixelFormat);
- if (!surface) {
- setErrorReturn(EGL_BAD_ALLOC, EGL_NO_SURFACE);
- }
-
- //setup attributes
- surface->setTextureFormat(texFormat);
- surface->setTextureTarget(texTarget);
-
- return surface;
-}
-
-EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list)
-{
- //XXX: Pixmap not supported. The host cannot render to a pixmap resource
- // located on host. In order to support Pixmaps we should either punt
- // to s/w rendering -or- let the host render to a buffer that will be
- // copied back to guest at some sync point. None of those methods not
- // implemented and pixmaps are not used with OpenGL anyway ...
- (void)dpy;
- (void)config;
- (void)pixmap;
- (void)attrib_list;
- return EGL_NO_SURFACE;
-}
-
-EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface eglSurface)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- VALIDATE_SURFACE_RETURN(eglSurface, EGL_FALSE);
-
- egl_surface_t* surface(static_cast<egl_surface_t*>(eglSurface));
- delete surface;
-
- return EGL_TRUE;
-}
-
-EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface eglSurface, EGLint attribute, EGLint *value)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- VALIDATE_SURFACE_RETURN(eglSurface, EGL_FALSE);
-
- egl_surface_t* surface( static_cast<egl_surface_t*>(eglSurface) );
- EGLBoolean ret = EGL_TRUE;
- switch (attribute) {
- case EGL_CONFIG_ID:
- ret = s_display.getConfigAttrib(surface->config, EGL_CONFIG_ID, value);
- break;
- case EGL_WIDTH:
- *value = surface->getWidth();
- break;
- case EGL_HEIGHT:
- *value = surface->getHeight();
- break;
- case EGL_TEXTURE_FORMAT:
- *value = surface->getTextureFormat();
- break;
- case EGL_TEXTURE_TARGET:
- *value = surface->getTextureTarget();
- break;
- case EGL_SWAP_BEHAVIOR:
- *value = surface->getSwapBehavior();
- break;
- case EGL_LARGEST_PBUFFER:
- // not modified for a window or pixmap surface
- // and we ignore it when creating a PBuffer surface (default is EGL_FALSE)
- if (surface->getSurfaceType() & EGL_PBUFFER_BIT) *value = EGL_FALSE;
- break;
- case EGL_MIPMAP_LEVEL:
- // not modified for a window or pixmap surface
- // and we ignore it when creating a PBuffer surface (default is 0)
- if (surface->getSurfaceType() & EGL_PBUFFER_BIT) *value = 0;
- break;
- case EGL_MULTISAMPLE_RESOLVE:
- // ignored when creating the surface, return default
- *value = EGL_MULTISAMPLE_RESOLVE_DEFAULT;
- break;
- //TODO: complete other attributes
- default:
- ALOGE("eglQuerySurface %x EGL_BAD_ATTRIBUTE", attribute);
- ret = setErrorFunc(EGL_BAD_ATTRIBUTE, EGL_FALSE);
- break;
- }
-
- return ret;
-}
-
-EGLBoolean eglBindAPI(EGLenum api)
-{
- if (api != EGL_OPENGL_ES_API)
- setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
- return EGL_TRUE;
-}
-
-EGLenum eglQueryAPI()
-{
- return EGL_OPENGL_ES_API;
-}
-
-EGLBoolean eglWaitClient()
-{
- return eglWaitGL();
-}
-
-EGLBoolean eglReleaseThread()
-{
- EGLThreadInfo *tInfo = getEGLThreadInfo();
- if (tInfo && tInfo->currentContext) {
- return eglMakeCurrent(&s_display, EGL_NO_CONTEXT, EGL_NO_SURFACE, EGL_NO_SURFACE);
- }
- return EGL_TRUE;
-}
-
-EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list)
-{
- //TODO
- (void)dpy;
- (void)buftype;
- (void)buffer;
- (void)config;
- (void)attrib_list;
- ALOGW("%s not implemented", __FUNCTION__);
- return 0;
-}
-
-EGLBoolean eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
-{
- // Right now we don't do anything when using host GPU.
- // This is purely just to pass the data through
- // without issuing a warning. We may benefit from validating the
- // display and surface for debug purposes.
- // TODO: Find cases where we actually need to do something.
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- VALIDATE_SURFACE_RETURN(surface, EGL_FALSE);
- if (surface == EGL_NO_SURFACE) {
- setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
- }
-
- (void)value;
-
- switch (attribute) {
- case EGL_MIPMAP_LEVEL:
- case EGL_MULTISAMPLE_RESOLVE:
- case EGL_SWAP_BEHAVIOR:
- return true;
- break;
- default:
- ALOGW("%s: attr=0x%x not implemented", __FUNCTION__, attribute);
- }
- return false;
-}
-
-EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface eglSurface, EGLint buffer)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- VALIDATE_SURFACE_RETURN(eglSurface, EGL_FALSE);
- if (eglSurface == EGL_NO_SURFACE) {
- setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
- }
-
- if (buffer != EGL_BACK_BUFFER) {
- setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- egl_surface_t* surface( static_cast<egl_surface_t*>(eglSurface) );
-
- if (surface->getTextureFormat() == EGL_NO_TEXTURE) {
- setErrorReturn(EGL_BAD_MATCH, EGL_FALSE);
- }
-
- if (!(surface->getSurfaceType() & EGL_PBUFFER_BIT)) {
- setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
- }
-
- //It's now safe to cast to pbuffer surface
- egl_pbuffer_surface_t* pbSurface = (egl_pbuffer_surface_t*)surface;
-
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
- rcEnc->rcBindTexture(rcEnc, pbSurface->getRcColorBuffer());
-
- return GL_TRUE;
-}
-
-EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- //TODO
- (void)dpy;
- (void)surface;
- (void)buffer;
- ALOGW("%s not implemented", __FUNCTION__);
- return 0;
-}
-
-EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
-
- EGLContext_t* ctx = getEGLThreadInfo()->currentContext;
- if (!ctx) {
- setErrorReturn(EGL_BAD_CONTEXT, EGL_FALSE);
- }
- if (!ctx->draw) {
- setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
- }
- egl_surface_t* draw(static_cast<egl_surface_t*>(ctx->draw));
- draw->setSwapInterval(interval);
-
- rcEnc->rcFBSetSwapInterval(rcEnc, interval); //TODO: implement on the host
-
- return EGL_TRUE;
-}
-
-EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_NO_CONTEXT);
- VALIDATE_CONFIG(config, EGL_NO_CONTEXT);
-
- EGLint version = 1; //default
- while (attrib_list && attrib_list[0] != EGL_NONE) {
- if (attrib_list[0] == EGL_CONTEXT_CLIENT_VERSION) version = attrib_list[1];
- attrib_list+=2;
- }
-
- // Currently only support GLES1 and 2
- if (version != 1 && version != 2) {
- setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
- }
-
- uint32_t rcShareCtx = 0;
- EGLContext_t * shareCtx = NULL;
- if (share_context) {
- shareCtx = static_cast<EGLContext_t*>(share_context);
- rcShareCtx = shareCtx->rcContext;
- if (shareCtx->dpy != dpy)
- setErrorReturn(EGL_BAD_MATCH, EGL_NO_CONTEXT);
- }
-
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_NO_CONTEXT);
- uint32_t rcContext = rcEnc->rcCreateContext(rcEnc, (uintptr_t)config, rcShareCtx, version);
- if (!rcContext) {
- ALOGE("rcCreateContext returned 0");
- setErrorReturn(EGL_BAD_ALLOC, EGL_NO_CONTEXT);
- }
-
- EGLContext_t * context = new EGLContext_t(dpy, config, shareCtx);
- if (!context)
- setErrorReturn(EGL_BAD_ALLOC, EGL_NO_CONTEXT);
-
- context->version = version;
- context->rcContext = rcContext;
-
-
- return context;
-}
-
-EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- VALIDATE_CONTEXT_RETURN(ctx, EGL_FALSE);
-
- EGLContext_t * context = static_cast<EGLContext_t*>(ctx);
-
- if (!context) return EGL_TRUE;
-
- if (getEGLThreadInfo()->currentContext == context) {
- getEGLThreadInfo()->currentContext->deletePending = 1;
- return EGL_TRUE;
- }
-
- if (context->rcContext) {
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
- rcEnc->rcDestroyContext(rcEnc, context->rcContext);
- context->rcContext = 0;
- }
-
- delete context;
- return EGL_TRUE;
-}
-
-EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- VALIDATE_SURFACE_RETURN(draw, EGL_FALSE);
- VALIDATE_SURFACE_RETURN(read, EGL_FALSE);
-
- if ((read == EGL_NO_SURFACE && draw == EGL_NO_SURFACE) && (ctx != EGL_NO_CONTEXT))
- setErrorReturn(EGL_BAD_MATCH, EGL_FALSE);
- if ((read != EGL_NO_SURFACE || draw != EGL_NO_SURFACE) && (ctx == EGL_NO_CONTEXT))
- setErrorReturn(EGL_BAD_MATCH, EGL_FALSE);
-
- EGLContext_t * context = static_cast<EGLContext_t*>(ctx);
- uint32_t ctxHandle = (context) ? context->rcContext : 0;
- egl_surface_t * drawSurf = static_cast<egl_surface_t *>(draw);
- uint32_t drawHandle = (drawSurf) ? drawSurf->getRcSurface() : 0;
- egl_surface_t * readSurf = static_cast<egl_surface_t *>(read);
- uint32_t readHandle = (readSurf) ? readSurf->getRcSurface() : 0;
-
- //
- // Nothing to do if no binding change has made
- //
- EGLThreadInfo *tInfo = getEGLThreadInfo();
-
- if (tInfo->currentContext == context &&
- (context == NULL ||
- (context && context->draw == draw && context->read == read))) {
- return EGL_TRUE;
- }
-
- if (tInfo->currentContext && tInfo->currentContext->deletePending) {
- if (tInfo->currentContext != context) {
- EGLContext_t * contextToDelete = tInfo->currentContext;
- tInfo->currentContext = 0;
- eglDestroyContext(dpy, contextToDelete);
- }
- }
-
- if (context && (context->flags & EGLContext_t::IS_CURRENT) && (context != tInfo->currentContext)) {
- //context is current to another thread
- setErrorReturn(EGL_BAD_ACCESS, EGL_FALSE);
- }
-
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
- if (rcEnc->rcMakeCurrent(rcEnc, ctxHandle, drawHandle, readHandle) == EGL_FALSE) {
- ALOGE("rcMakeCurrent returned EGL_FALSE");
- setErrorReturn(EGL_BAD_CONTEXT, EGL_FALSE);
- }
-
- //Now make the local bind
- if (context) {
- context->draw = draw;
- context->read = read;
- context->flags |= EGLContext_t::IS_CURRENT;
- //set the client state
- if (context->version == 2) {
- hostCon->gl2Encoder()->setClientState(context->getClientState());
- hostCon->gl2Encoder()->setSharedGroup(context->getSharedGroup());
- }
- else {
- hostCon->glEncoder()->setClientState(context->getClientState());
- hostCon->glEncoder()->setSharedGroup(context->getSharedGroup());
- }
- }
- else if (tInfo->currentContext) {
- //release ClientState & SharedGroup
- if (tInfo->currentContext->version == 2) {
- hostCon->gl2Encoder()->setClientState(NULL);
- hostCon->gl2Encoder()->setSharedGroup(GLSharedGroupPtr(NULL));
- }
- else {
- hostCon->glEncoder()->setClientState(NULL);
- hostCon->glEncoder()->setSharedGroup(GLSharedGroupPtr(NULL));
- }
-
- }
-
- if (tInfo->currentContext)
- tInfo->currentContext->flags &= ~EGLContext_t::IS_CURRENT;
-
- //Now make current
- tInfo->currentContext = context;
-
- //Check maybe we need to init the encoder, if it's first eglMakeCurrent
- if (tInfo->currentContext) {
- if (tInfo->currentContext->version == 2) {
- if (!hostCon->gl2Encoder()->isInitialized()) {
- s_display.gles2_iface()->init();
- hostCon->gl2Encoder()->setInitialized();
- ClientAPIExts::initClientFuncs(s_display.gles2_iface(), 1);
- }
- }
- else {
- if (!hostCon->glEncoder()->isInitialized()) {
- s_display.gles_iface()->init();
- hostCon->glEncoder()->setInitialized();
- ClientAPIExts::initClientFuncs(s_display.gles_iface(), 0);
- }
- }
- }
-
- return EGL_TRUE;
-}
-
-EGLContext eglGetCurrentContext()
-{
- return getEGLThreadInfo()->currentContext;
-}
-
-EGLSurface eglGetCurrentSurface(EGLint readdraw)
-{
- EGLContext_t * context = getEGLThreadInfo()->currentContext;
- if (!context)
- return EGL_NO_SURFACE; //not an error
-
- switch (readdraw) {
- case EGL_READ:
- return context->read;
- case EGL_DRAW:
- return context->draw;
- default:
- setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_SURFACE);
- }
-}
-
-EGLDisplay eglGetCurrentDisplay()
-{
- EGLContext_t * context = getEGLThreadInfo()->currentContext;
- if (!context)
- return EGL_NO_DISPLAY; //not an error
-
- return context->dpy;
-}
-
-EGLBoolean eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- VALIDATE_CONTEXT_RETURN(ctx, EGL_FALSE);
-
- EGLContext_t * context = static_cast<EGLContext_t*>(ctx);
-
- EGLBoolean ret = EGL_TRUE;
- switch (attribute) {
- case EGL_CONFIG_ID:
- ret = s_display.getConfigAttrib(context->config, EGL_CONFIG_ID, value);
- break;
- case EGL_CONTEXT_CLIENT_TYPE:
- *value = EGL_OPENGL_ES_API;
- break;
- case EGL_CONTEXT_CLIENT_VERSION:
- *value = context->version;
- break;
- case EGL_RENDER_BUFFER:
- if (!context->draw)
- *value = EGL_NONE;
- else
- *value = EGL_BACK_BUFFER; //single buffer not supported
- break;
- default:
- ALOGE("eglQueryContext %x EGL_BAD_ATTRIBUTE", attribute);
- setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_FALSE);
- break;
- }
-
- return ret;
-}
-
-EGLBoolean eglWaitGL()
-{
- EGLThreadInfo *tInfo = getEGLThreadInfo();
- if (!tInfo || !tInfo->currentContext) {
- return EGL_FALSE;
- }
-
- if (tInfo->currentContext->version == 2) {
- s_display.gles2_iface()->finish();
- }
- else {
- s_display.gles_iface()->finish();
- }
-
- return EGL_TRUE;
-}
-
-EGLBoolean eglWaitNative(EGLint engine)
-{
- (void)engine;
- return EGL_TRUE;
-}
-
-EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface eglSurface)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- if (eglSurface == EGL_NO_SURFACE)
- setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
-
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
-
- egl_surface_t* d = static_cast<egl_surface_t*>(eglSurface);
- if (d->dpy != dpy)
- setErrorReturn(EGL_BAD_DISPLAY, EGL_FALSE);
-
- // post the surface
- d->swapBuffers();
-
- hostCon->flush();
- return EGL_TRUE;
-}
-
-EGLBoolean eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
-{
- //TODO :later
- (void)dpy;
- (void)surface;
- (void)target;
- return 0;
-}
-
-EGLBoolean eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list)
-{
- //TODO later
- (void)display;
- (void)surface;
- (void)attrib_list;
- return 0;
-}
-
-EGLBoolean eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface)
-{
- //TODO later
- (void)display;
- (void)surface;
- return 0;
-}
-
-EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
-{
- (void)attrib_list;
-
- VALIDATE_DISPLAY_INIT(dpy, EGL_NO_IMAGE_KHR);
-
- if (target == EGL_NATIVE_BUFFER_ANDROID) {
- if (ctx != EGL_NO_CONTEXT) {
- setErrorReturn(EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR);
- }
-
- android_native_buffer_t* native_buffer = (android_native_buffer_t*)buffer;
-
- if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC)
- setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
-
- if (native_buffer->common.version != sizeof(android_native_buffer_t))
- setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
-
- cb_handle_t *cb = (cb_handle_t *)(native_buffer->handle);
-
- switch (cb->format) {
- case HAL_PIXEL_FORMAT_RGBA_8888:
- case HAL_PIXEL_FORMAT_RGBX_8888:
- case HAL_PIXEL_FORMAT_RGB_888:
- case HAL_PIXEL_FORMAT_RGB_565:
- case HAL_PIXEL_FORMAT_BGRA_8888:
- break;
- default:
- setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
- }
-
- native_buffer->common.incRef(&native_buffer->common);
-
- EGLImage_t *image = new EGLImage_t();
- image->dpy = dpy;
- image->target = target;
- image->native_buffer = native_buffer;
-
- return (EGLImageKHR)image;
- }
- else if (target == EGL_GL_TEXTURE_2D_KHR) {
- VALIDATE_CONTEXT_RETURN(ctx, EGL_NO_IMAGE_KHR);
-
- EGLContext_t *context = static_cast<EGLContext_t*>(ctx);
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_NO_IMAGE_KHR);
-
- uint32_t ctxHandle = (context) ? context->rcContext : 0;
- GLuint texture = (GLuint)reinterpret_cast<uintptr_t>(buffer);
- uint32_t img = rcEnc->rcCreateClientImage(rcEnc, ctxHandle, target, texture);
- EGLImage_t *image = new EGLImage_t();
- image->dpy = dpy;
- image->target = target;
- image->host_egl_image = img;
-
- return (EGLImageKHR)image;
- }
-
- setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
-}
-
-EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
-{
- VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
- EGLImage_t *image = (EGLImage_t*)img;
-
- if (!image || image->dpy != dpy) {
- RETURN_ERROR(EGL_FALSE, EGL_BAD_PARAMETER);
- }
-
- if (image->target == EGL_NATIVE_BUFFER_ANDROID) {
- android_native_buffer_t* native_buffer = image->native_buffer;
-
- if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC)
- setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
-
- if (native_buffer->common.version != sizeof(android_native_buffer_t))
- setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
-
- native_buffer->common.decRef(&native_buffer->common);
- delete image;
-
- return EGL_TRUE;
- }
- else if (image->target == EGL_GL_TEXTURE_2D_KHR) {
- uint32_t host_egl_image = image->host_egl_image;
- delete image;
- DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
- return rcEnc->rcDestroyClientImage(rcEnc, host_egl_image);
- }
-
- setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
-}
-
-#define FENCE_SYNC_HANDLE (EGLSyncKHR)0xFE4CE
-
-EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type,
- const EGLint *attrib_list)
-{
- // TODO: This implementation could be faster. We should require the host EGL
- // to support KHR_fence_sync, or at least pipe the fence command to the host
- // and wait for it (probably involving a glFinish on the host) in
- // eglClientWaitSyncKHR.
-
- VALIDATE_DISPLAY(dpy, EGL_NO_SYNC_KHR);
-
- if (type != EGL_SYNC_FENCE_KHR ||
- (attrib_list != NULL && attrib_list[0] != EGL_NONE)) {
- setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_NO_SYNC_KHR);
- }
-
- EGLThreadInfo *tInfo = getEGLThreadInfo();
- if (!tInfo || !tInfo->currentContext) {
- setErrorReturn(EGL_BAD_MATCH, EGL_NO_SYNC_KHR);
- }
-
- if (tInfo->currentContext->version == 2) {
- s_display.gles2_iface()->finish();
- } else {
- s_display.gles_iface()->finish();
- }
-
- return FENCE_SYNC_HANDLE;
-}
-
-EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
-{
- (void)dpy;
-
- if (sync != FENCE_SYNC_HANDLE) {
- setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- return EGL_TRUE;
-}
-
-EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags,
- EGLTimeKHR timeout)
-{
- (void)dpy;
- (void)flags;
- (void)timeout;
-
- if (sync != FENCE_SYNC_HANDLE) {
- setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- return EGL_CONDITION_SATISFIED_KHR;
-}
-
-EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync,
- EGLint attribute, EGLint *value)
-{
- (void)dpy;
-
- if (sync != FENCE_SYNC_HANDLE) {
- setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- switch (attribute) {
- case EGL_SYNC_TYPE_KHR:
- *value = EGL_SYNC_FENCE_KHR;
- return EGL_TRUE;
- case EGL_SYNC_STATUS_KHR:
- *value = EGL_SIGNALED_KHR;
- return EGL_TRUE;
- case EGL_SYNC_CONDITION_KHR:
- *value = EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR;
- return EGL_TRUE;
- default:
- setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_FALSE);
- }
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _EGL_CONTEXT_H
-#define _EGL_CONTEXT_H
-
-#include "GLClientState.h"
-#include "GLSharedGroup.h"
-
-struct EGLContext_t {
-
- enum {
- IS_CURRENT = 0x00010000,
- NEVER_CURRENT = 0x00020000
- };
-
- EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx);
- ~EGLContext_t();
- uint32_t flags;
- EGLDisplay dpy;
- EGLConfig config;
- EGLSurface read;
- EGLSurface draw;
- EGLContext_t * shareCtx;
- EGLint version;
- uint32_t rcContext;
- const char* versionString;
- const char* vendorString;
- const char* rendererString;
- const char* shaderVersionString;
- const char* extensionString;
- EGLint deletePending;
- GLClientState * getClientState(){ return clientState; }
- GLSharedGroupPtr getSharedGroup(){ return sharedGroup; }
-private:
- GLClientState * clientState;
- GLSharedGroupPtr sharedGroup;
-};
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "eglDisplay.h"
-#include "HostConnection.h"
-#include <dlfcn.h>
-
-static const int systemEGLVersionMajor = 1;
-static const int systemEGLVersionMinor = 4;
-static const char systemEGLVendor[] = "Google Android emulator";
-
-// list of extensions supported by this EGL implementation
-// NOTE that each extension name should be suffixed with space
-static const char systemStaticEGLExtensions[] =
- "EGL_ANDROID_image_native_buffer "
- "EGL_KHR_fence_sync "
- "EGL_KHR_image_base "
- "EGL_KHR_gl_texture_2d_image ";
-
-static void *s_gles_lib = NULL;
-static void *s_gles2_lib = NULL;
-
-// The following function will be called when we (libEGL)
-// gets unloaded
-// At this point we want to unload the gles libraries we
-// might have loaded during initialization
-static void __attribute__ ((destructor)) do_on_unload(void)
-{
- if (s_gles_lib) {
- dlclose(s_gles_lib);
- }
-
- if (s_gles2_lib) {
- dlclose(s_gles2_lib);
- }
-}
-
-eglDisplay::eglDisplay() :
- m_initialized(false),
- m_major(0),
- m_minor(0),
- m_hostRendererVersion(0),
- m_numConfigs(0),
- m_numConfigAttribs(0),
- m_attribs(DefaultKeyedVector<EGLint, EGLint>(ATTRIBUTE_NONE)),
- m_configs(NULL),
- m_gles_iface(NULL),
- m_gles2_iface(NULL),
- m_versionString(NULL),
- m_vendorString(NULL),
- m_extensionString(NULL)
-{
- pthread_mutex_init(&m_lock, NULL);
-}
-
-eglDisplay::~eglDisplay()
-{
- pthread_mutex_destroy(&m_lock);
-}
-
-bool eglDisplay::initialize(EGLClient_eglInterface *eglIface)
-{
- pthread_mutex_lock(&m_lock);
- if (!m_initialized) {
-
- //
- // load GLES client API
- //
-#if __LP64__
- m_gles_iface = loadGLESClientAPI("/system/lib64/egl/libGLESv1_CM_emulation.so",
- eglIface,
- &s_gles_lib);
-#else
- m_gles_iface = loadGLESClientAPI("/system/lib/egl/libGLESv1_CM_emulation.so",
- eglIface,
- &s_gles_lib);
-#endif
- if (!m_gles_iface) {
- pthread_mutex_unlock(&m_lock);
- ALOGE("Failed to load gles1 iface");
- return false;
- }
-
-#ifdef WITH_GLES2
-#if __LP64__
- m_gles2_iface = loadGLESClientAPI("/system/lib64/egl/libGLESv2_emulation.so",
- eglIface,
- &s_gles2_lib);
-#else
- m_gles2_iface = loadGLESClientAPI("/system/lib/egl/libGLESv2_emulation.so",
- eglIface,
- &s_gles2_lib);
-#endif
- // Note that if loading gles2 failed, we can still run with no
- // GLES2 support, having GLES2 is not mandatory.
-#endif
-
- //
- // establish connection with the host
- //
- HostConnection *hcon = HostConnection::get();
- if (!hcon) {
- pthread_mutex_unlock(&m_lock);
- ALOGE("Failed to establish connection with the host\n");
- return false;
- }
-
- //
- // get renderControl encoder instance
- //
- renderControl_encoder_context_t *rcEnc = hcon->rcEncoder();
- if (!rcEnc) {
- pthread_mutex_unlock(&m_lock);
- ALOGE("Failed to get renderControl encoder instance");
- return false;
- }
-
- //
- // Query host reneder and EGL version
- //
- m_hostRendererVersion = rcEnc->rcGetRendererVersion(rcEnc);
- EGLint status = rcEnc->rcGetEGLVersion(rcEnc, &m_major, &m_minor);
- if (status != EGL_TRUE) {
- // host EGL initialization failed !!
- pthread_mutex_unlock(&m_lock);
- return false;
- }
-
- //
- // Take minimum version beween what we support and what the host support
- //
- if (m_major > systemEGLVersionMajor) {
- m_major = systemEGLVersionMajor;
- m_minor = systemEGLVersionMinor;
- }
- else if (m_major == systemEGLVersionMajor &&
- m_minor > systemEGLVersionMinor) {
- m_minor = systemEGLVersionMinor;
- }
-
- //
- // Query the host for the set of configs
- //
- m_numConfigs = rcEnc->rcGetNumConfigs(rcEnc, (uint32_t*)&m_numConfigAttribs);
- if (m_numConfigs <= 0 || m_numConfigAttribs <= 0) {
- // just sanity check - should never happen
- pthread_mutex_unlock(&m_lock);
- return false;
- }
-
- uint32_t nInts = m_numConfigAttribs * (m_numConfigs + 1);
- EGLint tmp_buf[nInts];
- m_configs = new EGLint[nInts-m_numConfigAttribs];
- if (!m_configs) {
- pthread_mutex_unlock(&m_lock);
- return false;
- }
-
- //EGLint n = rcEnc->rcGetConfigs(rcEnc, nInts*sizeof(EGLint), m_configs);
- EGLint n = rcEnc->rcGetConfigs(rcEnc, nInts*sizeof(EGLint), (GLuint*)tmp_buf);
- if (n != m_numConfigs) {
- pthread_mutex_unlock(&m_lock);
- return false;
- }
-
- //Fill the attributes vector.
- //The first m_numConfigAttribs values of tmp_buf are the actual attributes enums.
- for (int i=0; i<m_numConfigAttribs; i++) {
- m_attribs.add(tmp_buf[i], i);
- }
-
- //Copy the actual configs data to m_configs
- memcpy(m_configs, tmp_buf + m_numConfigAttribs, m_numConfigs*m_numConfigAttribs*sizeof(EGLint));
-
- m_initialized = true;
- }
- pthread_mutex_unlock(&m_lock);
-
- processConfigs();
-
- return true;
-}
-
-void eglDisplay::processConfigs()
-{
- for (intptr_t i=0; i<m_numConfigs; i++) {
- EGLConfig config = (EGLConfig)i;
- //Setup the EGL_NATIVE_VISUAL_ID attribute
- PixelFormat format;
- if (getConfigNativePixelFormat(config, &format)) {
- setConfigAttrib(config, EGL_NATIVE_VISUAL_ID, format);
- }
- }
-}
-
-void eglDisplay::terminate()
-{
- pthread_mutex_lock(&m_lock);
- if (m_initialized) {
- m_initialized = false;
- delete [] m_configs;
- m_configs = NULL;
-
- if (m_versionString) {
- free(m_versionString);
- m_versionString = NULL;
- }
- if (m_vendorString) {
- free(m_vendorString);
- m_vendorString = NULL;
- }
- if (m_extensionString) {
- free(m_extensionString);
- m_extensionString = NULL;
- }
- }
- pthread_mutex_unlock(&m_lock);
-}
-
-EGLClient_glesInterface *eglDisplay::loadGLESClientAPI(const char *libName,
- EGLClient_eglInterface *eglIface,
- void **libHandle)
-{
- void *lib = dlopen(libName, RTLD_NOW);
- if (!lib) {
- ALOGE("Failed to dlopen %s", libName);
- return NULL;
- }
-
- init_emul_gles_t init_gles_func = (init_emul_gles_t)dlsym(lib,"init_emul_gles");
- if (!init_gles_func) {
- ALOGE("Failed to find init_emul_gles");
- dlclose((void*)lib);
- return NULL;
- }
-
- *libHandle = lib;
- return (*init_gles_func)(eglIface);
-}
-
-static char *queryHostEGLString(EGLint name)
-{
- HostConnection *hcon = HostConnection::get();
- if (hcon) {
- renderControl_encoder_context_t *rcEnc = hcon->rcEncoder();
- if (rcEnc) {
- int n = rcEnc->rcQueryEGLString(rcEnc, name, NULL, 0);
- if (n < 0) {
- // allocate space for the string with additional
- // space charachter to be suffixed at the end.
- char *str = (char *)malloc(-n+2);
- n = rcEnc->rcQueryEGLString(rcEnc, name, str, -n);
- if (n > 0) {
- // add extra space at end of string which will be
- // needed later when filtering the extension list.
- strcat(str, " ");
- return str;
- }
-
- free(str);
- }
- }
- }
-
- return NULL;
-}
-
-static bool findExtInList(const char* token, int tokenlen, const char* list)
-{
- const char* p = list;
- while (*p != '\0') {
- const char* q = strchr(p, ' ');
- if (q == NULL) {
- /* should not happen, list must be space-terminated */
- break;
- }
- if (tokenlen == (q - p) && !memcmp(token, p, tokenlen)) {
- return true; /* found it */
- }
- p = q+1;
- }
- return false; /* not found */
-}
-
-static char *buildExtensionString()
-{
- //Query host extension string
- char *hostExt = queryHostEGLString(EGL_EXTENSIONS);
- if (!hostExt || (hostExt[1] == '\0')) {
- // no extensions on host - only static extension list supported
- return strdup(systemStaticEGLExtensions);
- }
-
- int n = strlen(hostExt);
- if (n > 0) {
- char *str;
- asprintf(&str,"%s%s", systemStaticEGLExtensions, hostExt);
- free((char*)hostExt);
- return str;
- }
- else {
- free((char*)hostExt);
- return strdup(systemStaticEGLExtensions);
- }
-}
-
-const char *eglDisplay::queryString(EGLint name)
-{
- if (name == EGL_CLIENT_APIS) {
- return "OpenGL_ES";
- }
- else if (name == EGL_VERSION) {
- pthread_mutex_lock(&m_lock);
- if (m_versionString) {
- pthread_mutex_unlock(&m_lock);
- return m_versionString;
- }
-
- // build version string
- asprintf(&m_versionString, "%d.%d", m_major, m_minor);
- pthread_mutex_unlock(&m_lock);
-
- return m_versionString;
- }
- else if (name == EGL_VENDOR) {
- pthread_mutex_lock(&m_lock);
- if (m_vendorString) {
- pthread_mutex_unlock(&m_lock);
- return m_vendorString;
- }
-
- // build vendor string
- const char *hostVendor = queryHostEGLString(EGL_VENDOR);
-
- if (hostVendor) {
- asprintf(&m_vendorString, "%s Host: %s",
- systemEGLVendor, hostVendor);
- free((char*)hostVendor);
- }
- else {
- m_vendorString = (char *)systemEGLVendor;
- }
- pthread_mutex_unlock(&m_lock);
-
- return m_vendorString;
- }
- else if (name == EGL_EXTENSIONS) {
- pthread_mutex_lock(&m_lock);
- if (m_extensionString) {
- pthread_mutex_unlock(&m_lock);
- return m_extensionString;
- }
-
- // build extension string
- m_extensionString = buildExtensionString();
- pthread_mutex_unlock(&m_lock);
-
- return m_extensionString;
- }
- else {
- ALOGE("[%s] Unknown name %d\n", __FUNCTION__, name);
- return NULL;
- }
-}
-
-/* To get the value of attribute <a> of config <c> use the following formula:
- * value = *(m_configs + (int)c*m_numConfigAttribs + a);
- */
-EGLBoolean eglDisplay::getAttribValue(EGLConfig config, EGLint attribIdx, EGLint * value)
-{
- if (attribIdx == ATTRIBUTE_NONE)
- {
- ALOGE("[%s] Bad attribute idx\n", __FUNCTION__);
- return EGL_FALSE;
- }
- *value = *(m_configs + (intptr_t)config*m_numConfigAttribs + attribIdx);
- return EGL_TRUE;
-}
-
-EGLBoolean eglDisplay::getConfigAttrib(EGLConfig config, EGLint attrib, EGLint * value)
-{
- //Though it seems that valueFor() is thread-safe, we don't take chanses
- pthread_mutex_lock(&m_lock);
- EGLBoolean ret = getAttribValue(config, m_attribs.valueFor(attrib), value);
- pthread_mutex_unlock(&m_lock);
- return ret;
-}
-
-void eglDisplay::dumpConfig(EGLConfig config)
-{
- EGLint value = 0;
- DBG("^^^^^^^^^^ dumpConfig %d ^^^^^^^^^^^^^^^^^^", (int)config);
- for (int i=0; i<m_numConfigAttribs; i++) {
- getAttribValue(config, i, &value);
- DBG("{%d}[%d] %d\n", (int)config, i, value);
- }
-}
-
-/* To set the value of attribute <a> of config <c> use the following formula:
- * *(m_configs + (int)c*m_numConfigAttribs + a) = value;
- */
-EGLBoolean eglDisplay::setAttribValue(EGLConfig config, EGLint attribIdx, EGLint value)
-{
- if (attribIdx == ATTRIBUTE_NONE)
- {
- ALOGE("[%s] Bad attribute idx\n", __FUNCTION__);
- return EGL_FALSE;
- }
- *(m_configs + (intptr_t)config*m_numConfigAttribs + attribIdx) = value;
- return EGL_TRUE;
-}
-
-EGLBoolean eglDisplay::setConfigAttrib(EGLConfig config, EGLint attrib, EGLint value)
-{
- //Though it seems that valueFor() is thread-safe, we don't take chanses
- pthread_mutex_lock(&m_lock);
- EGLBoolean ret = setAttribValue(config, m_attribs.valueFor(attrib), value);
- pthread_mutex_unlock(&m_lock);
- return ret;
-}
-
-
-EGLBoolean eglDisplay::getConfigNativePixelFormat(EGLConfig config, PixelFormat * format)
-{
- EGLint redSize, blueSize, greenSize, alphaSize;
-
- if ( !(getAttribValue(config, m_attribs.valueFor(EGL_RED_SIZE), &redSize) &&
- getAttribValue(config, m_attribs.valueFor(EGL_BLUE_SIZE), &blueSize) &&
- getAttribValue(config, m_attribs.valueFor(EGL_GREEN_SIZE), &greenSize) &&
- getAttribValue(config, m_attribs.valueFor(EGL_ALPHA_SIZE), &alphaSize)) )
- {
- ALOGE("Couldn't find value for one of the pixel format attributes");
- return EGL_FALSE;
- }
-
- //calculate the GL internal format
- if ((redSize==8)&&(greenSize==8)&&(blueSize==8)&&(alphaSize==8)) *format = PIXEL_FORMAT_RGBA_8888; //XXX: BGR?
- else if ((redSize==8)&&(greenSize==8)&&(blueSize==8)&&(alphaSize==0)) *format = PIXEL_FORMAT_RGBX_8888; //XXX or PIXEL_FORMAT_RGB_888
- else if ((redSize==5)&&(greenSize==6)&&(blueSize==5)&&(alphaSize==0)) *format = PIXEL_FORMAT_RGB_565;
- else if ((redSize==5)&&(greenSize==5)&&(blueSize==5)&&(alphaSize==1)) *format = PIXEL_FORMAT_RGBA_5551;
- else if ((redSize==4)&&(greenSize==4)&&(blueSize==4)&&(alphaSize==4)) *format = PIXEL_FORMAT_RGBA_4444;
- else {
- return EGL_FALSE;
- }
- return EGL_TRUE;
-}
-EGLBoolean eglDisplay::getConfigGLPixelFormat(EGLConfig config, GLenum * format)
-{
- EGLint redSize, blueSize, greenSize, alphaSize;
-
- if ( !(getAttribValue(config, m_attribs.valueFor(EGL_RED_SIZE), &redSize) &&
- getAttribValue(config, m_attribs.valueFor(EGL_BLUE_SIZE), &blueSize) &&
- getAttribValue(config, m_attribs.valueFor(EGL_GREEN_SIZE), &greenSize) &&
- getAttribValue(config, m_attribs.valueFor(EGL_ALPHA_SIZE), &alphaSize)) )
- {
- ALOGE("Couldn't find value for one of the pixel format attributes");
- return EGL_FALSE;
- }
-
- //calculate the GL internal format
- if ((redSize == greenSize) && (redSize == blueSize) &&
- ((redSize == 8) || (redSize == 16) || (redSize == 32)))
- {
- if (alphaSize == 0) *format = GL_RGB;
- else *format = GL_RGBA;
- }
- else if ((redSize==5)&&(greenSize==6)&&(blueSize==5)&&(alphaSize==0)) *format = GL_RGB565_OES;
- else if ((redSize==5)&&(greenSize==5)&&(blueSize==5)&&(alphaSize==1)) *format = GL_RGB5_A1_OES;
- else if ((redSize==4)&&(greenSize==4)&&(blueSize==4)&&(alphaSize==4)) *format = GL_RGBA4_OES;
- else return EGL_FALSE;
-
- return EGL_TRUE;
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _SYSTEM_EGL_DISPLAY_H
-#define _SYSTEM_EGL_DISPLAY_H
-
-#include <pthread.h>
-#include "glUtils.h"
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include "EGLClientIface.h"
-#include <utils/KeyedVector.h>
-
-#include <ui/PixelFormat.h>
-
-#define ATTRIBUTE_NONE -1
-//FIXME: are we in this namespace?
-using namespace android;
-
-class eglDisplay
-{
-public:
- eglDisplay();
- ~eglDisplay();
-
- bool initialize(EGLClient_eglInterface *eglIface);
- void terminate();
-
- int getVersionMajor() const { return m_major; }
- int getVersionMinor() const { return m_minor; }
- bool initialized() const { return m_initialized; }
-
- const char *queryString(EGLint name);
-
- const EGLClient_glesInterface *gles_iface() const { return m_gles_iface; }
- const EGLClient_glesInterface *gles2_iface() const { return m_gles2_iface; }
-
- int getNumConfigs(){ return m_numConfigs; }
- EGLBoolean getConfigAttrib(EGLConfig config, EGLint attrib, EGLint * value);
- EGLBoolean setConfigAttrib(EGLConfig config, EGLint attrib, EGLint value);
- EGLBoolean getConfigGLPixelFormat(EGLConfig config, GLenum * format);
- EGLBoolean getConfigNativePixelFormat(EGLConfig config, PixelFormat * format);
-
- void dumpConfig(EGLConfig config);
-private:
- EGLClient_glesInterface *loadGLESClientAPI(const char *libName,
- EGLClient_eglInterface *eglIface,
- void **libHandle);
- EGLBoolean getAttribValue(EGLConfig config, EGLint attribIdxi, EGLint * value);
- EGLBoolean setAttribValue(EGLConfig config, EGLint attribIdxi, EGLint value);
- void processConfigs();
-
-private:
- pthread_mutex_t m_lock;
- bool m_initialized;
- int m_major;
- int m_minor;
- int m_hostRendererVersion;
- int m_numConfigs;
- int m_numConfigAttribs;
-
- /* This is the mapping between an attribute name to it's index in any given config */
- DefaultKeyedVector<EGLint, EGLint> m_attribs;
- /* This is an array of all config's attributes values stored in the following sequencial fasion (read: v[c,a] = the value of attribute <a> of config <c>)
- * v[0,0],..,v[0,m_numConfigAttribs-1],
- *...
- * v[m_numConfigs-1,0],..,v[m_numConfigs-1,m_numConfigAttribs-1]
- */
- EGLint *m_configs;
- EGLClient_glesInterface *m_gles_iface;
- EGLClient_glesInterface *m_gles2_iface;
- char *m_versionString;
- char *m_vendorString;
- char *m_extensionString;
-};
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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.
-*/
-static const struct _egl_funcs_by_name {
- const char *name;
- void *proc;
-} egl_funcs_by_name[] = {
- {"eglGetError", (void *)eglGetError},
- {"eglGetDisplay", (void *)eglGetDisplay},
- {"eglInitialize", (void *)eglInitialize},
- {"eglTerminate", (void *)eglTerminate},
- {"eglQueryString", (void *)eglQueryString},
- {"eglGetConfigs", (void *)eglGetConfigs},
- {"eglChooseConfig", (void *)eglChooseConfig},
- {"eglGetConfigAttrib", (void *)eglGetConfigAttrib},
- {"eglCreateWindowSurface", (void *)eglCreateWindowSurface},
- {"eglCreatePbufferSurface", (void *)eglCreatePbufferSurface},
- {"eglCreatePixmapSurface", (void *)eglCreatePixmapSurface},
- {"eglDestroySurface", (void *)eglDestroySurface},
- {"eglQuerySurface", (void *)eglQuerySurface},
- {"eglBindAPI", (void *)eglBindAPI},
- {"eglQueryAPI", (void *)eglQueryAPI},
- {"eglWaitClient", (void *)eglWaitClient},
- {"eglReleaseThread", (void *)eglReleaseThread},
- {"eglCreatePbufferFromClientBuffer", (void *)eglCreatePbufferFromClientBuffer},
- {"eglSurfaceAttrib", (void *)eglSurfaceAttrib},
- {"eglBindTexImage", (void *)eglBindTexImage},
- {"eglReleaseTexImage", (void *)eglReleaseTexImage},
- {"eglSwapInterval", (void *)eglSwapInterval},
- {"eglCreateContext", (void *)eglCreateContext},
- {"eglDestroyContext", (void *)eglDestroyContext},
- {"eglMakeCurrent", (void *)eglMakeCurrent},
- {"eglGetCurrentContext", (void *)eglGetCurrentContext},
- {"eglGetCurrentSurface", (void *)eglGetCurrentSurface},
- {"eglGetCurrentDisplay", (void *)eglGetCurrentDisplay},
- {"eglQueryContext", (void *)eglQueryContext},
- {"eglWaitGL", (void *)eglWaitGL},
- {"eglWaitNative", (void *)eglWaitNative},
- {"eglSwapBuffers", (void *)eglSwapBuffers},
- {"eglCopyBuffers", (void *)eglCopyBuffers},
- {"eglGetProcAddress", (void *)eglGetProcAddress},
- {"eglLockSurfaceKHR", (void *)eglLockSurfaceKHR},
- {"eglUnlockSurfaceKHR", (void *)eglUnlockSurfaceKHR},
- {"eglCreateImageKHR", (void *)eglCreateImageKHR},
- {"eglDestroyImageKHR", (void *)eglDestroyImageKHR},
- {"eglCreateSyncKHR", (void *)eglCreateSyncKHR},
- {"eglDestroySyncKHR", (void *)eglDestroySyncKHR},
- {"eglClientWaitSyncKHR", (void *)eglClientWaitSyncKHR},
- {"eglGetSyncAttribKHR", (void *)eglGetSyncAttribKHR}
-};
-
-static const int egl_num_funcs = sizeof(egl_funcs_by_name) / sizeof(struct _egl_funcs_by_name);
+++ /dev/null
-ifneq (false,$(BUILD_EMULATOR_OPENGL_DRIVER))
-
-LOCAL_PATH := $(call my-dir)
-
-$(call emugl-begin-shared-library,gralloc.goldfish)
-$(call emugl-import,libGLESv1_enc lib_renderControl_enc libOpenglSystemCommon)
-$(call emugl-set-shared-library-subpath,hw)
-
-LOCAL_CFLAGS += -DLOG_TAG=\"gralloc_goldfish\"
-LOCAL_CFLAGS += -Wno-missing-field-initializers
-
-LOCAL_SRC_FILES := gralloc.cpp
-
-# Need to access the special OPENGL TLS Slot
-LOCAL_C_INCLUDES += bionic/libc/private
-LOCAL_SHARED_LIBRARIES += libdl
-
-$(call emugl-end-module)
-
-$(call emugl-begin-shared-library,gralloc.ranchu)
-$(call emugl-import,libGLESv1_enc lib_renderControl_enc libOpenglSystemCommon)
-$(call emugl-set-shared-library-subpath,hw)
-
-LOCAL_CFLAGS += -DLOG_TAG=\"gralloc_ranchu\"
-LOCAL_CFLAGS += -Wno-missing-field-initializers
-
-LOCAL_SRC_FILES := gralloc.cpp
-
-# Need to access the special OPENGL TLS Slot
-LOCAL_C_INCLUDES += bionic/libc/private
-LOCAL_SHARED_LIBRARIES += libdl
-
-$(call emugl-end-module)
-
-endif # BUILD_EMULATOR_OPENGL_DRIVER != false
+++ /dev/null
-/*
-* Copyright (C) 2011 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 <string.h>
-#include <pthread.h>
-#include <limits.h>
-#include <cutils/ashmem.h>
-#include <unistd.h>
-#include <errno.h>
-#include <dlfcn.h>
-#include <sys/mman.h>
-#include "gralloc_cb.h"
-#include "HostConnection.h"
-#include "glUtils.h"
-#include <cutils/log.h>
-#include <cutils/properties.h>
-
-/* Set to 1 or 2 to enable debug traces */
-#define DEBUG 0
-
-#if DEBUG >= 1
-# define D(...) ALOGD(__VA_ARGS__)
-#else
-# define D(...) ((void)0)
-#endif
-
-#if DEBUG >= 2
-# define DD(...) ALOGD(__VA_ARGS__)
-#else
-# define DD(...) ((void)0)
-#endif
-
-#define DBG_FUNC DBG("%s\n", __FUNCTION__)
-//
-// our private gralloc module structure
-//
-struct private_module_t {
- gralloc_module_t base;
-};
-
-/* If not NULL, this is a pointer to the fallback module.
- * This really is gralloc.default, which we'll use if we detect
- * that the emulator we're running in does not support GPU emulation.
- */
-static gralloc_module_t* sFallback;
-static pthread_once_t sFallbackOnce = PTHREAD_ONCE_INIT;
-
-static void fallback_init(void); // forward
-
-
-typedef struct _alloc_list_node {
- buffer_handle_t handle;
- _alloc_list_node *next;
- _alloc_list_node *prev;
-} AllocListNode;
-
-//
-// Our gralloc device structure (alloc interface)
-//
-struct gralloc_device_t {
- alloc_device_t device;
-
- AllocListNode *allocListHead; // double linked list of allocated buffers
- pthread_mutex_t lock;
-};
-
-//
-// Our framebuffer device structure
-//
-struct fb_device_t {
- framebuffer_device_t device;
-};
-
-static int map_buffer(cb_handle_t *cb, void **vaddr)
-{
- if (cb->fd < 0 || cb->ashmemSize <= 0) {
- return -EINVAL;
- }
-
- void *addr = mmap(0, cb->ashmemSize, PROT_READ | PROT_WRITE,
- MAP_SHARED, cb->fd, 0);
- if (addr == MAP_FAILED) {
- return -errno;
- }
-
- cb->ashmemBase = intptr_t(addr);
- cb->ashmemBasePid = getpid();
-
- *vaddr = addr;
- return 0;
-}
-
-#define DEFINE_HOST_CONNECTION \
- HostConnection *hostCon = HostConnection::get(); \
- renderControl_encoder_context_t *rcEnc = (hostCon ? hostCon->rcEncoder() : NULL)
-
-#define DEFINE_AND_VALIDATE_HOST_CONNECTION \
- HostConnection *hostCon = HostConnection::get(); \
- if (!hostCon) { \
- ALOGE("gralloc: Failed to get host connection\n"); \
- return -EIO; \
- } \
- renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
- if (!rcEnc) { \
- ALOGE("gralloc: Failed to get renderControl encoder context\n"); \
- return -EIO; \
- }
-
-
-//
-// gralloc device functions (alloc interface)
-//
-static int gralloc_alloc(alloc_device_t* dev,
- int w, int h, int format, int usage,
- buffer_handle_t* pHandle, int* pStride)
-{
- D("gralloc_alloc w=%d h=%d usage=0x%x\n", w, h, usage);
-
- gralloc_device_t *grdev = (gralloc_device_t *)dev;
- if (!grdev || !pHandle || !pStride) {
- ALOGE("gralloc_alloc: Bad inputs (grdev: %p, pHandle: %p, pStride: %p",
- grdev, pHandle, pStride);
- return -EINVAL;
- }
-
- //
- // Note: in screen capture mode, both sw_write and hw_write will be on
- // and this is a valid usage
- //
- bool sw_write = (0 != (usage & GRALLOC_USAGE_SW_WRITE_MASK));
- bool hw_write = (usage & GRALLOC_USAGE_HW_RENDER);
- bool sw_read = (0 != (usage & GRALLOC_USAGE_SW_READ_MASK));
- bool hw_cam_write = usage & GRALLOC_USAGE_HW_CAMERA_WRITE;
- bool hw_cam_read = usage & GRALLOC_USAGE_HW_CAMERA_READ;
- bool hw_vid_enc_read = usage & GRALLOC_USAGE_HW_VIDEO_ENCODER;
-
- // Keep around original requested format for later validation
- int frameworkFormat = format;
- // Pick the right concrete pixel format given the endpoints as encoded in
- // the usage bits. Every end-point pair needs explicit listing here.
- if (format == HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) {
- // Camera as producer
- if (usage & GRALLOC_USAGE_HW_CAMERA_WRITE) {
- if (usage & GRALLOC_USAGE_HW_TEXTURE) {
- // Camera-to-display is RGBA
- format = HAL_PIXEL_FORMAT_RGBA_8888;
- } else if (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) {
- // Camera-to-encoder is NV21
- format = HAL_PIXEL_FORMAT_YCrCb_420_SP;
- } else if ((usage & GRALLOC_USAGE_HW_CAMERA_MASK) ==
- GRALLOC_USAGE_HW_CAMERA_ZSL) {
- // Camera-to-ZSL-queue is RGB_888
- format = HAL_PIXEL_FORMAT_RGB_888;
- }
- }
-
- if (format == HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) {
- ALOGE("gralloc_alloc: Requested auto format selection, "
- "but no known format for this usage: %d x %d, usage %x",
- w, h, usage);
- return -EINVAL;
- }
- } else if (format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
- // Flexible framework-accessible YUV format; map to NV21 for now
- if (usage & GRALLOC_USAGE_HW_CAMERA_WRITE) {
- format = HAL_PIXEL_FORMAT_YCrCb_420_SP;
- }
- if (format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
- ALOGE("gralloc_alloc: Requested YCbCr_420_888, but no known "
- "specific format for this usage: %d x %d, usage %x",
- w, h, usage);
- }
- }
- bool yuv_format = false;
-
- int ashmem_size = 0;
- int stride = w;
-
- GLenum glFormat = 0;
- GLenum glType = 0;
-
- int bpp = 0;
- int align = 1;
- switch (format) {
- case HAL_PIXEL_FORMAT_RGBA_8888:
- case HAL_PIXEL_FORMAT_RGBX_8888:
- case HAL_PIXEL_FORMAT_BGRA_8888:
- bpp = 4;
- glFormat = GL_RGBA;
- glType = GL_UNSIGNED_BYTE;
- break;
- case HAL_PIXEL_FORMAT_RGB_888:
- bpp = 3;
- glFormat = GL_RGB;
- glType = GL_UNSIGNED_BYTE;
- break;
- case HAL_PIXEL_FORMAT_RGB_565:
- bpp = 2;
- glFormat = GL_RGB;
- glType = GL_UNSIGNED_SHORT_5_6_5;
- break;
- case HAL_PIXEL_FORMAT_RAW16:
- case HAL_PIXEL_FORMAT_Y16:
- bpp = 2;
- align = 16*bpp;
- if (! ((sw_read || hw_cam_read) && (sw_write || hw_cam_write) ) ) {
- // Raw sensor data or Y16 only goes between camera and CPU
- return -EINVAL;
- }
- // Not expecting to actually create any GL surfaces for this
- glFormat = GL_LUMINANCE;
- glType = GL_UNSIGNED_SHORT;
- break;
- case HAL_PIXEL_FORMAT_BLOB:
- bpp = 1;
- if (! (sw_read && hw_cam_write) ) {
- // Blob data cannot be used by HW other than camera emulator
- return -EINVAL;
- }
- // Not expecting to actually create any GL surfaces for this
- glFormat = GL_LUMINANCE;
- glType = GL_UNSIGNED_BYTE;
- break;
- case HAL_PIXEL_FORMAT_YCrCb_420_SP:
- align = 1;
- bpp = 1; // per-channel bpp
- yuv_format = true;
- // Not expecting to actually create any GL surfaces for this
- break;
- case HAL_PIXEL_FORMAT_YV12:
- align = 16;
- bpp = 1; // per-channel bpp
- yuv_format = true;
- // Not expecting to actually create any GL surfaces for this
- break;
- default:
- ALOGE("gralloc_alloc: Unknown format %d", format);
- return -EINVAL;
- }
-
- if (usage & GRALLOC_USAGE_HW_FB) {
- // keep space for postCounter
- ashmem_size += sizeof(uint32_t);
- }
-
- if (sw_read || sw_write || hw_cam_write || hw_vid_enc_read) {
- // keep space for image on guest memory if SW access is needed
- // or if the camera is doing writing
- if (yuv_format) {
- size_t yStride = (w*bpp + (align - 1)) & ~(align-1);
- size_t uvStride = (yStride / 2 + (align - 1)) & ~(align-1);
- size_t uvHeight = h / 2;
- ashmem_size += yStride * h + 2 * (uvHeight * uvStride);
- stride = yStride / bpp;
- } else {
- size_t bpr = (w*bpp + (align-1)) & ~(align-1);
- ashmem_size += (bpr * h);
- stride = bpr / bpp;
- }
- }
-
- D("gralloc_alloc format=%d, ashmem_size=%d, stride=%d, tid %d\n", format,
- ashmem_size, stride, gettid());
-
- //
- // Allocate space in ashmem if needed
- //
- int fd = -1;
- if (ashmem_size > 0) {
- // round to page size;
- ashmem_size = (ashmem_size + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1);
-
- fd = ashmem_create_region("gralloc-buffer", ashmem_size);
- if (fd < 0) {
- ALOGE("gralloc_alloc failed to create ashmem region: %s\n",
- strerror(errno));
- return -errno;
- }
- }
-
- cb_handle_t *cb = new cb_handle_t(fd, ashmem_size, usage,
- w, h, frameworkFormat, format,
- glFormat, glType);
-
- if (ashmem_size > 0) {
- //
- // map ashmem region if exist
- //
- void *vaddr;
- int err = map_buffer(cb, &vaddr);
- if (err) {
- close(fd);
- delete cb;
- return err;
- }
-
- cb->setFd(fd);
- }
-
- //
- // Allocate ColorBuffer handle on the host (only if h/w access is allowed)
- // Only do this for some h/w usages, not all.
- // Also do this if we need to read from the surface, in this case the
- // rendering will still happen on the host but we also need to be able to
- // read back from the color buffer, which requires that there is a buffer
- //
- if (usage & (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER |
- GRALLOC_USAGE_HW_2D | GRALLOC_USAGE_HW_COMPOSER |
- GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_SW_READ_MASK) ) {
- DEFINE_HOST_CONNECTION;
- if (hostCon && rcEnc) {
- cb->hostHandle = rcEnc->rcCreateColorBuffer(rcEnc, w, h, glFormat);
- D("Created host ColorBuffer 0x%x\n", cb->hostHandle);
- }
-
- if (!cb->hostHandle) {
- // Could not create colorbuffer on host !!!
- close(fd);
- delete cb;
- return -EIO;
- }
- }
-
- //
- // alloc succeeded - insert the allocated handle to the allocated list
- //
- AllocListNode *node = new AllocListNode();
- pthread_mutex_lock(&grdev->lock);
- node->handle = cb;
- node->next = grdev->allocListHead;
- node->prev = NULL;
- if (grdev->allocListHead) {
- grdev->allocListHead->prev = node;
- }
- grdev->allocListHead = node;
- pthread_mutex_unlock(&grdev->lock);
-
- *pHandle = cb;
- if (frameworkFormat == HAL_PIXEL_FORMAT_YCbCr_420_888) {
- *pStride = 0;
- } else {
- *pStride = stride;
- }
- return 0;
-}
-
-static int gralloc_free(alloc_device_t* dev,
- buffer_handle_t handle)
-{
- const cb_handle_t *cb = (const cb_handle_t *)handle;
- if (!cb_handle_t::validate((cb_handle_t*)cb)) {
- ERR("gralloc_free: invalid handle");
- return -EINVAL;
- }
-
- if (cb->hostHandle != 0) {
- DEFINE_AND_VALIDATE_HOST_CONNECTION;
- D("Closing host ColorBuffer 0x%x\n", cb->hostHandle);
- rcEnc->rcCloseColorBuffer(rcEnc, cb->hostHandle);
- }
-
- //
- // detach and unmap ashmem area if present
- //
- if (cb->fd > 0) {
- if (cb->ashmemSize > 0 && cb->ashmemBase) {
- munmap((void *)cb->ashmemBase, cb->ashmemSize);
- }
- close(cb->fd);
- }
-
- // remove it from the allocated list
- gralloc_device_t *grdev = (gralloc_device_t *)dev;
- pthread_mutex_lock(&grdev->lock);
- AllocListNode *n = grdev->allocListHead;
- while( n && n->handle != cb ) {
- n = n->next;
- }
- if (n) {
- // buffer found on list - remove it from list
- if (n->next) {
- n->next->prev = n->prev;
- }
- if (n->prev) {
- n->prev->next = n->next;
- }
- else {
- grdev->allocListHead = n->next;
- }
-
- delete n;
- }
- pthread_mutex_unlock(&grdev->lock);
-
- delete cb;
-
- return 0;
-}
-
-static int gralloc_device_close(struct hw_device_t *dev)
-{
- gralloc_device_t* d = reinterpret_cast<gralloc_device_t*>(dev);
- if (d) {
-
- // free still allocated buffers
- while( d->allocListHead != NULL ) {
- gralloc_free(&d->device, d->allocListHead->handle);
- }
-
- // free device
- free(d);
- }
- return 0;
-}
-
-static int fb_compositionComplete(struct framebuffer_device_t* dev)
-{
- (void)dev;
-
- return 0;
-}
-
-//
-// Framebuffer device functions
-//
-static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
-{
- fb_device_t *fbdev = (fb_device_t *)dev;
- cb_handle_t *cb = (cb_handle_t *)buffer;
-
- if (!fbdev || !cb_handle_t::validate(cb) || !cb->canBePosted()) {
- return -EINVAL;
- }
-
- // Make sure we have host connection
- DEFINE_AND_VALIDATE_HOST_CONNECTION;
-
- // increment the post count of the buffer
- intptr_t *postCountPtr = (intptr_t *)cb->ashmemBase;
- if (!postCountPtr) {
- // This should not happen
- return -EINVAL;
- }
- (*postCountPtr)++;
-
- // send post request to host
- rcEnc->rcFBPost(rcEnc, cb->hostHandle);
- hostCon->flush();
-
- return 0;
-}
-
-static int fb_setUpdateRect(struct framebuffer_device_t* dev,
- int l, int t, int w, int h)
-{
- fb_device_t *fbdev = (fb_device_t *)dev;
-
- (void)l;
- (void)t;
- (void)w;
- (void)h;
-
- if (!fbdev) {
- return -EINVAL;
- }
-
- // Make sure we have host connection
- DEFINE_AND_VALIDATE_HOST_CONNECTION;
-
- // send request to host
- // TODO: XXX - should be implemented
- //rcEnc->rc_XXX
-
- return 0;
-}
-
-static int fb_setSwapInterval(struct framebuffer_device_t* dev,
- int interval)
-{
- fb_device_t *fbdev = (fb_device_t *)dev;
-
- if (!fbdev) {
- return -EINVAL;
- }
-
- // Make sure we have host connection
- DEFINE_AND_VALIDATE_HOST_CONNECTION;
-
- // send request to host
- rcEnc->rcFBSetSwapInterval(rcEnc, interval);
- hostCon->flush();
-
- return 0;
-}
-
-static int fb_close(struct hw_device_t *dev)
-{
- fb_device_t *fbdev = (fb_device_t *)dev;
-
- delete fbdev;
-
- return 0;
-}
-
-
-//
-// gralloc module functions - refcount + locking interface
-//
-static int gralloc_register_buffer(gralloc_module_t const* module,
- buffer_handle_t handle)
-{
- pthread_once(&sFallbackOnce, fallback_init);
- if (sFallback != NULL) {
- return sFallback->registerBuffer(sFallback, handle);
- }
-
- D("gralloc_register_buffer(%p) called", handle);
-
- private_module_t *gr = (private_module_t *)module;
- cb_handle_t *cb = (cb_handle_t *)handle;
- if (!gr || !cb_handle_t::validate(cb)) {
- ERR("gralloc_register_buffer(%p): invalid buffer", cb);
- return -EINVAL;
- }
-
- if (cb->hostHandle != 0) {
- DEFINE_AND_VALIDATE_HOST_CONNECTION;
- D("Opening host ColorBuffer 0x%x\n", cb->hostHandle);
- rcEnc->rcOpenColorBuffer2(rcEnc, cb->hostHandle);
- }
-
- //
- // if the color buffer has ashmem region and it is not mapped in this
- // process map it now.
- //
- if (cb->ashmemSize > 0 && cb->mappedPid != getpid()) {
- void *vaddr;
- int err = map_buffer(cb, &vaddr);
- if (err) {
- ERR("gralloc_register_buffer(%p): map failed: %s", cb, strerror(-err));
- return -err;
- }
- cb->mappedPid = getpid();
- }
-
- return 0;
-}
-
-static int gralloc_unregister_buffer(gralloc_module_t const* module,
- buffer_handle_t handle)
-{
- if (sFallback != NULL) {
- return sFallback->unregisterBuffer(sFallback, handle);
- }
-
- private_module_t *gr = (private_module_t *)module;
- cb_handle_t *cb = (cb_handle_t *)handle;
- if (!gr || !cb_handle_t::validate(cb)) {
- ERR("gralloc_unregister_buffer(%p): invalid buffer", cb);
- return -EINVAL;
- }
-
- if (cb->hostHandle != 0) {
- DEFINE_AND_VALIDATE_HOST_CONNECTION;
- D("Closing host ColorBuffer 0x%x\n", cb->hostHandle);
- rcEnc->rcCloseColorBuffer(rcEnc, cb->hostHandle);
- }
-
- //
- // unmap ashmem region if it was previously mapped in this process
- // (through register_buffer)
- //
- if (cb->ashmemSize > 0 && cb->mappedPid == getpid()) {
- void *vaddr;
- int err = munmap((void *)cb->ashmemBase, cb->ashmemSize);
- if (err) {
- ERR("gralloc_unregister_buffer(%p): unmap failed", cb);
- return -EINVAL;
- }
- cb->ashmemBase = 0;
- cb->mappedPid = 0;
- }
-
- D("gralloc_unregister_buffer(%p) done\n", cb);
-
- return 0;
-}
-
-static int gralloc_lock(gralloc_module_t const* module,
- buffer_handle_t handle, int usage,
- int l, int t, int w, int h,
- void** vaddr)
-{
- if (sFallback != NULL) {
- return sFallback->lock(sFallback, handle, usage, l, t, w, h, vaddr);
- }
-
- private_module_t *gr = (private_module_t *)module;
- cb_handle_t *cb = (cb_handle_t *)handle;
- if (!gr || !cb_handle_t::validate(cb)) {
- ALOGE("gralloc_lock bad handle\n");
- return -EINVAL;
- }
-
- // validate format
- if (cb->frameworkFormat == HAL_PIXEL_FORMAT_YCbCr_420_888) {
- ALOGE("gralloc_lock can't be used with YCbCr_420_888 format");
- return -EINVAL;
- }
-
- // Validate usage,
- // 1. cannot be locked for hw access
- // 2. lock for either sw read or write.
- // 3. locked sw access must match usage during alloc time.
- bool sw_read = (0 != (usage & GRALLOC_USAGE_SW_READ_MASK));
- bool sw_write = (0 != (usage & GRALLOC_USAGE_SW_WRITE_MASK));
- bool hw_read = (usage & GRALLOC_USAGE_HW_TEXTURE);
- bool hw_write = (usage & GRALLOC_USAGE_HW_RENDER);
- bool hw_vid_enc_read = (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER);
- bool hw_cam_write = (usage & GRALLOC_USAGE_HW_CAMERA_WRITE);
- bool hw_cam_read = (usage & GRALLOC_USAGE_HW_CAMERA_READ);
- bool sw_read_allowed = (0 != (cb->usage & GRALLOC_USAGE_SW_READ_MASK));
- bool sw_write_allowed = (0 != (cb->usage & GRALLOC_USAGE_SW_WRITE_MASK));
-
- if ( (hw_read || hw_write) ||
- (!sw_read && !sw_write &&
- !hw_cam_write && !hw_cam_read &&
- !hw_vid_enc_read) ||
- (sw_read && !sw_read_allowed) ||
- (sw_write && !sw_write_allowed) ) {
- ALOGE("gralloc_lock usage mismatch usage=0x%x cb->usage=0x%x\n", usage,
- cb->usage);
- return -EINVAL;
- }
-
- intptr_t postCount = 0;
- void *cpu_addr = NULL;
-
- //
- // make sure ashmem area is mapped if needed
- //
- if (cb->canBePosted() || sw_read || sw_write ||
- hw_cam_write || hw_cam_read ||
- hw_vid_enc_read) {
- if (cb->ashmemBasePid != getpid() || !cb->ashmemBase) {
- return -EACCES;
- }
-
- if (cb->canBePosted()) {
- postCount = *((intptr_t *)cb->ashmemBase);
- cpu_addr = (void *)(cb->ashmemBase + sizeof(intptr_t));
- }
- else {
- cpu_addr = (void *)(cb->ashmemBase);
- }
- }
-
- if (cb->hostHandle) {
- // Make sure we have host connection
- DEFINE_AND_VALIDATE_HOST_CONNECTION;
-
- //
- // flush color buffer write cache on host and get its sync status.
- //
- int hostSyncStatus = rcEnc->rcColorBufferCacheFlush(rcEnc, cb->hostHandle,
- postCount,
- sw_read);
- if (hostSyncStatus < 0) {
- // host failed the color buffer sync - probably since it was already
- // locked for write access. fail the lock.
- ALOGE("gralloc_lock cacheFlush failed postCount=%d sw_read=%d\n",
- postCount, sw_read);
- return -EBUSY;
- }
-
- if (sw_read) {
- D("gralloc_lock read back color buffer %d %d\n", cb->width, cb->height);
- rcEnc->rcReadColorBuffer(rcEnc, cb->hostHandle,
- 0, 0, cb->width, cb->height, GL_RGBA, GL_UNSIGNED_BYTE, cpu_addr);
- }
- }
-
- //
- // is virtual address required ?
- //
- if (sw_read || sw_write || hw_cam_write || hw_cam_read || hw_vid_enc_read) {
- *vaddr = cpu_addr;
- }
-
- if (sw_write || hw_cam_write) {
- //
- // Keep locked region if locked for s/w write access.
- //
- cb->lockedLeft = l;
- cb->lockedTop = t;
- cb->lockedWidth = w;
- cb->lockedHeight = h;
- }
-
- DD("gralloc_lock success. vaddr: %p, *vaddr: %p, usage: %x, cpu_addr: %p",
- vaddr, vaddr ? *vaddr : 0, usage, cpu_addr);
-
- return 0;
-}
-
-static int gralloc_unlock(gralloc_module_t const* module,
- buffer_handle_t handle)
-{
- if (sFallback != NULL) {
- return sFallback->unlock(sFallback, handle);
- }
-
- private_module_t *gr = (private_module_t *)module;
- cb_handle_t *cb = (cb_handle_t *)handle;
- if (!gr || !cb_handle_t::validate(cb)) {
- return -EINVAL;
- }
-
- //
- // if buffer was locked for s/w write, we need to update the host with
- // the updated data
- //
- if (cb->hostHandle) {
-
- // Make sure we have host connection
- DEFINE_AND_VALIDATE_HOST_CONNECTION;
-
- void *cpu_addr;
- if (cb->canBePosted()) {
- cpu_addr = (void *)(cb->ashmemBase + sizeof(int));
- }
- else {
- cpu_addr = (void *)(cb->ashmemBase);
- }
-
- if (cb->lockedWidth < cb->width || cb->lockedHeight < cb->height) {
- int bpp = glUtilsPixelBitSize(cb->glFormat, cb->glType) >> 3;
- char *tmpBuf = new char[cb->lockedWidth * cb->lockedHeight * bpp];
-
- int dst_line_len = cb->lockedWidth * bpp;
- int src_line_len = cb->width * bpp;
- char *src = (char *)cpu_addr + cb->lockedTop*src_line_len + cb->lockedLeft*bpp;
- char *dst = tmpBuf;
- for (int y=0; y<cb->lockedHeight; y++) {
- memcpy(dst, src, dst_line_len);
- src += src_line_len;
- dst += dst_line_len;
- }
-
- rcEnc->rcUpdateColorBuffer(rcEnc, cb->hostHandle,
- cb->lockedLeft, cb->lockedTop,
- cb->lockedWidth, cb->lockedHeight,
- cb->glFormat, cb->glType,
- tmpBuf);
-
- delete [] tmpBuf;
- }
- else {
- rcEnc->rcUpdateColorBuffer(rcEnc, cb->hostHandle, 0, 0,
- cb->width, cb->height,
- cb->glFormat, cb->glType,
- cpu_addr);
- }
- }
-
- cb->lockedWidth = cb->lockedHeight = 0;
- return 0;
-}
-
-static int gralloc_lock_ycbcr(gralloc_module_t const* module,
- buffer_handle_t handle, int usage,
- int l, int t, int w, int h,
- android_ycbcr *ycbcr)
-{
- // Not supporting fallback module for YCbCr
- if (sFallback != NULL) {
- return -EINVAL;
- }
-
- if (!ycbcr) {
- ALOGE("gralloc_lock_ycbcr got NULL ycbcr struct");
- return -EINVAL;
- }
-
- private_module_t *gr = (private_module_t *)module;
- cb_handle_t *cb = (cb_handle_t *)handle;
- if (!gr || !cb_handle_t::validate(cb)) {
- ALOGE("gralloc_lock_ycbcr bad handle\n");
- return -EINVAL;
- }
-
- if (cb->frameworkFormat != HAL_PIXEL_FORMAT_YCbCr_420_888) {
- ALOGE("gralloc_lock_ycbcr can only be used with "
- "HAL_PIXEL_FORMAT_YCbCr_420_888, got %x instead",
- cb->frameworkFormat);
- return -EINVAL;
- }
-
- // Validate usage
- // For now, only allow camera write, software read.
- bool sw_read = (0 != (usage & GRALLOC_USAGE_SW_READ_MASK));
- bool hw_cam_write = (usage & GRALLOC_USAGE_HW_CAMERA_WRITE);
- bool sw_read_allowed = (0 != (cb->usage & GRALLOC_USAGE_SW_READ_MASK));
-
- if ( (!hw_cam_write && !sw_read) ||
- (sw_read && !sw_read_allowed) ) {
- ALOGE("gralloc_lock_ycbcr usage mismatch usage:0x%x cb->usage:0x%x\n",
- usage, cb->usage);
- return -EINVAL;
- }
-
- // Make sure memory is mapped, get address
- if (cb->ashmemBasePid != getpid() || !cb->ashmemBase) {
- return -EACCES;
- }
-
- uint8_t *cpu_addr = NULL;
-
- if (cb->canBePosted()) {
- cpu_addr = (uint8_t *)(cb->ashmemBase + sizeof(int));
- }
- else {
- cpu_addr = (uint8_t *)(cb->ashmemBase);
- }
-
- // Calculate offsets to underlying YUV data
- size_t yStride;
- size_t cStride;
- size_t yOffset;
- size_t uOffset;
- size_t vOffset;
- size_t cStep;
- switch (cb->format) {
- case HAL_PIXEL_FORMAT_YCrCb_420_SP:
- yStride = cb->width;
- cStride = cb->width;
- yOffset = 0;
- vOffset = yStride * cb->height;
- uOffset = vOffset + 1;
- cStep = 2;
- break;
- default:
- ALOGE("gralloc_lock_ycbcr unexpected internal format %x",
- cb->format);
- return -EINVAL;
- }
-
- ycbcr->y = cpu_addr + yOffset;
- ycbcr->cb = cpu_addr + uOffset;
- ycbcr->cr = cpu_addr + vOffset;
- ycbcr->ystride = yStride;
- ycbcr->cstride = cStride;
- ycbcr->chroma_step = cStep;
-
- // Zero out reserved fields
- memset(ycbcr->reserved, 0, sizeof(ycbcr->reserved));
-
- //
- // Keep locked region if locked for s/w write access.
- //
- cb->lockedLeft = l;
- cb->lockedTop = t;
- cb->lockedWidth = w;
- cb->lockedHeight = h;
-
- DD("gralloc_lock_ycbcr success. usage: %x, ycbcr.y: %p, .cb: %p, .cr: %p, "
- ".ystride: %d , .cstride: %d, .chroma_step: %d", usage,
- ycbcr->y, ycbcr->cb, ycbcr->cr, ycbcr->ystride, ycbcr->cstride,
- ycbcr->chroma_step);
-
- return 0;
-}
-
-static int gralloc_device_open(const hw_module_t* module,
- const char* name,
- hw_device_t** device)
-{
- int status = -EINVAL;
-
- D("gralloc_device_open %s\n", name);
-
- pthread_once( &sFallbackOnce, fallback_init );
- if (sFallback != NULL) {
- return sFallback->common.methods->open(&sFallback->common, name, device);
- }
-
- if (!strcmp(name, GRALLOC_HARDWARE_GPU0)) {
-
- // Create host connection and keep it in the TLS.
- // return error if connection with host can not be established
- HostConnection *hostCon = HostConnection::get();
- if (!hostCon) {
- ALOGE("gralloc: failed to get host connection while opening %s\n", name);
- return -EIO;
- }
-
- //
- // Allocate memory for the gralloc device (alloc interface)
- //
- gralloc_device_t *dev;
- dev = (gralloc_device_t*)malloc(sizeof(gralloc_device_t));
- if (NULL == dev) {
- return -ENOMEM;
- }
-
- // Initialize our device structure
- //
- dev->device.common.tag = HARDWARE_DEVICE_TAG;
- dev->device.common.version = 0;
- dev->device.common.module = const_cast<hw_module_t*>(module);
- dev->device.common.close = gralloc_device_close;
-
- dev->device.alloc = gralloc_alloc;
- dev->device.free = gralloc_free;
- dev->allocListHead = NULL;
- pthread_mutex_init(&dev->lock, NULL);
-
- *device = &dev->device.common;
- status = 0;
- }
- else if (!strcmp(name, GRALLOC_HARDWARE_FB0)) {
-
- // return error if connection with host can not be established
- DEFINE_AND_VALIDATE_HOST_CONNECTION;
-
- //
- // Query the host for Framebuffer attributes
- //
- D("gralloc: query Frabuffer attribs\n");
- EGLint width = rcEnc->rcGetFBParam(rcEnc, FB_WIDTH);
- D("gralloc: width=%d\n", width);
- EGLint height = rcEnc->rcGetFBParam(rcEnc, FB_HEIGHT);
- D("gralloc: height=%d\n", height);
- EGLint xdpi = rcEnc->rcGetFBParam(rcEnc, FB_XDPI);
- D("gralloc: xdpi=%d\n", xdpi);
- EGLint ydpi = rcEnc->rcGetFBParam(rcEnc, FB_YDPI);
- D("gralloc: ydpi=%d\n", ydpi);
- EGLint fps = rcEnc->rcGetFBParam(rcEnc, FB_FPS);
- D("gralloc: fps=%d\n", fps);
- EGLint min_si = rcEnc->rcGetFBParam(rcEnc, FB_MIN_SWAP_INTERVAL);
- D("gralloc: min_swap=%d\n", min_si);
- EGLint max_si = rcEnc->rcGetFBParam(rcEnc, FB_MAX_SWAP_INTERVAL);
- D("gralloc: max_swap=%d\n", max_si);
-
- //
- // Allocate memory for the framebuffer device
- //
- fb_device_t *dev;
- dev = (fb_device_t*)malloc(sizeof(fb_device_t));
- if (NULL == dev) {
- return -ENOMEM;
- }
- memset(dev, 0, sizeof(fb_device_t));
-
- // Initialize our device structure
- //
- dev->device.common.tag = HARDWARE_DEVICE_TAG;
- dev->device.common.version = 0;
- dev->device.common.module = const_cast<hw_module_t*>(module);
- dev->device.common.close = fb_close;
- dev->device.setSwapInterval = fb_setSwapInterval;
- dev->device.post = fb_post;
- dev->device.setUpdateRect = 0; //fb_setUpdateRect;
- dev->device.compositionComplete = fb_compositionComplete; //XXX: this is a dummy
-
- const_cast<uint32_t&>(dev->device.flags) = 0;
- const_cast<uint32_t&>(dev->device.width) = width;
- const_cast<uint32_t&>(dev->device.height) = height;
- const_cast<int&>(dev->device.stride) = width;
- const_cast<int&>(dev->device.format) = HAL_PIXEL_FORMAT_RGBA_8888;
- const_cast<float&>(dev->device.xdpi) = xdpi;
- const_cast<float&>(dev->device.ydpi) = ydpi;
- const_cast<float&>(dev->device.fps) = fps;
- const_cast<int&>(dev->device.minSwapInterval) = min_si;
- const_cast<int&>(dev->device.maxSwapInterval) = max_si;
- *device = &dev->device.common;
-
- status = 0;
- }
-
- return status;
-}
-
-//
-// define the HMI symbol - our module interface
-//
-static struct hw_module_methods_t gralloc_module_methods = {
- open: gralloc_device_open
-};
-
-struct private_module_t HAL_MODULE_INFO_SYM = {
- base: {
- common: {
- tag: HARDWARE_MODULE_TAG,
- module_api_version: GRALLOC_MODULE_API_VERSION_0_2,
- hal_api_version: 0,
- id: GRALLOC_HARDWARE_MODULE_ID,
- name: "Graphics Memory Allocator Module",
- author: "The Android Open Source Project",
- methods: &gralloc_module_methods,
- dso: NULL,
- reserved: {0, }
- },
- registerBuffer: gralloc_register_buffer,
- unregisterBuffer: gralloc_unregister_buffer,
- lock: gralloc_lock,
- unlock: gralloc_unlock,
- perform: NULL,
- lock_ycbcr: gralloc_lock_ycbcr,
- }
-};
-
-/* This function is called once to detect whether the emulator supports
- * GPU emulation (this is done by looking at the qemu.gles kernel
- * parameter, which must be == 1 if this is the case).
- *
- * If not, then load gralloc.default instead as a fallback.
- */
-static void
-fallback_init(void)
-{
- char prop[PROPERTY_VALUE_MAX];
- void* module;
-
- // qemu.gles=0 -> no GLES 2.x support (only 1.x through software).
- // qemu.gles=1 -> host-side GPU emulation through EmuGL
- // qemu.gles=2 -> guest-side GPU emulation.
- property_get("ro.kernel.qemu.gles", prop, "0");
- if (atoi(prop) == 1) {
- return;
- }
- ALOGD("Emulator without host-side GPU emulation detected.");
-#if __LP64__
- module = dlopen("/system/lib64/hw/gralloc.default.so", RTLD_LAZY|RTLD_LOCAL);
-#else
- module = dlopen("/system/lib/hw/gralloc.default.so", RTLD_LAZY|RTLD_LOCAL);
-#endif
- if (module != NULL) {
- sFallback = reinterpret_cast<gralloc_module_t*>(dlsym(module, HAL_MODULE_INFO_SYM_AS_STR));
- if (sFallback == NULL) {
- dlclose(module);
- }
- }
- if (sFallback == NULL) {
- ALOGE("Could not find software fallback module!?");
- }
-}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-$(call emugl-begin-shared-library,lib_renderControl_enc)
-
-LOCAL_SRC_FILES := \
- renderControl_client_context.cpp \
- renderControl_enc.cpp \
- renderControl_entry.cpp
-
-$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
-$(call emugl-import,libOpenglCodecCommon)
-$(call emugl-end-module)
+++ /dev/null
-The renderControl.in file in this directory defines an API which is decoded
-on the android guest into a stream and get decoded and executed on the host.
-It is used in order to query the host renderer as well as send the host renderer
-control commands.
-
-The following describes each of the entries defined by this renderControl API.
-
-
-GLint rcGetRendererVersion();
- This function queries the host renderer version number.
-
-EGLint rcGetEGLVersion(EGLint* major, EGLint* minor);
- This function queries the host renderer for the EGL version
- it supports. returns EGL_FALSE on failure.
-
-EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize);
- This function queries the host for EGL string (.i.e EGL_EXTENSIONS).
- if buffer is NULL or the bufferSize is not big enough the return value
- is the negative number of bytes required to store the string value
- otherwise the string value is copied to buffer and its size is
- returned.
-
-EGLint rcGetNumConfigs(uint32_t* numAttribs);
- queries the host for the number of supported EGL configs.
- The function returns the number of supported configs and returns in
- numAttribs the number of attributes available for each config.
-
-EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer);
- This function queries the host for the all set of supported configs
- with their attribute values.
- bufSize is the size of buffer, the size should be at least equal to
- (numConfigs + 1) * numAttribs * sizeof(GLuint)
- where numConfigs and numAttribs are the values returned in
- rcGetNumConfigs. if bufSize is not big enough then the negative number
- of required bytes is returned otherwise the function returns the number
- of configs and buffer is filled as follows: The first 'numAttribs'
- integer values are filled with the EGL enumerant describing a config
- attribute, next for each config there are 'numAttribs' integer values
- holding the attribute values for that config, the values are specified
- in the same order as the attribute vector.
-
-EGLint rcChooseConfig(EGLint *attribs, uint32_t attribs_size, uint32_t *configs, uint32_t configs_size)
- This function triggers an eglChooseConfig on the host, to get a list of
- configs matching the given attribs values.
- attribs - a list of attribute names followed by the desired values, terminated by EGL_NONE
- attribs_size - the size of the list
- configs - the returned matching configuration names (same names as familiar to the client in rcGetConfigs)
- configs_size - the size of the configs buffers
- returns - the actual number of matching configurations (<= configs_size)
-
-EGLint rcGetFBParam(EGLint param);
- queries the host for framebuffer parameter, see renderControl_types.h
- for possible values of 'param'.
-
-uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion);
- This function creates a rendering context on the host and returns its
- handle. config is the config index for the context, share is either zero
- or a handle to a sharing context. glVersion is either 1 or 2 for GLES1
- or GLES2 context respectively.
-
-
-void rcDestroyContext(uint32_t context);
- This function destroys a rendering context on the host.
- context is a handle returned in rcCreateContext.
-
-uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height);
- This function creates a 'window' surface on the host which can be then
- bind for rendering through rcMakeCurrent.
- The function returns a handle to the created window surface.
-
-void rcDestroyWindowSurface(uint32_t windowSurface);
- This function destoys a window surface.
-
-uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat);
- This function creates a colorBuffer object on the host which can be then
- be specified as a render target for a window surface through
- rcSetWindowColorBuffer or to be displayed on the framebuffer window
- through rcFBPost.
- The function returns a handle to the colorBuffer object, with an initial
- reference count of 1.
-
-void rcOpenColorBuffer(uint32_t colorbuffer);
- Adds an additional reference to the colorbuffer, typically from a
- different Android process than the one which created it.
-
-void rcCloseColorBuffer(uint32_t colorbuffer);
- Removes a reference to the colorbuffer. When the reference count drops
- to zero the colorbuffer is automatically destroyed.
-
-void rcFlushWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
- This flushes the current window color buffer
-
-void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
- This set the target color buffer for a windowSurface, when set the
- previous target colorBuffer gets updated before switching to the new
- colorBuffer.
-
-EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf);
- Binds a windowSurface(s) and current rendering context for the
- calling thread.
-
-void rcFBPost(uint32_t colorBuffer);
- This function causes the content of the colorBuffer object to be
- displayed on the host framebuffer window. The function returns
- immediatly, the buffer will be displayed at the next swap interval.
-
-void rcFBSetSwapInterval(EGLint interval);
- Sets the swap interval for the host framebuffer window.
-
-void rcBindTexture(uint32_t colorBuffer);
- This function instruct the host to bind the content of the specified
- colorBuffer to the current binded texture object of the calling thread.
- This function should be used to implement eglBindTexImage.
-
-EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead);
- This function returns only after all rendering requests for the specified
- colorBuffer rendering target has been processed and after all 'postCount'
- posts for the buffer requested previously through rcFBPost has been
- processed.
- if 'forRead' is not-zero, the function returns positive value in case
- there was rendering done to the buffer since the last CacheFlush request
- with non-zero 'forRead' value, otherwise the function returns zero or
- negative value on failure.
-
-void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y,
- GLint width, GLint height, GLenum format,
- GLenum type, void* pixels);
- This function queries the host for the pixel content of a colorBuffer's
- subregion. It act the same as OpenGL glReadPixels however pixels
- are always packed with alignment of 1.
-
-void rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y,
- GLint width, GLint height, GLenum format,
- GLenum type, void* pixels);
- Updates the content of a subregion of a colorBuffer object.
- pixels are always unpacked with alignment of 1.
-
-uint32_t rcCreateClientImage(uint32_t context, EGLenum target, GLuint buffer)
- Create an EGLImage from a client object.
-
-int rcDestroyClientImage(uint32_t image)
- Destroy an EGLImage object.
+++ /dev/null
-GLOBAL
- base_opcode 10000
- encoder_headers <stdint.h> <EGL/egl.h> "glUtils.h"
-
-rcGetEGLVersion
- dir major out
- len major sizeof(EGLint)
- dir minor out
- len minor sizeof(EGLint)
-
-rcQueryEGLString
- dir buffer out
- len buffer bufferSize
-
-rcGetGLString
- dir buffer out
- len buffer bufferSize
-
-rcGetNumConfigs
- dir numAttribs out
- len numAttribs sizeof(uint32_t)
-
-rcGetConfigs
- dir buffer out
- len buffer bufSize
-
-rcChooseConfig
- dir attribs in
- len attribs attribs_size
- dir configs out
- var_flag configs nullAllowed
- len configs configs_size*sizeof(uint32_t)
-
-rcReadColorBuffer
- dir pixels out
- len pixels (((glUtilsPixelBitSize(format, type) * width) >> 3) * height)
-
-rcUpdateColorBuffer
- dir pixels in
- len pixels (((glUtilsPixelBitSize(format, type) * width) >> 3) * height)
- var_flag pixels isLarge
-
-rcCloseColorBuffer
- flag flushOnEncode
-
+++ /dev/null
-GL_ENRTY(GLint, rcGetRendererVersion)
-GL_ENTRY(EGLint, rcGetEGLVersion, EGLint *major, EGLint *minor)
-GL_ENTRY(EGLint, rcQueryEGLString, EGLenum name, void *buffer, EGLint bufferSize)
-GL_ENTRY(EGLint, rcGetGLString, EGLenum name, void *buffer, EGLint bufferSize)
-GL_ENTRY(EGLint, rcGetNumConfigs, uint32_t *numAttribs)
-GL_ENTRY(EGLint, rcGetConfigs, uint32_t bufSize, GLuint *buffer)
-GL_ENTRY(EGLint, rcChooseConfig, EGLint *attribs, uint32_t attribs_size, uint32_t *configs, uint32_t configs_size)
-GL_ENTRY(EGLint, rcGetFBParam, EGLint param)
-GL_ENTRY(uint32_t, rcCreateContext, uint32_t config, uint32_t share, uint32_t glVersion)
-GL_ENTRY(void, rcDestroyContext, uint32_t context)
-GL_ENTRY(uint32_t, rcCreateWindowSurface, uint32_t config, uint32_t width, uint32_t height)
-GL_ENTRY(void, rcDestroyWindowSurface, uint32_t windowSurface)
-GL_ENTRY(uint32_t, rcCreateColorBuffer, uint32_t width, uint32_t height, GLenum internalFormat)
-GL_ENTRY(void, rcOpenColorBuffer, uint32_t colorbuffer)
-GL_ENTRY(void, rcCloseColorBuffer, uint32_t colorbuffer)
-GL_ENTRY(void, rcSetWindowColorBuffer, uint32_t windowSurface, uint32_t colorBuffer)
-GL_ENTRY(int, rcFlushWindowColorBuffer, uint32_t windowSurface)
-GL_ENTRY(EGLint, rcMakeCurrent, uint32_t context, uint32_t drawSurf, uint32_t readSurf)
-GL_ENTRY(void, rcFBPost, uint32_t colorBuffer)
-GL_ENTRY(void, rcFBSetSwapInterval, EGLint interval)
-GL_ENTRY(void, rcBindTexture, uint32_t colorBuffer)
-GL_ENTRY(void, rcBindRenderbuffer, uint32_t colorBuffer)
-GL_ENTRY(EGLint, rcColorBufferCacheFlush, uint32_t colorbuffer, EGLint postCount,int forRead)
-GL_ENTRY(void, rcReadColorBuffer, uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void *pixels)
-GL_ENTRY(int, rcUpdateColorBuffer, uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void *pixels)
-GL_ENTRY(int, rcOpenColorBuffer2, uint32_t colorbuffer)
-GL_ENTRY(uint32_t, rcCreateClientImage, uint32_t context, EGLenum target, GLuint buffer)
-GL_ENTRY(int, rcDestroyClientImage, uint32_t image)
-GL_ENTRY(void, rcSelectChecksumHelper, uint32_t newProtocol, uint32_t reserved)
+++ /dev/null
-uint32_t 32 0x%08x false
-EGLint 32 0x%08x false
-GLint 32 0x%08x false
-GLuint 32 0x%08x false
-GLenum 32 0x%08x false
-EGLenum 32 0x%08x false
-uint32_t* 32 0x%08x true
-EGLint* 32 0x%08x true
-GLint* 32 0x%08x true
-GLuint* 32 0x%08x true
-void* 32 0x%08x true
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __renderControl_client_base_t_h
-#define __renderControl_client_base_t_h
-
-#include "renderControl_client_proc.h"
-
-
-struct renderControl_client_base_t {
-
- rcGetRendererVersion_client_proc_t rcGetRendererVersion;
- rcGetEGLVersion_client_proc_t rcGetEGLVersion;
- rcQueryEGLString_client_proc_t rcQueryEGLString;
- rcGetGLString_client_proc_t rcGetGLString;
- rcGetNumConfigs_client_proc_t rcGetNumConfigs;
- rcGetConfigs_client_proc_t rcGetConfigs;
- rcChooseConfig_client_proc_t rcChooseConfig;
- rcGetFBParam_client_proc_t rcGetFBParam;
- rcCreateContext_client_proc_t rcCreateContext;
- rcDestroyContext_client_proc_t rcDestroyContext;
- rcCreateWindowSurface_client_proc_t rcCreateWindowSurface;
- rcDestroyWindowSurface_client_proc_t rcDestroyWindowSurface;
- rcCreateColorBuffer_client_proc_t rcCreateColorBuffer;
- rcOpenColorBuffer_client_proc_t rcOpenColorBuffer;
- rcCloseColorBuffer_client_proc_t rcCloseColorBuffer;
- rcSetWindowColorBuffer_client_proc_t rcSetWindowColorBuffer;
- rcFlushWindowColorBuffer_client_proc_t rcFlushWindowColorBuffer;
- rcMakeCurrent_client_proc_t rcMakeCurrent;
- rcFBPost_client_proc_t rcFBPost;
- rcFBSetSwapInterval_client_proc_t rcFBSetSwapInterval;
- rcBindTexture_client_proc_t rcBindTexture;
- rcBindRenderbuffer_client_proc_t rcBindRenderbuffer;
- rcColorBufferCacheFlush_client_proc_t rcColorBufferCacheFlush;
- rcReadColorBuffer_client_proc_t rcReadColorBuffer;
- rcUpdateColorBuffer_client_proc_t rcUpdateColorBuffer;
- rcOpenColorBuffer2_client_proc_t rcOpenColorBuffer2;
- rcCreateClientImage_client_proc_t rcCreateClientImage;
- rcDestroyClientImage_client_proc_t rcDestroyClientImage;
-};
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-
-
-#include <string.h>
-#include "renderControl_client_context.h"
-
-
-#include <stdio.h>
-
-int renderControl_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
-{
- rcGetRendererVersion = (rcGetRendererVersion_client_proc_t) getProc("rcGetRendererVersion", userData);
- rcGetEGLVersion = (rcGetEGLVersion_client_proc_t) getProc("rcGetEGLVersion", userData);
- rcQueryEGLString = (rcQueryEGLString_client_proc_t) getProc("rcQueryEGLString", userData);
- rcGetGLString = (rcGetGLString_client_proc_t) getProc("rcGetGLString", userData);
- rcGetNumConfigs = (rcGetNumConfigs_client_proc_t) getProc("rcGetNumConfigs", userData);
- rcGetConfigs = (rcGetConfigs_client_proc_t) getProc("rcGetConfigs", userData);
- rcChooseConfig = (rcChooseConfig_client_proc_t) getProc("rcChooseConfig", userData);
- rcGetFBParam = (rcGetFBParam_client_proc_t) getProc("rcGetFBParam", userData);
- rcCreateContext = (rcCreateContext_client_proc_t) getProc("rcCreateContext", userData);
- rcDestroyContext = (rcDestroyContext_client_proc_t) getProc("rcDestroyContext", userData);
- rcCreateWindowSurface = (rcCreateWindowSurface_client_proc_t) getProc("rcCreateWindowSurface", userData);
- rcDestroyWindowSurface = (rcDestroyWindowSurface_client_proc_t) getProc("rcDestroyWindowSurface", userData);
- rcCreateColorBuffer = (rcCreateColorBuffer_client_proc_t) getProc("rcCreateColorBuffer", userData);
- rcOpenColorBuffer = (rcOpenColorBuffer_client_proc_t) getProc("rcOpenColorBuffer", userData);
- rcCloseColorBuffer = (rcCloseColorBuffer_client_proc_t) getProc("rcCloseColorBuffer", userData);
- rcSetWindowColorBuffer = (rcSetWindowColorBuffer_client_proc_t) getProc("rcSetWindowColorBuffer", userData);
- rcFlushWindowColorBuffer = (rcFlushWindowColorBuffer_client_proc_t) getProc("rcFlushWindowColorBuffer", userData);
- rcMakeCurrent = (rcMakeCurrent_client_proc_t) getProc("rcMakeCurrent", userData);
- rcFBPost = (rcFBPost_client_proc_t) getProc("rcFBPost", userData);
- rcFBSetSwapInterval = (rcFBSetSwapInterval_client_proc_t) getProc("rcFBSetSwapInterval", userData);
- rcBindTexture = (rcBindTexture_client_proc_t) getProc("rcBindTexture", userData);
- rcBindRenderbuffer = (rcBindRenderbuffer_client_proc_t) getProc("rcBindRenderbuffer", userData);
- rcColorBufferCacheFlush = (rcColorBufferCacheFlush_client_proc_t) getProc("rcColorBufferCacheFlush", userData);
- rcReadColorBuffer = (rcReadColorBuffer_client_proc_t) getProc("rcReadColorBuffer", userData);
- rcUpdateColorBuffer = (rcUpdateColorBuffer_client_proc_t) getProc("rcUpdateColorBuffer", userData);
- rcOpenColorBuffer2 = (rcOpenColorBuffer2_client_proc_t) getProc("rcOpenColorBuffer2", userData);
- rcCreateClientImage = (rcCreateClientImage_client_proc_t) getProc("rcCreateClientImage", userData);
- rcDestroyClientImage = (rcDestroyClientImage_client_proc_t) getProc("rcDestroyClientImage", userData);
- rcSelectChecksumHelper = (rcSelectChecksumHelper_client_proc_t) getProc("rcSelectChecksumHelper", userData);
- return 0;
-}
-
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __renderControl_client_context_t_h
-#define __renderControl_client_context_t_h
-
-#include "renderControl_client_proc.h"
-
-#include "renderControl_types.h"
-
-
-struct renderControl_client_context_t {
-
- rcGetRendererVersion_client_proc_t rcGetRendererVersion;
- rcGetEGLVersion_client_proc_t rcGetEGLVersion;
- rcQueryEGLString_client_proc_t rcQueryEGLString;
- rcGetGLString_client_proc_t rcGetGLString;
- rcGetNumConfigs_client_proc_t rcGetNumConfigs;
- rcGetConfigs_client_proc_t rcGetConfigs;
- rcChooseConfig_client_proc_t rcChooseConfig;
- rcGetFBParam_client_proc_t rcGetFBParam;
- rcCreateContext_client_proc_t rcCreateContext;
- rcDestroyContext_client_proc_t rcDestroyContext;
- rcCreateWindowSurface_client_proc_t rcCreateWindowSurface;
- rcDestroyWindowSurface_client_proc_t rcDestroyWindowSurface;
- rcCreateColorBuffer_client_proc_t rcCreateColorBuffer;
- rcOpenColorBuffer_client_proc_t rcOpenColorBuffer;
- rcCloseColorBuffer_client_proc_t rcCloseColorBuffer;
- rcSetWindowColorBuffer_client_proc_t rcSetWindowColorBuffer;
- rcFlushWindowColorBuffer_client_proc_t rcFlushWindowColorBuffer;
- rcMakeCurrent_client_proc_t rcMakeCurrent;
- rcFBPost_client_proc_t rcFBPost;
- rcFBSetSwapInterval_client_proc_t rcFBSetSwapInterval;
- rcBindTexture_client_proc_t rcBindTexture;
- rcBindRenderbuffer_client_proc_t rcBindRenderbuffer;
- rcColorBufferCacheFlush_client_proc_t rcColorBufferCacheFlush;
- rcReadColorBuffer_client_proc_t rcReadColorBuffer;
- rcUpdateColorBuffer_client_proc_t rcUpdateColorBuffer;
- rcOpenColorBuffer2_client_proc_t rcOpenColorBuffer2;
- rcCreateClientImage_client_proc_t rcCreateClientImage;
- rcDestroyClientImage_client_proc_t rcDestroyClientImage;
- rcSelectChecksumHelper_client_proc_t rcSelectChecksumHelper;
- virtual ~renderControl_client_context_t() {}
-
- typedef renderControl_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
- static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
- int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
- virtual void setError(unsigned int error){ (void)error; };
- virtual unsigned int getError(){ return 0; };
-};
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __renderControl_client_proc_t_h
-#define __renderControl_client_proc_t_h
-
-
-
-#include "renderControl_types.h"
-#ifndef renderControl_APIENTRY
-#define renderControl_APIENTRY
-#endif
-typedef GLint (renderControl_APIENTRY *rcGetRendererVersion_client_proc_t) (void * ctx);
-typedef EGLint (renderControl_APIENTRY *rcGetEGLVersion_client_proc_t) (void * ctx, EGLint*, EGLint*);
-typedef EGLint (renderControl_APIENTRY *rcQueryEGLString_client_proc_t) (void * ctx, EGLenum, void*, EGLint);
-typedef EGLint (renderControl_APIENTRY *rcGetGLString_client_proc_t) (void * ctx, EGLenum, void*, EGLint);
-typedef EGLint (renderControl_APIENTRY *rcGetNumConfigs_client_proc_t) (void * ctx, uint32_t*);
-typedef EGLint (renderControl_APIENTRY *rcGetConfigs_client_proc_t) (void * ctx, uint32_t, GLuint*);
-typedef EGLint (renderControl_APIENTRY *rcChooseConfig_client_proc_t) (void * ctx, EGLint*, uint32_t, uint32_t*, uint32_t);
-typedef EGLint (renderControl_APIENTRY *rcGetFBParam_client_proc_t) (void * ctx, EGLint);
-typedef uint32_t (renderControl_APIENTRY *rcCreateContext_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
-typedef void (renderControl_APIENTRY *rcDestroyContext_client_proc_t) (void * ctx, uint32_t);
-typedef uint32_t (renderControl_APIENTRY *rcCreateWindowSurface_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
-typedef void (renderControl_APIENTRY *rcDestroyWindowSurface_client_proc_t) (void * ctx, uint32_t);
-typedef uint32_t (renderControl_APIENTRY *rcCreateColorBuffer_client_proc_t) (void * ctx, uint32_t, uint32_t, GLenum);
-typedef void (renderControl_APIENTRY *rcOpenColorBuffer_client_proc_t) (void * ctx, uint32_t);
-typedef void (renderControl_APIENTRY *rcCloseColorBuffer_client_proc_t) (void * ctx, uint32_t);
-typedef void (renderControl_APIENTRY *rcSetWindowColorBuffer_client_proc_t) (void * ctx, uint32_t, uint32_t);
-typedef int (renderControl_APIENTRY *rcFlushWindowColorBuffer_client_proc_t) (void * ctx, uint32_t);
-typedef EGLint (renderControl_APIENTRY *rcMakeCurrent_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
-typedef void (renderControl_APIENTRY *rcFBPost_client_proc_t) (void * ctx, uint32_t);
-typedef void (renderControl_APIENTRY *rcFBSetSwapInterval_client_proc_t) (void * ctx, EGLint);
-typedef void (renderControl_APIENTRY *rcBindTexture_client_proc_t) (void * ctx, uint32_t);
-typedef void (renderControl_APIENTRY *rcBindRenderbuffer_client_proc_t) (void * ctx, uint32_t);
-typedef EGLint (renderControl_APIENTRY *rcColorBufferCacheFlush_client_proc_t) (void * ctx, uint32_t, EGLint, int);
-typedef void (renderControl_APIENTRY *rcReadColorBuffer_client_proc_t) (void * ctx, uint32_t, GLint, GLint, GLint, GLint, GLenum, GLenum, void*);
-typedef int (renderControl_APIENTRY *rcUpdateColorBuffer_client_proc_t) (void * ctx, uint32_t, GLint, GLint, GLint, GLint, GLenum, GLenum, void*);
-typedef int (renderControl_APIENTRY *rcOpenColorBuffer2_client_proc_t) (void * ctx, uint32_t);
-typedef uint32_t (renderControl_APIENTRY *rcCreateClientImage_client_proc_t) (void * ctx, uint32_t, EGLenum, GLuint);
-typedef int (renderControl_APIENTRY *rcDestroyClientImage_client_proc_t) (void * ctx, uint32_t);
-typedef void (renderControl_APIENTRY *rcSelectChecksumHelper_client_proc_t) (void * ctx, uint32_t, uint32_t);
-
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-
-
-#include <memory>
-#include <string.h>
-#include "renderControl_opcodes.h"
-
-#include "renderControl_enc.h"
-
-
-#include <stdio.h>
-
-namespace {
-
-void enc_unsupported()
-{
- ALOGE("Function is unsupported\n");
-}
-
-GLint rcGetRendererVersion_enc(void *self )
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcGetRendererVersion;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- GLint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcGetRendererVersion: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-EGLint rcGetEGLVersion_enc(void *self , EGLint* major, EGLint* minor)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_major = sizeof(EGLint);
- const unsigned int __size_minor = sizeof(EGLint);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_major + __size_minor + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcGetEGLVersion;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_major; ptr += 4;
- *(unsigned int *)(ptr) = __size_minor; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(major, __size_major);
- if (useChecksum) checksumCalculator->addBuffer(major, __size_major);
- stream->readback(minor, __size_minor);
- if (useChecksum) checksumCalculator->addBuffer(minor, __size_minor);
-
- EGLint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcGetEGLVersion: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-EGLint rcQueryEGLString_enc(void *self , EGLenum name, void* buffer, EGLint bufferSize)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_buffer = bufferSize;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_buffer + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcQueryEGLString;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &name, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_buffer; ptr += 4;
- memcpy(ptr, &bufferSize, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(buffer, __size_buffer);
- if (useChecksum) checksumCalculator->addBuffer(buffer, __size_buffer);
-
- EGLint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcQueryEGLString: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-EGLint rcGetGLString_enc(void *self , EGLenum name, void* buffer, EGLint bufferSize)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_buffer = bufferSize;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_buffer + 4 + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcGetGLString;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &name, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_buffer; ptr += 4;
- memcpy(ptr, &bufferSize, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(buffer, __size_buffer);
- if (useChecksum) checksumCalculator->addBuffer(buffer, __size_buffer);
-
- EGLint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcGetGLString: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-EGLint rcGetNumConfigs_enc(void *self , uint32_t* numAttribs)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_numAttribs = sizeof(uint32_t);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_numAttribs + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcGetNumConfigs;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_numAttribs; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(numAttribs, __size_numAttribs);
- if (useChecksum) checksumCalculator->addBuffer(numAttribs, __size_numAttribs);
-
- EGLint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcGetNumConfigs: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-EGLint rcGetConfigs_enc(void *self , uint32_t bufSize, GLuint* buffer)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_buffer = bufSize;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + __size_buffer + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcGetConfigs;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &bufSize, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_buffer; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(buffer, __size_buffer);
- if (useChecksum) checksumCalculator->addBuffer(buffer, __size_buffer);
-
- EGLint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcGetConfigs: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-EGLint rcChooseConfig_enc(void *self , EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_attribs = attribs_size;
- const unsigned int __size_configs = ((configs != NULL) ? configs_size*sizeof(uint32_t) : 0);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_attribs + 4 + __size_configs + 4 + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcChooseConfig;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- *(unsigned int *)(ptr) = __size_attribs; ptr += 4;
- memcpy(ptr, attribs, __size_attribs);ptr += __size_attribs;
- memcpy(ptr, &attribs_size, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_configs; ptr += 4;
- memcpy(ptr, &configs_size, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- if (configs != NULL) {
- stream->readback(configs, __size_configs);
- if (useChecksum) checksumCalculator->addBuffer(configs, __size_configs);
- }
-
- EGLint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcChooseConfig: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-EGLint rcGetFBParam_enc(void *self , EGLint param)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcGetFBParam;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, ¶m, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- EGLint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcGetFBParam: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-uint32_t rcCreateContext_enc(void *self , uint32_t config, uint32_t share, uint32_t glVersion)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcCreateContext;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &config, 4); ptr += 4;
- memcpy(ptr, &share, 4); ptr += 4;
- memcpy(ptr, &glVersion, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- uint32_t retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcCreateContext: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void rcDestroyContext_enc(void *self , uint32_t context)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcDestroyContext;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &context, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-uint32_t rcCreateWindowSurface_enc(void *self , uint32_t config, uint32_t width, uint32_t height)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcCreateWindowSurface;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &config, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- uint32_t retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcCreateWindowSurface: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void rcDestroyWindowSurface_enc(void *self , uint32_t windowSurface)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcDestroyWindowSurface;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &windowSurface, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-uint32_t rcCreateColorBuffer_enc(void *self , uint32_t width, uint32_t height, GLenum internalFormat)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcCreateColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &internalFormat, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- uint32_t retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcCreateColorBuffer: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void rcOpenColorBuffer_enc(void *self , uint32_t colorbuffer)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcOpenColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &colorbuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void rcCloseColorBuffer_enc(void *self , uint32_t colorbuffer)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcCloseColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &colorbuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->flush();
-}
-
-void rcSetWindowColorBuffer_enc(void *self , uint32_t windowSurface, uint32_t colorBuffer)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcSetWindowColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &windowSurface, 4); ptr += 4;
- memcpy(ptr, &colorBuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-int rcFlushWindowColorBuffer_enc(void *self , uint32_t windowSurface)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcFlushWindowColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &windowSurface, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- int retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcFlushWindowColorBuffer: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-EGLint rcMakeCurrent_enc(void *self , uint32_t context, uint32_t drawSurf, uint32_t readSurf)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcMakeCurrent;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &context, 4); ptr += 4;
- memcpy(ptr, &drawSurf, 4); ptr += 4;
- memcpy(ptr, &readSurf, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- EGLint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcMakeCurrent: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void rcFBPost_enc(void *self , uint32_t colorBuffer)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcFBPost;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &colorBuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void rcFBSetSwapInterval_enc(void *self , EGLint interval)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcFBSetSwapInterval;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &interval, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void rcBindTexture_enc(void *self , uint32_t colorBuffer)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcBindTexture;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &colorBuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-void rcBindRenderbuffer_enc(void *self , uint32_t colorBuffer)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcBindRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &colorBuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-EGLint rcColorBufferCacheFlush_enc(void *self , uint32_t colorbuffer, EGLint postCount, int forRead)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcColorBufferCacheFlush;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &colorbuffer, 4); ptr += 4;
- memcpy(ptr, &postCount, 4); ptr += 4;
- memcpy(ptr, &forRead, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- EGLint retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcColorBufferCacheFlush: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void rcReadColorBuffer_enc(void *self , uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_pixels = (((glUtilsPixelBitSize(format, type) * width) >> 3) * height);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcReadColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &colorbuffer, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
- *(unsigned int *)(ptr) = __size_pixels; ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
- stream->readback(pixels, __size_pixels);
- if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcReadColorBuffer: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
-}
-
-int rcUpdateColorBuffer_enc(void *self , uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_pixels = (((glUtilsPixelBitSize(format, type) * width) >> 3) * height);
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
- ptr = buf;
- int tmp = OP_rcUpdateColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &colorbuffer, 4); ptr += 4;
- memcpy(ptr, &x, 4); ptr += 4;
- memcpy(ptr, &y, 4); ptr += 4;
- memcpy(ptr, &width, 4); ptr += 4;
- memcpy(ptr, &height, 4); ptr += 4;
- memcpy(ptr, &format, 4); ptr += 4;
- memcpy(ptr, &type, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- stream->flush();
- stream->writeFully(&__size_pixels,4);
- if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
- stream->writeFully(pixels, __size_pixels);
- if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
- buf = stream->alloc(checksumSize);
- if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
-
-
- int retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcUpdateColorBuffer: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-int rcOpenColorBuffer2_enc(void *self , uint32_t colorbuffer)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcOpenColorBuffer2;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &colorbuffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- int retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcOpenColorBuffer2: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-uint32_t rcCreateClientImage_enc(void *self , uint32_t context, EGLenum target, GLuint buffer)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcCreateClientImage;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &context, 4); ptr += 4;
- memcpy(ptr, &target, 4); ptr += 4;
- memcpy(ptr, &buffer, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- uint32_t retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcCreateClientImage: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-int rcDestroyClientImage_enc(void *self , uint32_t image)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcDestroyClientImage;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &image, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-
- int retval;
- stream->readback(&retval, 4);
- if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
- if (useChecksum) {
- std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
- stream->readback(checksumBuf.get(), checksumSize);
- if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
- ALOGE("rcDestroyClientImage: GL communication error, please report this issue to b.android.com.\n");
- abort();
- }
- }
- return retval;
-}
-
-void rcSelectChecksumHelper_enc(void *self , uint32_t newProtocol, uint32_t reserved)
-{
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + 4 + 4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcSelectChecksumHelper;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &newProtocol, 4); ptr += 4;
- memcpy(ptr, &reserved, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
-} // namespace
-
-renderControl_encoder_context_t::renderControl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
-{
- m_stream = stream;
- m_checksumCalculator = checksumCalculator;
-
- this->rcGetRendererVersion = &rcGetRendererVersion_enc;
- this->rcGetEGLVersion = &rcGetEGLVersion_enc;
- this->rcQueryEGLString = &rcQueryEGLString_enc;
- this->rcGetGLString = &rcGetGLString_enc;
- this->rcGetNumConfigs = &rcGetNumConfigs_enc;
- this->rcGetConfigs = &rcGetConfigs_enc;
- this->rcChooseConfig = &rcChooseConfig_enc;
- this->rcGetFBParam = &rcGetFBParam_enc;
- this->rcCreateContext = &rcCreateContext_enc;
- this->rcDestroyContext = &rcDestroyContext_enc;
- this->rcCreateWindowSurface = &rcCreateWindowSurface_enc;
- this->rcDestroyWindowSurface = &rcDestroyWindowSurface_enc;
- this->rcCreateColorBuffer = &rcCreateColorBuffer_enc;
- this->rcOpenColorBuffer = &rcOpenColorBuffer_enc;
- this->rcCloseColorBuffer = &rcCloseColorBuffer_enc;
- this->rcSetWindowColorBuffer = &rcSetWindowColorBuffer_enc;
- this->rcFlushWindowColorBuffer = &rcFlushWindowColorBuffer_enc;
- this->rcMakeCurrent = &rcMakeCurrent_enc;
- this->rcFBPost = &rcFBPost_enc;
- this->rcFBSetSwapInterval = &rcFBSetSwapInterval_enc;
- this->rcBindTexture = &rcBindTexture_enc;
- this->rcBindRenderbuffer = &rcBindRenderbuffer_enc;
- this->rcColorBufferCacheFlush = &rcColorBufferCacheFlush_enc;
- this->rcReadColorBuffer = &rcReadColorBuffer_enc;
- this->rcUpdateColorBuffer = &rcUpdateColorBuffer_enc;
- this->rcOpenColorBuffer2 = &rcOpenColorBuffer2_enc;
- this->rcCreateClientImage = &rcCreateClientImage_enc;
- this->rcDestroyClientImage = &rcDestroyClientImage_enc;
- this->rcSelectChecksumHelper = &rcSelectChecksumHelper_enc;
-}
-
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-
-#ifndef GUARD_renderControl_encoder_context_t
-#define GUARD_renderControl_encoder_context_t
-
-#include "IOStream.h"
-#include "ChecksumCalculator.h"
-#include "renderControl_client_context.h"
-
-
-#include <stdint.h>
-#include <EGL/egl.h>
-#include "glUtils.h"
-
-struct renderControl_encoder_context_t : public renderControl_client_context_t {
-
- IOStream *m_stream;
- ChecksumCalculator *m_checksumCalculator;
-
- renderControl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator);
-};
-
-#endif // GUARD_renderControl_encoder_context_t
\ No newline at end of file
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#include <stdio.h>
-#include <stdlib.h>
-#include "renderControl_client_context.h"
-
-#ifndef GL_TRUE
-extern "C" {
- GLint rcGetRendererVersion();
- EGLint rcGetEGLVersion(EGLint* major, EGLint* minor);
- EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize);
- EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize);
- EGLint rcGetNumConfigs(uint32_t* numAttribs);
- EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer);
- EGLint rcChooseConfig(EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size);
- EGLint rcGetFBParam(EGLint param);
- uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion);
- void rcDestroyContext(uint32_t context);
- uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height);
- void rcDestroyWindowSurface(uint32_t windowSurface);
- uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat);
- void rcOpenColorBuffer(uint32_t colorbuffer);
- void rcCloseColorBuffer(uint32_t colorbuffer);
- void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
- int rcFlushWindowColorBuffer(uint32_t windowSurface);
- EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf);
- void rcFBPost(uint32_t colorBuffer);
- void rcFBSetSwapInterval(EGLint interval);
- void rcBindTexture(uint32_t colorBuffer);
- void rcBindRenderbuffer(uint32_t colorBuffer);
- EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead);
- void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels);
- int rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels);
- int rcOpenColorBuffer2(uint32_t colorbuffer);
- uint32_t rcCreateClientImage(uint32_t context, EGLenum target, GLuint buffer);
- int rcDestroyClientImage(uint32_t image);
- void rcSelectChecksumHelper(uint32_t newProtocol, uint32_t reserved);
-};
-
-#endif
-#ifndef GET_CONTEXT
-static renderControl_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
-void renderControl_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
-#define GET_CONTEXT renderControl_client_context_t * ctx = getCurrentContext()
-#endif
-
-GLint rcGetRendererVersion()
-{
- GET_CONTEXT;
- return ctx->rcGetRendererVersion(ctx);
-}
-
-EGLint rcGetEGLVersion(EGLint* major, EGLint* minor)
-{
- GET_CONTEXT;
- return ctx->rcGetEGLVersion(ctx, major, minor);
-}
-
-EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize)
-{
- GET_CONTEXT;
- return ctx->rcQueryEGLString(ctx, name, buffer, bufferSize);
-}
-
-EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize)
-{
- GET_CONTEXT;
- return ctx->rcGetGLString(ctx, name, buffer, bufferSize);
-}
-
-EGLint rcGetNumConfigs(uint32_t* numAttribs)
-{
- GET_CONTEXT;
- return ctx->rcGetNumConfigs(ctx, numAttribs);
-}
-
-EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer)
-{
- GET_CONTEXT;
- return ctx->rcGetConfigs(ctx, bufSize, buffer);
-}
-
-EGLint rcChooseConfig(EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size)
-{
- GET_CONTEXT;
- return ctx->rcChooseConfig(ctx, attribs, attribs_size, configs, configs_size);
-}
-
-EGLint rcGetFBParam(EGLint param)
-{
- GET_CONTEXT;
- return ctx->rcGetFBParam(ctx, param);
-}
-
-uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion)
-{
- GET_CONTEXT;
- return ctx->rcCreateContext(ctx, config, share, glVersion);
-}
-
-void rcDestroyContext(uint32_t context)
-{
- GET_CONTEXT;
- ctx->rcDestroyContext(ctx, context);
-}
-
-uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height)
-{
- GET_CONTEXT;
- return ctx->rcCreateWindowSurface(ctx, config, width, height);
-}
-
-void rcDestroyWindowSurface(uint32_t windowSurface)
-{
- GET_CONTEXT;
- ctx->rcDestroyWindowSurface(ctx, windowSurface);
-}
-
-uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat)
-{
- GET_CONTEXT;
- return ctx->rcCreateColorBuffer(ctx, width, height, internalFormat);
-}
-
-void rcOpenColorBuffer(uint32_t colorbuffer)
-{
- GET_CONTEXT;
- ctx->rcOpenColorBuffer(ctx, colorbuffer);
-}
-
-void rcCloseColorBuffer(uint32_t colorbuffer)
-{
- GET_CONTEXT;
- ctx->rcCloseColorBuffer(ctx, colorbuffer);
-}
-
-void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer)
-{
- GET_CONTEXT;
- ctx->rcSetWindowColorBuffer(ctx, windowSurface, colorBuffer);
-}
-
-int rcFlushWindowColorBuffer(uint32_t windowSurface)
-{
- GET_CONTEXT;
- return ctx->rcFlushWindowColorBuffer(ctx, windowSurface);
-}
-
-EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf)
-{
- GET_CONTEXT;
- return ctx->rcMakeCurrent(ctx, context, drawSurf, readSurf);
-}
-
-void rcFBPost(uint32_t colorBuffer)
-{
- GET_CONTEXT;
- ctx->rcFBPost(ctx, colorBuffer);
-}
-
-void rcFBSetSwapInterval(EGLint interval)
-{
- GET_CONTEXT;
- ctx->rcFBSetSwapInterval(ctx, interval);
-}
-
-void rcBindTexture(uint32_t colorBuffer)
-{
- GET_CONTEXT;
- ctx->rcBindTexture(ctx, colorBuffer);
-}
-
-void rcBindRenderbuffer(uint32_t colorBuffer)
-{
- GET_CONTEXT;
- ctx->rcBindRenderbuffer(ctx, colorBuffer);
-}
-
-EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead)
-{
- GET_CONTEXT;
- return ctx->rcColorBufferCacheFlush(ctx, colorbuffer, postCount, forRead);
-}
-
-void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
-{
- GET_CONTEXT;
- ctx->rcReadColorBuffer(ctx, colorbuffer, x, y, width, height, format, type, pixels);
-}
-
-int rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
-{
- GET_CONTEXT;
- return ctx->rcUpdateColorBuffer(ctx, colorbuffer, x, y, width, height, format, type, pixels);
-}
-
-int rcOpenColorBuffer2(uint32_t colorbuffer)
-{
- GET_CONTEXT;
- return ctx->rcOpenColorBuffer2(ctx, colorbuffer);
-}
-
-uint32_t rcCreateClientImage(uint32_t context, EGLenum target, GLuint buffer)
-{
- GET_CONTEXT;
- return ctx->rcCreateClientImage(ctx, context, target, buffer);
-}
-
-int rcDestroyClientImage(uint32_t image)
-{
- GET_CONTEXT;
- return ctx->rcDestroyClientImage(ctx, image);
-}
-
-void rcSelectChecksumHelper(uint32_t newProtocol, uint32_t reserved)
-{
- GET_CONTEXT;
- ctx->rcSelectChecksumHelper(ctx, newProtocol, reserved);
-}
-
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __renderControl_client_ftable_t_h
-#define __renderControl_client_ftable_t_h
-
-
-static const struct _renderControl_funcs_by_name {
- const char *name;
- void *proc;
-} renderControl_funcs_by_name[] = {
- {"rcGetRendererVersion", (void*)rcGetRendererVersion},
- {"rcGetEGLVersion", (void*)rcGetEGLVersion},
- {"rcQueryEGLString", (void*)rcQueryEGLString},
- {"rcGetGLString", (void*)rcGetGLString},
- {"rcGetNumConfigs", (void*)rcGetNumConfigs},
- {"rcGetConfigs", (void*)rcGetConfigs},
- {"rcChooseConfig", (void*)rcChooseConfig},
- {"rcGetFBParam", (void*)rcGetFBParam},
- {"rcCreateContext", (void*)rcCreateContext},
- {"rcDestroyContext", (void*)rcDestroyContext},
- {"rcCreateWindowSurface", (void*)rcCreateWindowSurface},
- {"rcDestroyWindowSurface", (void*)rcDestroyWindowSurface},
- {"rcCreateColorBuffer", (void*)rcCreateColorBuffer},
- {"rcOpenColorBuffer", (void*)rcOpenColorBuffer},
- {"rcCloseColorBuffer", (void*)rcCloseColorBuffer},
- {"rcSetWindowColorBuffer", (void*)rcSetWindowColorBuffer},
- {"rcFlushWindowColorBuffer", (void*)rcFlushWindowColorBuffer},
- {"rcMakeCurrent", (void*)rcMakeCurrent},
- {"rcFBPost", (void*)rcFBPost},
- {"rcFBSetSwapInterval", (void*)rcFBSetSwapInterval},
- {"rcBindTexture", (void*)rcBindTexture},
- {"rcBindRenderbuffer", (void*)rcBindRenderbuffer},
- {"rcColorBufferCacheFlush", (void*)rcColorBufferCacheFlush},
- {"rcReadColorBuffer", (void*)rcReadColorBuffer},
- {"rcUpdateColorBuffer", (void*)rcUpdateColorBuffer},
- {"rcOpenColorBuffer2", (void*)rcOpenColorBuffer2},
- {"rcCreateClientImage", (void*)rcCreateClientImage},
- {"rcDestroyClientImage", (void*)rcDestroyClientImage},
- {"rcSelectChecksumHelper", (void*)rcSelectChecksumHelper},
-};
-static const int renderControl_num_funcs = sizeof(renderControl_funcs_by_name) / sizeof(struct _renderControl_funcs_by_name);
-
-
-#endif
+++ /dev/null
-// Generated Code - DO NOT EDIT !!
-// generated by 'emugen'
-#ifndef __GUARD_renderControl_opcodes_h_
-#define __GUARD_renderControl_opcodes_h_
-
-#define OP_rcGetRendererVersion 10000
-#define OP_rcGetEGLVersion 10001
-#define OP_rcQueryEGLString 10002
-#define OP_rcGetGLString 10003
-#define OP_rcGetNumConfigs 10004
-#define OP_rcGetConfigs 10005
-#define OP_rcChooseConfig 10006
-#define OP_rcGetFBParam 10007
-#define OP_rcCreateContext 10008
-#define OP_rcDestroyContext 10009
-#define OP_rcCreateWindowSurface 10010
-#define OP_rcDestroyWindowSurface 10011
-#define OP_rcCreateColorBuffer 10012
-#define OP_rcOpenColorBuffer 10013
-#define OP_rcCloseColorBuffer 10014
-#define OP_rcSetWindowColorBuffer 10015
-#define OP_rcFlushWindowColorBuffer 10016
-#define OP_rcMakeCurrent 10017
-#define OP_rcFBPost 10018
-#define OP_rcFBSetSwapInterval 10019
-#define OP_rcBindTexture 10020
-#define OP_rcBindRenderbuffer 10021
-#define OP_rcColorBufferCacheFlush 10022
-#define OP_rcReadColorBuffer 10023
-#define OP_rcUpdateColorBuffer 10024
-#define OP_rcOpenColorBuffer2 10025
-#define OP_rcCreateClientImage 10026
-#define OP_rcDestroyClientImage 10027
-#define OP_rcSelectChecksumHelper 10028
-#define OP_last 10029
-
-
-#endif
+++ /dev/null
-/*
-* Copyright 2011 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 <stdint.h>
-#include <EGL/egl.h>
-#include "glUtils.h"
-
-// values for 'param' argument of rcGetFBParam
-#define FB_WIDTH 1
-#define FB_HEIGHT 2
-#define FB_XDPI 3
-#define FB_YDPI 4
-#define FB_FPS 5
-#define FB_MIN_SWAP_INTERVAL 6
-#define FB_MAX_SWAP_INTERVAL 7
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-#### libGLESv1_CM_emul.so
-$(call emugl-begin-shared-library,libGLESv1_CM_emul)
-$(call emugl-import,libGLESv1_enc)
-$(call emugl-gen-wrapper,$(EMUGL_PATH)/system/GLESv1_enc,gl)
-$(call emugl-set-shared-library-subpath,egl)
-
-LOCAL_SRC_FILES += glesv1_emul_ifc.cpp
-
-$(call emugl-end-module)
-
-emulatorOpengl := $(LOCAL_PATH)/../..
-logTag := -DLOG_TAG=\"eglWrapper\"
-EMUGEN = $(BUILD_OUT_EXECUTABLES)/emugen
-## comment for no debug
-#debugFlags = -g -O0
-
-#### libGLESv2_CM_emul.so
-$(call emugl-begin-shared-library, libGLESv2_emul)
-$(call emugl-import,libGLESv2_enc)
-$(call emugl-gen-wrapper,$(EMUGL_PATH)/system/GLESv2_enc,gl2)
-LOCAL_SRC_FILES += glesv2_emul_ifc.cpp
-$(call emugl-set-shared-library-subpath,egl)
-$(call emugl-end-module)
-
-##### libEGL_emul.so ###########
-
-# THE FOLLOWING DOESN'T WORK YET
-#
-$(call emugl-begin-shared-library,libEGL_emul)
-$(call emugl-import,libut_rendercontrol_enc libGLESv1_CM_emul libGLESv2_emul libOpenglSystemCommon)
-
-$(call emugl-set-shared-library-subpath,egl)
-LOCAL_CFLAGS += $(logTag)
-
-LOCAL_SRC_FILES := \
- egl.cpp \
- egl_dispatch.cpp \
- ServerConnection.cpp \
- ThreadInfo.cpp
-
-$(call emugl-end-module)
-
-#### egl.cfg ####
-
-# Ensure that this file is only copied to emulator-specific builds.
-# Other builds are device-specific and will provide their own
-# version of this file to point to the appropriate HW EGL libraries.
-#
-ifneq (,$(filter full full_x86 full_mips sdk sdk_x86 sdk_mips,$(TARGET_PRODUCT)))
-ifeq (,$(BUILD_EMULATOR_OPENGL_DRIVER))
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := egl.cfg
-LOCAL_SRC_FILES := $(LOCAL_MODULE)
-
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/egl
-LOCAL_MODULE_CLASS := ETC
-
-include $(BUILD_PREBUILT)
-endif # building 'real' driver BUILD_EMULATOR_OPENGL_DRIVER
-endif # TARGET_PRODUCT in 'full sdk full_x86 sdk_x86 full_mips sdk_mips'
-
-#### gles_emul.cfg ####
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := gles_emul.cfg
-LOCAL_SRC_FILES := $(LOCAL_MODULE)
-
-LOCAL_MODULE_PATH := $(TARGET_OUT)/etc
-LOCAL_MODULE_CLASS := ETC
-
-include $(BUILD_PREBUILT)
+++ /dev/null
-/*
-* Copyright 2011 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 _API_INITIALIZER_H_
-#define _API_INITIALIZER_H_
-#include <stdlib.h>
-#include <dlfcn.h>
-
-class ApiInitializer {
-public:
- ApiInitializer(void *dso) :
- m_dso(dso) {
- }
- static void *s_getProc(const char *name, void *userData) {
- ApiInitializer *self = (ApiInitializer *)userData;
- return self->getProc(name);
- }
-private:
- void *m_dso;
- void *getProc(const char *name) {
- void *symbol = NULL;
- if (m_dso) {
- symbol = dlsym(m_dso, name);
- }
- return symbol;
- }
-};
-
-#endif
+++ /dev/null
-# Copyright (C) 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.
-#
-
-# If you don't need to do a full clean build but would like to touch
-# a file or delete some intermediate files, add a clean step to the end
-# of the list. These steps will only be run once, if they haven't been
-# run before.
-#
-# E.g.:
-# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
-# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
-#
-# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
-# files that are missing or have been moved.
-#
-# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
-# Use $(OUT_DIR) to refer to the "out" directory.
-#
-# If you need to re-do something that's already mentioned, just copy
-# the command and add it to the bottom of the list. E.g., if a change
-# that you made last week required touching a file and a change you
-# made today requires touching the same file, just copy the old
-# touch step and add it to the end of the list.
-#
-# ************************************************
-# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
-# ************************************************
-
-# For example:
-#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
-#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
-#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
-#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
-
-# ************************************************
-# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
-# ************************************************
-$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/SHARED_LIBRARIES/libGLES_emul_intermediates)
+++ /dev/null
-/*
-* Copyright (C) 2011 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 <stdio.h>
-#include <stdlib.h>
-#include "ServerConnection.h"
-#include "TcpStream.h"
-#include "QemuPipeStream.h"
-#include <cutils/log.h>
-#include "ThreadInfo.h"
-
-gl_client_context_t *ServerConnection::s_getGlContext()
-{
- EGLThreadInfo *ti = getEGLThreadInfo();
- if (ti->serverConn) {
- return ti->serverConn->m_glEnc;
- }
- return NULL;
-}
-
-gl2_client_context_t *ServerConnection::s_getGl2Context()
-{
- EGLThreadInfo *ti = getEGLThreadInfo();
- if (ti->serverConn) {
- return ti->serverConn->m_gl2Enc;
- }
- return NULL;
-}
-
-ServerConnection *ServerConnection::s_getServerConnection()
-{
- EGLThreadInfo *ti = getEGLThreadInfo();
- if (!ti->serverConn)
- {
- ti->serverConn = new ServerConnection();
- if (ti->serverConn->create() < 0) {
- delete ti->serverConn;
- ti->serverConn = NULL;
- }
- }
-
- return ti->serverConn;
-}
-
-
-ServerConnection::ServerConnection() :
- m_stream(NULL),
- m_glEnc(NULL),
- m_ut_enc(NULL)
-{
-}
-
-ServerConnection::~ServerConnection()
-{
- delete m_ut_enc;
- delete m_glEnc;
- delete m_stream;
-}
-
-
-
-int ServerConnection::create(size_t bufsize,
- const char *defaultServer)
-{
- /* XXX: Make configurable through system property */
- int useQemuPipe = 1;
-
- if (m_stream != NULL) delete(m_stream);
-
- if (useQemuPipe) {
- QemuPipeStream* pipeStream = new QemuPipeStream(bufsize);
-
- if (pipeStream->connect() < 0) {
- ALOGE("couldn't connect to host server\n");
- delete pipeStream;
- return -1;
- }
- m_stream = pipeStream;
- }
- else /* !useQemuPipe */
- {
- TcpStream* tcpStream = new TcpStream(bufsize);
-
- char *s = getenv(ENV_RGL_SERVER);
- char *hostname;
- if (s == NULL) {
- hostname = strdup(defaultServer);
- } else {
- hostname = strdup(s);
- }
-
- if (tcpStream->connect(hostname, CODEC_SERVER_PORT) < 0) {
- ALOGE("couldn't connect to %s\n", hostname);
- free(hostname);
- delete tcpStream;
- return -1;
- }
- LOGI("connecting to server %s\n", hostname);
- free(hostname);
-
- m_stream = tcpStream;
- }
-
- m_glEnc = new GLEncoder(m_stream);
- m_glEnc->setContextAccessor(s_getGlContext);
-
- m_gl2Enc = new GL2Encoder(m_stream);
- m_gl2Enc->setContextAccessor(s_getGl2Context);
-
- m_ut_enc = new ut_rendercontrol_encoder_context_t(m_stream);
- return 0;
-}
-
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _SERVER_CONNECTION_H
-#define _SERVER_CONNECTION_H
-
-#include "GLEncoder.h"
-#include "GL2Encoder.h"
-#include "IOStream.h"
-#include "codec_defs.h"
-#include "ut_rendercontrol_enc.h"
-#include <pthread.h>
-
-#define ENV_RGL_SERVER "RGL_SERVER"
-#define RGL_DEFAULT_SERVER "10.0.2.2"
-
-class ServerConnection {
-public:
- ~ServerConnection();
- int create(size_t buf_size = 4 * 1024 * 1024, const char *defaultServer = RGL_DEFAULT_SERVER);
- static gl_client_context_t *s_getGlContext();
- static ServerConnection *s_getServerConnection();
- static gl2_client_context_t *s_getGl2Context();
- GLEncoder *glEncoder() { return m_glEnc; }
- GL2Encoder *gl2Encoder() { return m_gl2Enc; }
- ut_rendercontrol_encoder_context_t * utEnc() { return m_ut_enc; }
-
-private:
- ServerConnection();
-
-private:
- static pthread_key_t s_glKey;
- static pthread_key_t s_connectionKey;
- static void s_initKeys();
- IOStream *m_stream;
- GLEncoder *m_glEnc;
- GL2Encoder *m_gl2Enc;
- ut_rendercontrol_encoder_context_t *m_ut_enc;
-
-};
-
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "ThreadInfo.h"
-#include "cutils/threads.h"
-
-thread_store_t s_tls = THREAD_STORE_INITIALIZER;
-
-static void tlsDestruct(void *ptr)
-{
- if (ptr) {
- EGLThreadInfo *ti = (EGLThreadInfo *)ptr;
- delete ti->serverConn;
- delete ti;
- }
-}
-
-EGLThreadInfo *getEGLThreadInfo()
-{
- EGLThreadInfo *ti = (EGLThreadInfo *)thread_store_get(&s_tls);
- if (ti) return ti;
-
- ti = new EGLThreadInfo();
- thread_store_set(&s_tls, ti, tlsDestruct);
-
- return ti;
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _THREAD_INFO_H
-#define _THREAD_INFO_H
-
-#include "ServerConnection.h"
-#include <EGL/egl.h>
-
-struct EGLWrapperContext
-{
- EGLWrapperContext(EGLContext p_aglContext, int _version) {
- aglContext = p_aglContext;
- clientState = NULL;
- version = _version;
- }
-
- ~EGLWrapperContext() {
- delete clientState;
- }
-
- EGLContext aglContext;
- GLClientState *clientState;
- int version;
-};
-
-struct EGLThreadInfo
-{
- EGLThreadInfo() : currentContext(NULL), serverConn(NULL) {}
-
- EGLWrapperContext *currentContext;
- ServerConnection *serverConn;
-};
-
-
-EGLThreadInfo *getEGLThreadInfo();
-#endif
+++ /dev/null
-0 0 emul
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (C) 2011 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.
-*/
-
-//
-// WARNING -------------------------- WARNING
-// This code meant to be used for testing purposes only. It is not production
-// level quality.
-// Use on your own risk !!
-//
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dlfcn.h>
-#include "egl_dispatch.h"
-#include "egl_ftable.h"
-#include <cutils/process_name.h>
-#include <cutils/log.h>
-#include "ServerConnection.h"
-#include "ThreadInfo.h"
-#include <pthread.h>
-#include "gl_wrapper_context.h"
-#include "gl2_wrapper_context.h"
-
-#define GLES_EMUL_TARGETS_FILE "/system/etc/gles_emul.cfg"
-// implementation libraries;
-#define GLESv1_enc_LIB "/system/lib/libGLESv1_enc.so"
-#define GLESv2_enc_LIB "/system/lib/libGLESv2_enc.so"
-#define GLES_android_LIB "/system/lib/egl/libGLES_android.so"
-// driver libraries;
-#define GLESv1_DRIVER "/system/lib/egl/libGLESv1_CM_emul.so"
-#define GLESv2_DRIVER "/system/lib/egl/libGLESv2_emul.so"
-
-
-static struct egl_dispatch *s_dispatch = NULL;
-pthread_once_t dispatchTablesInitialized = PTHREAD_ONCE_INIT;
-
-static bool s_needEncode = false;
-
-static gl_wrapper_context_t *g_gl_dispatch = NULL;
-static gl2_wrapper_context_t *g_gl2_dispatch = NULL;
-
-template <class T>
-int initApi(const char *driverLibName, const char *implLibName, T **dispatchTable, T *(*accessor)())
-{
- void *driverLib = dlopen(driverLibName, RTLD_NOW | RTLD_LOCAL);
- if (driverLib == NULL) {
- ALOGE("failed to load %s : %s\n", driverLibName, dlerror());
- return -1;
- }
-
- typedef T *(*createFcn_t)(void *, T *(*accessor)());
- createFcn_t createFcn;
- createFcn = (createFcn_t) dlsym(driverLib, "createFromLib");
- if (createFcn == NULL) {
- ALOGE("failed to load createFromLib constructor function\n");
- return -1;
- }
-
- void *implLib = dlopen(implLibName, RTLD_NOW | RTLD_LOCAL);
- if (implLib == NULL) {
- ALOGE("couldn't open %s", implLibName);
- return -2;
- }
- *dispatchTable = createFcn(implLib, accessor);
- if (*dispatchTable == NULL) {
- return -3;
- }
-
- // XXX - we do close the impl library since it doesn't have data, as far as we concern.
- dlclose(implLib);
-
- // XXX - we do not dlclose the driver library, so its not initialized when
- // later loaded by android - is this required?
- ALOGD("loading %s into %s complete\n", implLibName, driverLibName);
- return 0;
-
-}
-
-static gl_wrapper_context_t *getGLContext()
-{
- return g_gl_dispatch;
-}
-
-static gl2_wrapper_context_t *getGL2Context()
-{
- return g_gl2_dispatch;
-}
-
-const char *getProcName()
-{
- static const char *procname = NULL;
-
- if (procname == NULL) {
- const char *str = get_process_name();
- if (strcmp(str, "unknown") != 0) {
- procname = str;
- } else {
- // we need to obtain our process name from the command line;
- FILE *fp = fopen("/proc/self/cmdline", "rt");
- if (fp == NULL) {
- ALOGE("couldn't open /proc/self/cmdline\n");
- return NULL;
- }
-
- char line[1000];
- if (fgets(line, sizeof(line), fp) == NULL) {
- ALOGE("couldn't read the self cmdline from \n");
- fclose(fp);
- return NULL;
- }
- fclose(fp);
-
- if (line[0] == '\0') {
- ALOGE("cmdline is empty\n");
- return NULL;
- }
-
- //obtain the basename;
- line[sizeof(line) - 1] = '\0';
- char *p = line;
- while (*p != '\0' &&
- *p != '\t' &&
- *p != ' ' &&
- *p != '\n') {
- p++;
- }
-
- *p = '\0'; p--;
- while (p > line && *p != '/') p--;
- if (*p == '/') p++;
- procname = strdup(p);
- }
- }
-
- return procname;
-}
-
-
-
-bool isNeedEncode()
-{
- const char *procname = getProcName();
- if (procname == NULL) return false;
- ALOGD("isNeedEncode? for %s\n", procname);
- // check on our whitelist
- FILE *fp = fopen(GLES_EMUL_TARGETS_FILE, "rt");
- if (fp == NULL) {
- ALOGE("couldn't open %s\n", GLES_EMUL_TARGETS_FILE);
- return false;
- }
-
- char line[100];
- bool found = false;
- size_t procnameLen = strlen(procname);
-
- while (fgets(line, sizeof(line), fp) != NULL) {
- if (strlen(line) >= procnameLen &&
- !strncmp(procname, line, procnameLen)) {
- char c = line[procnameLen];
- if (c == '\0' || c == ' ' || c == '\t' || c == '\n') {
- found = true;
- ALOGD("should use encoder for %s\n", procname);
- break;
- }
- }
- }
- fclose(fp);
- return found;
-}
-
-void initDispatchTables()
-{
- //
- // Load our back-end implementation of EGL/GLES
- //
- ALOGD("Loading egl dispatch for %s\n", getProcName());
-
- void *gles_android = dlopen("/system/lib/egl/libGLES_android.so", RTLD_NOW | RTLD_LOCAL);
- if (!gles_android) {
- fprintf(stderr,"FATAL ERROR: Could not load libGLES_android lib\n");
- exit(-1);
- }
-
- //
- // Load back-end EGL implementation library
- //
- s_dispatch = create_egl_dispatch( gles_android );
- if (!s_dispatch) {
- fprintf(stderr,"FATAL ERROR: Could not create egl dispatch\n");
- exit(-1);
- }
-
- //
- // initialize gles
- //
- s_needEncode = isNeedEncode();
- void *gles_encoder = NULL;
- if (s_needEncode) {
- // initialize a connection to the server, and the GLESv1/v2 encoders;
- ServerConnection * connection = ServerConnection::s_getServerConnection();
- if (connection == NULL) {
- ALOGE("couldn't create server connection\n");
- s_needEncode = false;
- }
- }
-
- // init dispatch tabels for GLESv1 & GLESv2
- if (s_needEncode) {
- // XXX - we do not check the retrun value because there isn't much we can do here on failure.
-
- if (initApi<gl_wrapper_context_t>(GLESv1_DRIVER, GLESv1_enc_LIB, &g_gl_dispatch, getGLContext) < 0) {
- // fallback to android on faluire
- s_needEncode = false;
- } else {
- initApi<gl2_wrapper_context_t>(GLESv2_DRIVER, GLESv2_enc_LIB, &g_gl2_dispatch, getGL2Context);
- }
- }
-
- if (!s_needEncode) {
- ALOGD("Initializing native opengl for %s\n", getProcName());
- initApi<gl_wrapper_context_t>(GLESv1_DRIVER, GLES_android_LIB, &g_gl_dispatch, getGLContext);
- // try to initialize gl2 from GLES, though its probably going to fail
- initApi<gl2_wrapper_context_t>(GLESv2_DRIVER, GLES_android_LIB, &g_gl2_dispatch, getGL2Context);
- }
-}
-
-static struct egl_dispatch *getDispatch()
-{
- pthread_once(&dispatchTablesInitialized, initDispatchTables);
- return s_dispatch;
-}
-
-__eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
-{
-
- // search in EGL function table
- for (int i=0; i<egl_num_funcs; i++) {
- if (!strcmp(egl_funcs_by_name[i].name, procname)) {
- return (__eglMustCastToProperFunctionPointerType)egl_funcs_by_name[i].proc;
- }
- }
-
- // we do not support eglGetProcAddress for GLESv1 & GLESv2. The loader
- // should be able to find this function through dynamic loading.
- return NULL;
-}
-
-//////////////// Path through functions //////////
-
-EGLint eglGetError()
-{
- return getDispatch()->eglGetError();
-}
-
-EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
-{
- return getDispatch()->eglGetDisplay(display_id);
-}
-
-EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
-{
- return getDispatch()->eglInitialize(dpy, major, minor);
-}
-
-EGLBoolean eglTerminate(EGLDisplay dpy)
-{
- return getDispatch()->eglTerminate(dpy);
-}
-
-const char* eglQueryString(EGLDisplay dpy, EGLint name)
-{
- return getDispatch()->eglQueryString(dpy, name);
-}
-
-EGLBoolean eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config)
-{
- return getDispatch()->eglGetConfigs(dpy, configs, config_size, num_config);
-}
-
-static EGLint * filter_es2_bit(const EGLint *attrib_list, bool *isES2)
-{
- if (attrib_list == NULL) {
- if (isES2 != NULL) *isES2 = false;
- return NULL;
- }
-
- EGLint *attribs = NULL;
- int nAttribs = 0;
- while(attrib_list[nAttribs] != EGL_NONE) nAttribs++;
- nAttribs++;
-
- attribs = new EGLint[nAttribs];
- memcpy(attribs, attrib_list, nAttribs * sizeof(EGLint));
- if (isES2 != NULL) *isES2 = false;
-
- // scan the attribute list for ES2 request and replace with ES1.
- for (int i = 0; i < nAttribs; i++) {
- if (attribs[i] == EGL_RENDERABLE_TYPE) {
- if (attribs[i + 1] & EGL_OPENGL_ES2_BIT) {
- attribs[i + 1] &= ~EGL_OPENGL_ES2_BIT;
- attribs[i + 1] |= EGL_OPENGL_ES_BIT;
- ALOGD("removing ES2 bit 0x%x\n", attribs[i + 1]);
- if (isES2 != NULL) *isES2 = true;
- }
- }
- }
- return attribs;
-}
-
-EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
-{
- EGLBoolean res;
- if (s_needEncode) {
- EGLint *attribs = filter_es2_bit(attrib_list, NULL);
- res = getDispatch()->eglChooseConfig(dpy,
- attribs,
- configs,
- config_size,
- num_config);
- ALOGD("eglChooseConfig: %d configs found\n", *num_config);
- if (*num_config == 0 && attribs != NULL) {
- ALOGD("requested attributes:\n");
- for (int i = 0; attribs[i] != EGL_NONE; i++) {
- ALOGD("%d: 0x%x\n", i, attribs[i]);
- }
- }
-
- delete attribs;
- } else {
- res = getDispatch()->eglChooseConfig(dpy, attrib_list, configs, config_size, num_config);
- }
- return res;
-}
-
-EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
-{
- if (s_needEncode && attribute == EGL_RENDERABLE_TYPE) {
- *value = EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT;
- return EGL_TRUE;
- } else {
- return getDispatch()->eglGetConfigAttrib(dpy, config, attribute, value);
- }
-}
-
-EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
-{
- EGLSurface surface = getDispatch()->eglCreateWindowSurface(dpy, config, win, attrib_list);
- if (surface != EGL_NO_SURFACE) {
- ServerConnection *server;
- if (s_needEncode && (server = ServerConnection::s_getServerConnection()) != NULL) {
- server->utEnc()->createSurface(server->utEnc(), getpid(), (uint32_t)surface);
- }
- }
- return surface;
-}
-
-EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
-{
- EGLSurface surface = getDispatch()->eglCreatePbufferSurface(dpy, config, attrib_list);
- if (surface != EGL_NO_SURFACE) {
- ServerConnection *server;
- if (s_needEncode && (server = ServerConnection::s_getServerConnection()) != NULL) {
- server->utEnc()->createSurface(server->utEnc(), getpid(), (uint32_t)surface);
- }
- }
- return surface;
-}
-
-EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list)
-{
- EGLSurface surface = getDispatch()->eglCreatePixmapSurface(dpy, config, pixmap, attrib_list);
- if (surface != EGL_NO_SURFACE) {
- ServerConnection *server;
- if (s_needEncode && (server = ServerConnection::s_getServerConnection()) != NULL) {
- server->utEnc()->createSurface(server->utEnc(), getpid(), (uint32_t)surface);
- }
- }
- return surface;
-}
-
-EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
-{
- EGLBoolean res = getDispatch()->eglDestroySurface(dpy, surface);
- if (res && surface != EGL_NO_SURFACE) {
- ServerConnection *server;
- if (s_needEncode && (server = ServerConnection::s_getServerConnection()) != NULL) {
- server->utEnc()->destroySurface(server->utEnc(), getpid(), (uint32_t)surface);
- }
- }
- return res;
-}
-
-EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value)
-{
- EGLBoolean res = getDispatch()->eglQuerySurface(dpy, surface, attribute, value);
- if (res && attribute == EGL_RENDERABLE_TYPE) {
- *value |= EGL_OPENGL_ES2_BIT;
- }
- return res;
-}
-
-EGLBoolean eglBindAPI(EGLenum api)
-{
- return getDispatch()->eglBindAPI(api);
-}
-
-EGLenum eglQueryAPI()
-{
- return getDispatch()->eglQueryAPI();
-}
-
-EGLBoolean eglWaitClient()
-{
- return getDispatch()->eglWaitClient();
-}
-
-EGLBoolean eglReleaseThread()
-{
- return getDispatch()->eglReleaseThread();
-}
-
-EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list)
-{
- return getDispatch()->eglCreatePbufferFromClientBuffer(dpy, buftype, buffer, config, attrib_list);
-}
-
-EGLBoolean eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
-{
- return getDispatch()->eglSurfaceAttrib(dpy, surface, attribute, value);
-}
-
-EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- return getDispatch()->eglBindTexImage(dpy, surface, buffer);
-}
-
-EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- return getDispatch()->eglReleaseTexImage(dpy, surface, buffer);
-}
-
-EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
-{
- return getDispatch()->eglSwapInterval(dpy, interval);
-}
-
-EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
-{
-
- EGLContext share = share_context;
- if (share) share = ((EGLWrapperContext *)share_context)->aglContext;
-
- // check if are ES2, and convert it to ES1.
- int nAttribs = 0;
- if (attrib_list != NULL) {
- while(attrib_list[nAttribs] != EGL_NONE) {
- nAttribs++;
- }
- nAttribs++;
- }
-
- EGLint *attrib = NULL;
- if (nAttribs > 0) {
- attrib = new EGLint[nAttribs];
- memcpy(attrib, attrib_list, nAttribs * sizeof(EGLint));
- }
-
- int version = 1;
- for (int i = 0; i < nAttribs; i++) {
- if (attrib[i] == EGL_CONTEXT_CLIENT_VERSION &&
- attrib[i + 1] == 2) {
- version = 2;
- attrib[i + 1] = 1; // replace to version 1
- }
- }
-
- EGLContext ctx = getDispatch()->eglCreateContext(dpy, config, share, attrib);
- delete attrib;
- EGLWrapperContext *wctx = new EGLWrapperContext(ctx, version);
- if (ctx != EGL_NO_CONTEXT) {
- ServerConnection *server;
- if (s_needEncode && (server = ServerConnection::s_getServerConnection()) != NULL) {
- wctx->clientState = new GLClientState();
- server->utEnc()->createContext(server->utEnc(), getpid(),
- (uint32_t)wctx,
- (uint32_t)(share_context == EGL_NO_CONTEXT ? 0 : share_context), wctx->version);
- }
- }
- return (EGLContext)wctx;
-}
-
-EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
-{
- EGLWrapperContext *wctx = (EGLWrapperContext *)ctx;
- EGLBoolean res = EGL_FALSE;
-
- if (ctx && ctx != EGL_NO_CONTEXT) {
- res = getDispatch()->eglDestroyContext(dpy, wctx->aglContext);
- if (res) {
- EGLThreadInfo *ti = getEGLThreadInfo();
- ServerConnection *server;
- if (s_needEncode && (server = ServerConnection::s_getServerConnection())) {
- server->utEnc()->destroyContext(ti->serverConn->utEnc(), getpid(), (uint32_t)ctx);
- }
- if (ti->currentContext == wctx) ti->currentContext = NULL;
- delete wctx;
- }
- }
-
- return res;
-}
-
-EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
-{
- EGLWrapperContext *wctx = (EGLWrapperContext *)ctx;
- EGLContext aglContext = (ctx == EGL_NO_CONTEXT ? EGL_NO_CONTEXT : wctx->aglContext);
- EGLThreadInfo *ti = getEGLThreadInfo();
- EGLBoolean res = getDispatch()->eglMakeCurrent(dpy, draw, read, aglContext);
- if (res ) {
- // NOTE - we do get a pointer to the server connection, (rather then using ti->serverConn)
- // for cases that this is the first egl call of the current thread.
-
- ServerConnection *server;
- if (s_needEncode && (server = ServerConnection::s_getServerConnection())) {
- server->utEnc()->makeCurrentContext(server->utEnc(), getpid(),
- (uint32_t) (draw == EGL_NO_SURFACE ? 0 : draw),
- (uint32_t) (read == EGL_NO_SURFACE ? 0 : read),
- (uint32_t) (ctx == EGL_NO_CONTEXT ? 0 : ctx));
- server->glEncoder()->setClientState( wctx ? wctx->clientState : NULL );
- server->gl2Encoder()->setClientState( wctx ? wctx->clientState : NULL );
- }
-
- // set current context in our thread info
- ti->currentContext = wctx;
- }
- return res;
-
-}
-
-EGLContext eglGetCurrentContext()
-{
- EGLThreadInfo *ti = getEGLThreadInfo();
- return (ti->currentContext ? ti->currentContext : EGL_NO_CONTEXT);
-}
-
-EGLSurface eglGetCurrentSurface(EGLint readdraw)
-{
- return getDispatch()->eglGetCurrentSurface(readdraw);
-}
-
-EGLDisplay eglGetCurrentDisplay()
-{
- return getDispatch()->eglGetCurrentDisplay();
-}
-
-EGLBoolean eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value)
-{
- EGLWrapperContext *wctx = (EGLWrapperContext *)ctx;
- if (wctx) {
- if (attribute == EGL_CONTEXT_CLIENT_VERSION) {
- *value = wctx->version;
- return EGL_TRUE;
- } else {
- return getDispatch()->eglQueryContext(dpy, wctx->aglContext, attribute, value);
- }
- }
- else {
- return EGL_BAD_CONTEXT;
- }
-}
-
-EGLBoolean eglWaitGL()
-{
- return getDispatch()->eglWaitGL();
-}
-
-EGLBoolean eglWaitNative(EGLint engine)
-{
- return getDispatch()->eglWaitNative(engine);
-}
-
-EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
-{
- ServerConnection *server;
- if (s_needEncode && (server = ServerConnection::s_getServerConnection()) != NULL) {
- server->utEnc()->swapBuffers(server->utEnc(), getpid(), (uint32_t)surface);
- server->glEncoder()->flush();
- server->gl2Encoder()->flush();
- return 1;
- }
- return getDispatch()->eglSwapBuffers(dpy, surface);
-}
-
-EGLBoolean eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
-{
- return getDispatch()->eglCopyBuffers(dpy, surface, target);
-}
-
-EGLBoolean eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list)
-{
- return getDispatch()->eglLockSurfaceKHR(display, surface, attrib_list);
-}
-
-EGLBoolean eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface)
-{
- return getDispatch()->eglUnlockSurfaceKHR(display, surface);
-}
-
-EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
-{
- EGLWrapperContext *wctx = (EGLWrapperContext *)ctx;
- EGLContext aglContext = (wctx ? wctx->aglContext : EGL_NO_CONTEXT);
- return getDispatch()->eglCreateImageKHR(dpy, aglContext, target, buffer, attrib_list);
-}
-
-EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
-{
- return getDispatch()->eglDestroyImageKHR(dpy, image);
-}
-
-EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
-{
- return getDispatch()->eglCreateSyncKHR(dpy, type, attrib_list);
-}
-
-EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
-{
- return getDispatch()->eglDestroySyncKHR(dpy, sync);
-}
-
-EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout)
-{
- return getDispatch()->eglClientWaitSyncKHR(dpy, sync, flags, timeout);
-}
-
-EGLBoolean eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode)
-{
- return getDispatch()->eglSignalSyncKHR(dpy, sync, mode);
-}
-
-EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value)
-{
- return getDispatch()->eglGetSyncAttribKHR(dpy, sync, attribute, value);
-}
-
-EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height)
-{
- return getDispatch()->eglSetSwapRectangleANDROID(dpy, draw, left, top, width, height);
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 <stdio.h>
-#include "egl_dispatch.h"
-#include <dlfcn.h>
-
-egl_dispatch *create_egl_dispatch(void *gles_android)
-{
- egl_dispatch *disp = new egl_dispatch;
-
- void *ptr;
- ptr = dlsym(gles_android,"eglGetError"); disp->set_eglGetError((eglGetError_t)ptr);
- ptr = dlsym(gles_android,"eglGetDisplay"); disp->set_eglGetDisplay((eglGetDisplay_t)ptr);
- ptr = dlsym(gles_android,"eglInitialize"); disp->set_eglInitialize((eglInitialize_t)ptr);
- ptr = dlsym(gles_android,"eglTerminate"); disp->set_eglTerminate((eglTerminate_t)ptr);
- ptr = dlsym(gles_android,"eglQueryString"); disp->set_eglQueryString((eglQueryString_t)ptr);
- ptr = dlsym(gles_android,"eglGetConfigs"); disp->set_eglGetConfigs((eglGetConfigs_t)ptr);
- ptr = dlsym(gles_android,"eglChooseConfig"); disp->set_eglChooseConfig((eglChooseConfig_t)ptr);
- ptr = dlsym(gles_android,"eglGetConfigAttrib"); disp->set_eglGetConfigAttrib((eglGetConfigAttrib_t)ptr);
- ptr = dlsym(gles_android,"eglCreateWindowSurface"); disp->set_eglCreateWindowSurface((eglCreateWindowSurface_t)ptr);
- ptr = dlsym(gles_android,"eglCreatePbufferSurface"); disp->set_eglCreatePbufferSurface((eglCreatePbufferSurface_t)ptr);
- ptr = dlsym(gles_android,"eglCreatePixmapSurface"); disp->set_eglCreatePixmapSurface((eglCreatePixmapSurface_t)ptr);
- ptr = dlsym(gles_android,"eglDestroySurface"); disp->set_eglDestroySurface((eglDestroySurface_t)ptr);
- ptr = dlsym(gles_android,"eglQuerySurface"); disp->set_eglQuerySurface((eglQuerySurface_t)ptr);
- ptr = dlsym(gles_android,"eglBindAPI"); disp->set_eglBindAPI((eglBindAPI_t)ptr);
- ptr = dlsym(gles_android,"eglQueryAPI"); disp->set_eglQueryAPI((eglQueryAPI_t)ptr);
- ptr = dlsym(gles_android,"eglWaitClient"); disp->set_eglWaitClient((eglWaitClient_t)ptr);
- ptr = dlsym(gles_android,"eglReleaseThread"); disp->set_eglReleaseThread((eglReleaseThread_t)ptr);
- ptr = dlsym(gles_android,"eglCreatePbufferFromClientBuffer"); disp->set_eglCreatePbufferFromClientBuffer((eglCreatePbufferFromClientBuffer_t)ptr);
- ptr = dlsym(gles_android,"eglSurfaceAttrib"); disp->set_eglSurfaceAttrib((eglSurfaceAttrib_t)ptr);
- ptr = dlsym(gles_android,"eglBindTexImage"); disp->set_eglBindTexImage((eglBindTexImage_t)ptr);
- ptr = dlsym(gles_android,"eglReleaseTexImage"); disp->set_eglReleaseTexImage((eglReleaseTexImage_t)ptr);
- ptr = dlsym(gles_android,"eglSwapInterval"); disp->set_eglSwapInterval((eglSwapInterval_t)ptr);
- ptr = dlsym(gles_android,"eglCreateContext"); disp->set_eglCreateContext((eglCreateContext_t)ptr);
- ptr = dlsym(gles_android,"eglDestroyContext"); disp->set_eglDestroyContext((eglDestroyContext_t)ptr);
- ptr = dlsym(gles_android,"eglMakeCurrent"); disp->set_eglMakeCurrent((eglMakeCurrent_t)ptr);
- ptr = dlsym(gles_android,"eglGetCurrentContext"); disp->set_eglGetCurrentContext((eglGetCurrentContext_t)ptr);
- ptr = dlsym(gles_android,"eglGetCurrentSurface"); disp->set_eglGetCurrentSurface((eglGetCurrentSurface_t)ptr);
- ptr = dlsym(gles_android,"eglGetCurrentDisplay"); disp->set_eglGetCurrentDisplay((eglGetCurrentDisplay_t)ptr);
- ptr = dlsym(gles_android,"eglQueryContext"); disp->set_eglQueryContext((eglQueryContext_t)ptr);
- ptr = dlsym(gles_android,"eglWaitGL"); disp->set_eglWaitGL((eglWaitGL_t)ptr);
- ptr = dlsym(gles_android,"eglWaitNative"); disp->set_eglWaitNative((eglWaitNative_t)ptr);
- ptr = dlsym(gles_android,"eglSwapBuffers"); disp->set_eglSwapBuffers((eglSwapBuffers_t)ptr);
- ptr = dlsym(gles_android,"eglCopyBuffers"); disp->set_eglCopyBuffers((eglCopyBuffers_t)ptr);
- ptr = dlsym(gles_android,"eglGetProcAddress"); disp->set_eglGetProcAddress((eglGetProcAddress_t)ptr);
- ptr = dlsym(gles_android,"eglLockSurfaceKHR"); disp->set_eglLockSurfaceKHR((eglLockSurfaceKHR_t)ptr);
- ptr = dlsym(gles_android,"eglUnlockSurfaceKHR"); disp->set_eglUnlockSurfaceKHR((eglUnlockSurfaceKHR_t)ptr);
- ptr = dlsym(gles_android,"eglCreateImageKHR"); disp->set_eglCreateImageKHR((eglCreateImageKHR_t)ptr);
- ptr = dlsym(gles_android,"eglDestroyImageKHR"); disp->set_eglDestroyImageKHR((eglDestroyImageKHR_t)ptr);
- ptr = dlsym(gles_android,"eglCreateSyncKHR"); disp->set_eglCreateSyncKHR((eglCreateSyncKHR_t)ptr);
- ptr = dlsym(gles_android,"eglDestroySyncKHR"); disp->set_eglDestroySyncKHR((eglDestroySyncKHR_t)ptr);
- ptr = dlsym(gles_android,"eglClientWaitSyncKHR"); disp->set_eglClientWaitSyncKHR((eglClientWaitSyncKHR_t)ptr);
- ptr = dlsym(gles_android,"eglSignalSyncKHR"); disp->set_eglSignalSyncKHR((eglSignalSyncKHR_t)ptr);
- ptr = dlsym(gles_android,"eglGetSyncAttribKHR"); disp->set_eglGetSyncAttribKHR((eglGetSyncAttribKHR_t)ptr);
- ptr = dlsym(gles_android,"eglSetSwapRectangleANDROID"); disp->set_eglSetSwapRectangleANDROID((eglSetSwapRectangleANDROID_t)ptr);
-
- return disp;
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _EGL_DISPATCH_H
-#define _EGL_DISPATCH_H
-
-#include "egl_proc.h"
-
-struct egl_dispatch {
- eglGetError_t eglGetError;
- eglGetDisplay_t eglGetDisplay;
- eglInitialize_t eglInitialize;
- eglTerminate_t eglTerminate;
- eglQueryString_t eglQueryString;
- eglGetConfigs_t eglGetConfigs;
- eglChooseConfig_t eglChooseConfig;
- eglGetConfigAttrib_t eglGetConfigAttrib;
- eglCreateWindowSurface_t eglCreateWindowSurface;
- eglCreatePbufferSurface_t eglCreatePbufferSurface;
- eglCreatePixmapSurface_t eglCreatePixmapSurface;
- eglDestroySurface_t eglDestroySurface;
- eglQuerySurface_t eglQuerySurface;
- eglBindAPI_t eglBindAPI;
- eglQueryAPI_t eglQueryAPI;
- eglWaitClient_t eglWaitClient;
- eglReleaseThread_t eglReleaseThread;
- eglCreatePbufferFromClientBuffer_t eglCreatePbufferFromClientBuffer;
- eglSurfaceAttrib_t eglSurfaceAttrib;
- eglBindTexImage_t eglBindTexImage;
- eglReleaseTexImage_t eglReleaseTexImage;
- eglSwapInterval_t eglSwapInterval;
- eglCreateContext_t eglCreateContext;
- eglDestroyContext_t eglDestroyContext;
- eglMakeCurrent_t eglMakeCurrent;
- eglGetCurrentContext_t eglGetCurrentContext;
- eglGetCurrentSurface_t eglGetCurrentSurface;
- eglGetCurrentDisplay_t eglGetCurrentDisplay;
- eglQueryContext_t eglQueryContext;
- eglWaitGL_t eglWaitGL;
- eglWaitNative_t eglWaitNative;
- eglSwapBuffers_t eglSwapBuffers;
- eglCopyBuffers_t eglCopyBuffers;
- eglGetProcAddress_t eglGetProcAddress;
- eglLockSurfaceKHR_t eglLockSurfaceKHR;
- eglUnlockSurfaceKHR_t eglUnlockSurfaceKHR;
- eglCreateImageKHR_t eglCreateImageKHR;
- eglDestroyImageKHR_t eglDestroyImageKHR;
- eglCreateSyncKHR_t eglCreateSyncKHR;
- eglDestroySyncKHR_t eglDestroySyncKHR;
- eglClientWaitSyncKHR_t eglClientWaitSyncKHR;
- eglSignalSyncKHR_t eglSignalSyncKHR;
- eglGetSyncAttribKHR_t eglGetSyncAttribKHR;
- eglSetSwapRectangleANDROID_t eglSetSwapRectangleANDROID;
- //Accessors
- eglGetError_t set_eglGetError(eglGetError_t f) { eglGetError_t retval = eglGetError; eglGetError = f; return retval;}
- eglGetDisplay_t set_eglGetDisplay(eglGetDisplay_t f) { eglGetDisplay_t retval = eglGetDisplay; eglGetDisplay = f; return retval;}
- eglInitialize_t set_eglInitialize(eglInitialize_t f) { eglInitialize_t retval = eglInitialize; eglInitialize = f; return retval;}
- eglTerminate_t set_eglTerminate(eglTerminate_t f) { eglTerminate_t retval = eglTerminate; eglTerminate = f; return retval;}
- eglQueryString_t set_eglQueryString(eglQueryString_t f) { eglQueryString_t retval = eglQueryString; eglQueryString = f; return retval;}
- eglGetConfigs_t set_eglGetConfigs(eglGetConfigs_t f) { eglGetConfigs_t retval = eglGetConfigs; eglGetConfigs = f; return retval;}
- eglChooseConfig_t set_eglChooseConfig(eglChooseConfig_t f) { eglChooseConfig_t retval = eglChooseConfig; eglChooseConfig = f; return retval;}
- eglGetConfigAttrib_t set_eglGetConfigAttrib(eglGetConfigAttrib_t f) { eglGetConfigAttrib_t retval = eglGetConfigAttrib; eglGetConfigAttrib = f; return retval;}
- eglCreateWindowSurface_t set_eglCreateWindowSurface(eglCreateWindowSurface_t f) { eglCreateWindowSurface_t retval = eglCreateWindowSurface; eglCreateWindowSurface = f; return retval;}
- eglCreatePbufferSurface_t set_eglCreatePbufferSurface(eglCreatePbufferSurface_t f) { eglCreatePbufferSurface_t retval = eglCreatePbufferSurface; eglCreatePbufferSurface = f; return retval;}
- eglCreatePixmapSurface_t set_eglCreatePixmapSurface(eglCreatePixmapSurface_t f) { eglCreatePixmapSurface_t retval = eglCreatePixmapSurface; eglCreatePixmapSurface = f; return retval;}
- eglDestroySurface_t set_eglDestroySurface(eglDestroySurface_t f) { eglDestroySurface_t retval = eglDestroySurface; eglDestroySurface = f; return retval;}
- eglQuerySurface_t set_eglQuerySurface(eglQuerySurface_t f) { eglQuerySurface_t retval = eglQuerySurface; eglQuerySurface = f; return retval;}
- eglBindAPI_t set_eglBindAPI(eglBindAPI_t f) { eglBindAPI_t retval = eglBindAPI; eglBindAPI = f; return retval;}
- eglQueryAPI_t set_eglQueryAPI(eglQueryAPI_t f) { eglQueryAPI_t retval = eglQueryAPI; eglQueryAPI = f; return retval;}
- eglWaitClient_t set_eglWaitClient(eglWaitClient_t f) { eglWaitClient_t retval = eglWaitClient; eglWaitClient = f; return retval;}
- eglReleaseThread_t set_eglReleaseThread(eglReleaseThread_t f) { eglReleaseThread_t retval = eglReleaseThread; eglReleaseThread = f; return retval;}
- eglCreatePbufferFromClientBuffer_t set_eglCreatePbufferFromClientBuffer(eglCreatePbufferFromClientBuffer_t f) { eglCreatePbufferFromClientBuffer_t retval = eglCreatePbufferFromClientBuffer; eglCreatePbufferFromClientBuffer = f; return retval;}
- eglSurfaceAttrib_t set_eglSurfaceAttrib(eglSurfaceAttrib_t f) { eglSurfaceAttrib_t retval = eglSurfaceAttrib; eglSurfaceAttrib = f; return retval;}
- eglBindTexImage_t set_eglBindTexImage(eglBindTexImage_t f) { eglBindTexImage_t retval = eglBindTexImage; eglBindTexImage = f; return retval;}
- eglReleaseTexImage_t set_eglReleaseTexImage(eglReleaseTexImage_t f) { eglReleaseTexImage_t retval = eglReleaseTexImage; eglReleaseTexImage = f; return retval;}
- eglSwapInterval_t set_eglSwapInterval(eglSwapInterval_t f) { eglSwapInterval_t retval = eglSwapInterval; eglSwapInterval = f; return retval;}
- eglCreateContext_t set_eglCreateContext(eglCreateContext_t f) { eglCreateContext_t retval = eglCreateContext; eglCreateContext = f; return retval;}
- eglDestroyContext_t set_eglDestroyContext(eglDestroyContext_t f) { eglDestroyContext_t retval = eglDestroyContext; eglDestroyContext = f; return retval;}
- eglMakeCurrent_t set_eglMakeCurrent(eglMakeCurrent_t f) { eglMakeCurrent_t retval = eglMakeCurrent; eglMakeCurrent = f; return retval;}
- eglGetCurrentContext_t set_eglGetCurrentContext(eglGetCurrentContext_t f) { eglGetCurrentContext_t retval = eglGetCurrentContext; eglGetCurrentContext = f; return retval;}
- eglGetCurrentSurface_t set_eglGetCurrentSurface(eglGetCurrentSurface_t f) { eglGetCurrentSurface_t retval = eglGetCurrentSurface; eglGetCurrentSurface = f; return retval;}
- eglGetCurrentDisplay_t set_eglGetCurrentDisplay(eglGetCurrentDisplay_t f) { eglGetCurrentDisplay_t retval = eglGetCurrentDisplay; eglGetCurrentDisplay = f; return retval;}
- eglQueryContext_t set_eglQueryContext(eglQueryContext_t f) { eglQueryContext_t retval = eglQueryContext; eglQueryContext = f; return retval;}
- eglWaitGL_t set_eglWaitGL(eglWaitGL_t f) { eglWaitGL_t retval = eglWaitGL; eglWaitGL = f; return retval;}
- eglWaitNative_t set_eglWaitNative(eglWaitNative_t f) { eglWaitNative_t retval = eglWaitNative; eglWaitNative = f; return retval;}
- eglSwapBuffers_t set_eglSwapBuffers(eglSwapBuffers_t f) { eglSwapBuffers_t retval = eglSwapBuffers; eglSwapBuffers = f; return retval;}
- eglCopyBuffers_t set_eglCopyBuffers(eglCopyBuffers_t f) { eglCopyBuffers_t retval = eglCopyBuffers; eglCopyBuffers = f; return retval;}
- eglGetProcAddress_t set_eglGetProcAddress(eglGetProcAddress_t f) { eglGetProcAddress_t retval = eglGetProcAddress; eglGetProcAddress = f; return retval;}
- eglLockSurfaceKHR_t set_eglLockSurfaceKHR(eglLockSurfaceKHR_t f) { eglLockSurfaceKHR_t retval = eglLockSurfaceKHR; eglLockSurfaceKHR = f; return retval;}
- eglUnlockSurfaceKHR_t set_eglUnlockSurfaceKHR(eglUnlockSurfaceKHR_t f) { eglUnlockSurfaceKHR_t retval = eglUnlockSurfaceKHR; eglUnlockSurfaceKHR = f; return retval;}
- eglCreateImageKHR_t set_eglCreateImageKHR(eglCreateImageKHR_t f) { eglCreateImageKHR_t retval = eglCreateImageKHR; eglCreateImageKHR = f; return retval;}
- eglDestroyImageKHR_t set_eglDestroyImageKHR(eglDestroyImageKHR_t f) { eglDestroyImageKHR_t retval = eglDestroyImageKHR; eglDestroyImageKHR = f; return retval;}
- eglCreateSyncKHR_t set_eglCreateSyncKHR(eglCreateSyncKHR_t f) { eglCreateSyncKHR_t retval = eglCreateSyncKHR; eglCreateSyncKHR = f; return retval;}
- eglDestroySyncKHR_t set_eglDestroySyncKHR(eglDestroySyncKHR_t f) { eglDestroySyncKHR_t retval = eglDestroySyncKHR; eglDestroySyncKHR = f; return retval;}
- eglClientWaitSyncKHR_t set_eglClientWaitSyncKHR(eglClientWaitSyncKHR_t f) { eglClientWaitSyncKHR_t retval = eglClientWaitSyncKHR; eglClientWaitSyncKHR = f; return retval;}
- eglSignalSyncKHR_t set_eglSignalSyncKHR(eglSignalSyncKHR_t f) { eglSignalSyncKHR_t retval = eglSignalSyncKHR; eglSignalSyncKHR = f; return retval;}
- eglGetSyncAttribKHR_t set_eglGetSyncAttribKHR(eglGetSyncAttribKHR_t f) { eglGetSyncAttribKHR_t retval = eglGetSyncAttribKHR; eglGetSyncAttribKHR = f; return retval;}
- eglSetSwapRectangleANDROID_t set_eglSetSwapRectangleANDROID(eglSetSwapRectangleANDROID_t f) { eglSetSwapRectangleANDROID_t retval = eglSetSwapRectangleANDROID; eglSetSwapRectangleANDROID = f; return retval;}
-};
-
-egl_dispatch *create_egl_dispatch(void *gles_andorid);
-
-#endif
+++ /dev/null
-/*
-* Copyright (C) 2011 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.
-*/
-static struct _egl_funcs_by_name {
- const char *name;
- void *proc;
-} egl_funcs_by_name[] = {
- {"eglGetError", (void *)eglGetError},
- {"eglGetDisplay", (void *)eglGetDisplay},
- {"eglInitialize", (void *)eglInitialize},
- {"eglTerminate", (void *)eglTerminate},
- {"eglQueryString", (void *)eglQueryString},
- {"eglGetConfigs", (void *)eglGetConfigs},
- {"eglChooseConfig", (void *)eglChooseConfig},
- {"eglGetConfigAttrib", (void *)eglGetConfigAttrib},
- {"eglCreateWindowSurface", (void *)eglCreateWindowSurface},
- {"eglCreatePbufferSurface", (void *)eglCreatePbufferSurface},
- {"eglCreatePixmapSurface", (void *)eglCreatePixmapSurface},
- {"eglDestroySurface", (void *)eglDestroySurface},
- {"eglQuerySurface", (void *)eglQuerySurface},
- {"eglBindAPI", (void *)eglBindAPI},
- {"eglQueryAPI", (void *)eglQueryAPI},
- {"eglWaitClient", (void *)eglWaitClient},
- {"eglReleaseThread", (void *)eglReleaseThread},
- {"eglCreatePbufferFromClientBuffer", (void *)eglCreatePbufferFromClientBuffer},
- {"eglSurfaceAttrib", (void *)eglSurfaceAttrib},
- {"eglBindTexImage", (void *)eglBindTexImage},
- {"eglReleaseTexImage", (void *)eglReleaseTexImage},
- {"eglSwapInterval", (void *)eglSwapInterval},
- {"eglCreateContext", (void *)eglCreateContext},
- {"eglDestroyContext", (void *)eglDestroyContext},
- {"eglMakeCurrent", (void *)eglMakeCurrent},
- {"eglGetCurrentContext", (void *)eglGetCurrentContext},
- {"eglGetCurrentSurface", (void *)eglGetCurrentSurface},
- {"eglGetCurrentDisplay", (void *)eglGetCurrentDisplay},
- {"eglQueryContext", (void *)eglQueryContext},
- {"eglWaitGL", (void *)eglWaitGL},
- {"eglWaitNative", (void *)eglWaitNative},
- {"eglSwapBuffers", (void *)eglSwapBuffers},
- {"eglCopyBuffers", (void *)eglCopyBuffers},
- {"eglGetProcAddress", (void *)eglGetProcAddress},
- {"eglLockSurfaceKHR", (void *)eglLockSurfaceKHR},
- {"eglUnlockSurfaceKHR", (void *)eglUnlockSurfaceKHR},
- {"eglCreateImageKHR", (void *)eglCreateImageKHR},
- {"eglDestroyImageKHR", (void *)eglDestroyImageKHR},
- {"eglCreateSyncKHR", (void *)eglCreateSyncKHR},
- {"eglDestroySyncKHR", (void *)eglDestroySyncKHR},
- {"eglClientWaitSyncKHR", (void *)eglClientWaitSyncKHR},
- {"eglSignalSyncKHR", (void *)eglSignalSyncKHR},
- {"eglGetSyncAttribKHR", (void *)eglGetSyncAttribKHR},
- {"eglSetSwapRectangleANDROID", (void *)eglSetSwapRectangleANDROID}
-};
-
-static int egl_num_funcs = sizeof(egl_funcs_by_name) / sizeof(struct _egl_funcs_by_name);
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _EGL_PROC_H
-#define _EGL_PROC_H
-
-#include <EGL/egl.h>
-#define EGL_EGLEXT_PROTOTYPES
-#include <EGL/eglext.h>
-
-typedef EGLint (* eglGetError_t) ();
-typedef EGLDisplay (* eglGetDisplay_t) (EGLNativeDisplayType);
-typedef EGLBoolean (* eglInitialize_t) (EGLDisplay, EGLint*, EGLint*);
-typedef EGLBoolean (* eglTerminate_t) (EGLDisplay);
-typedef char* (* eglQueryString_t) (EGLDisplay, EGLint);
-typedef EGLBoolean (* eglGetConfigs_t) (EGLDisplay, EGLConfig*, EGLint, EGLint*);
-typedef EGLBoolean (* eglChooseConfig_t) (EGLDisplay, const EGLint*, EGLConfig*, EGLint, EGLint*);
-typedef EGLBoolean (* eglGetConfigAttrib_t) (EGLDisplay, EGLConfig, EGLint, EGLint*);
-typedef EGLSurface (* eglCreateWindowSurface_t) (EGLDisplay, EGLConfig, EGLNativeWindowType, const EGLint*);
-typedef EGLSurface (* eglCreatePbufferSurface_t) (EGLDisplay, EGLConfig, const EGLint*);
-typedef EGLSurface (* eglCreatePixmapSurface_t) (EGLDisplay, EGLConfig, EGLNativePixmapType, const EGLint*);
-typedef EGLBoolean (* eglDestroySurface_t) (EGLDisplay, EGLSurface);
-typedef EGLBoolean (* eglQuerySurface_t) (EGLDisplay, EGLSurface, EGLint, EGLint*);
-typedef EGLBoolean (* eglBindAPI_t) (EGLenum);
-typedef EGLenum (* eglQueryAPI_t) ();
-typedef EGLBoolean (* eglWaitClient_t) ();
-typedef EGLBoolean (* eglReleaseThread_t) ();
-typedef EGLSurface (* eglCreatePbufferFromClientBuffer_t) (EGLDisplay, EGLenum, EGLClientBuffer, EGLConfig, const EGLint*);
-typedef EGLBoolean (* eglSurfaceAttrib_t) (EGLDisplay, EGLSurface, EGLint, EGLint);
-typedef EGLBoolean (* eglBindTexImage_t) (EGLDisplay, EGLSurface, EGLint);
-typedef EGLBoolean (* eglReleaseTexImage_t) (EGLDisplay, EGLSurface, EGLint);
-typedef EGLBoolean (* eglSwapInterval_t) (EGLDisplay, EGLint);
-typedef EGLContext (* eglCreateContext_t) (EGLDisplay, EGLConfig, EGLContext, const EGLint*);
-typedef EGLBoolean (* eglDestroyContext_t) (EGLDisplay, EGLContext);
-typedef EGLBoolean (* eglMakeCurrent_t) (EGLDisplay, EGLSurface, EGLSurface, EGLContext);
-typedef EGLContext (* eglGetCurrentContext_t) ();
-typedef EGLSurface (* eglGetCurrentSurface_t) (EGLint);
-typedef EGLDisplay (* eglGetCurrentDisplay_t) ();
-typedef EGLBoolean (* eglQueryContext_t) (EGLDisplay, EGLContext, EGLint, EGLint*);
-typedef EGLBoolean (* eglWaitGL_t) ();
-typedef EGLBoolean (* eglWaitNative_t) (EGLint);
-typedef EGLBoolean (* eglSwapBuffers_t) (EGLDisplay, EGLSurface);
-typedef EGLBoolean (* eglCopyBuffers_t) (EGLDisplay, EGLSurface, EGLNativePixmapType);
-typedef __eglMustCastToProperFunctionPointerType (* eglGetProcAddress_t) (const char*);
-typedef EGLBoolean (* eglLockSurfaceKHR_t) (EGLDisplay, EGLSurface, const EGLint*);
-typedef EGLBoolean (* eglUnlockSurfaceKHR_t) (EGLDisplay, EGLSurface);
-typedef EGLImageKHR (* eglCreateImageKHR_t) (EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, const EGLint*);
-typedef EGLBoolean (* eglDestroyImageKHR_t) (EGLDisplay, EGLImageKHR image);
-typedef EGLSyncKHR (* eglCreateSyncKHR_t) (EGLDisplay, EGLenum, const EGLint*);
-typedef EGLBoolean (* eglDestroySyncKHR_t) (EGLDisplay, EGLSyncKHR sync);
-typedef EGLint (* eglClientWaitSyncKHR_t) (EGLDisplay, EGLSyncKHR, EGLint, EGLTimeKHR timeout);
-typedef EGLBoolean (* eglSignalSyncKHR_t) (EGLDisplay, EGLSyncKHR, EGLenum);
-typedef EGLBoolean (* eglGetSyncAttribKHR_t) (EGLDisplay, EGLSyncKHR, EGLint, EGLint*);
-typedef EGLBoolean (* eglSetSwapRectangleANDROID_t) (EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint);
-
-#endif // of _EGL_PROC_H
+++ /dev/null
-/*
-* Copyright (C) 2011 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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "gles_dispatch.h"
-#include "gles_ftable.h"
-#include <EGL/egl.h>
-#include <cutils/log.h>
-
-static struct gles_dispatch *s_dispatch = NULL;
-
-void init_gles(void *gles_android)
-{
- s_dispatch = create_gles_dispatch(gles_android);
- if (s_dispatch == NULL) {
- ALOGE("failed to create gles dispatch\n");
- }
-}
-
-static struct gles_dispatch *getDispatch()
-{
- if (!s_dispatch) {
- fprintf(stderr,"FATAL ERROR: GLES has not been initialized\n");
- exit(-1);
- }
-
- return s_dispatch;
-}
-
-__eglMustCastToProperFunctionPointerType gles_getProcAddress(const char *procname)
-{
- for (int i=0; i<gles_num_funcs; i++) {
- if (!strcmp(gles_funcs_by_name[i].name, procname)) {
- return (__eglMustCastToProperFunctionPointerType)gles_funcs_by_name[i].proc;
- }
- }
-
- return NULL;
-}
-
-///////////// Path-through functions ///////////////
-void glAlphaFunc(GLenum func, GLclampf ref)
-{
- getDispatch()->glAlphaFunc(func, ref);
-}
-
-void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- getDispatch()->glClearColor(red, green, blue, alpha);
-}
-
-void glClearDepthf(GLclampf depth)
-{
- getDispatch()->glClearDepthf(depth);
-}
-
-void glClipPlanef(GLenum plane, const GLfloat *equation)
-{
- getDispatch()->glClipPlanef(plane, equation);
-}
-
-void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
- getDispatch()->glColor4f(red, green, blue, alpha);
-}
-
-void glDepthRangef(GLclampf zNear, GLclampf zFar)
-{
- getDispatch()->glDepthRangef(zNear, zFar);
-}
-
-void glFogf(GLenum pname, GLfloat param)
-{
- getDispatch()->glFogf(pname, param);
-}
-
-void glFogfv(GLenum pname, const GLfloat *params)
-{
- getDispatch()->glFogfv(pname, params);
-}
-
-void glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
- getDispatch()->glFrustumf(left, right, bottom, top, zNear, zFar);
-}
-
-void glGetClipPlanef(GLenum pname, GLfloat eqn[4])
-{
- getDispatch()->glGetClipPlanef(pname, eqn);
-}
-
-void glGetFloatv(GLenum pname, GLfloat *params)
-{
- getDispatch()->glGetFloatv(pname, params);
-}
-
-void glGetLightfv(GLenum light, GLenum pname, GLfloat *params)
-{
- getDispatch()->glGetLightfv(light, pname, params);
-}
-
-void glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
-{
- getDispatch()->glGetMaterialfv(face, pname, params);
-}
-
-void glGetTexEnvfv(GLenum env, GLenum pname, GLfloat *params)
-{
- getDispatch()->glGetTexEnvfv(env, pname, params);
-}
-
-void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
-{
- getDispatch()->glGetTexParameterfv(target, pname, params);
-}
-
-void glLightModelf(GLenum pname, GLfloat param)
-{
- getDispatch()->glLightModelf(pname, param);
-}
-
-void glLightModelfv(GLenum pname, const GLfloat *params)
-{
- getDispatch()->glLightModelfv(pname, params);
-}
-
-void glLightf(GLenum light, GLenum pname, GLfloat param)
-{
- getDispatch()->glLightf(light, pname, param);
-}
-
-void glLightfv(GLenum light, GLenum pname, const GLfloat *params)
-{
- getDispatch()->glLightfv(light, pname, params);
-}
-
-void glLineWidth(GLfloat width)
-{
- getDispatch()->glLineWidth(width);
-}
-
-void glLoadMatrixf(const GLfloat *m)
-{
- getDispatch()->glLoadMatrixf(m);
-}
-
-void glMaterialf(GLenum face, GLenum pname, GLfloat param)
-{
- getDispatch()->glMaterialf(face, pname, param);
-}
-
-void glMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
-{
- getDispatch()->glMaterialfv(face, pname, params);
-}
-
-void glMultMatrixf(const GLfloat *m)
-{
- getDispatch()->glMultMatrixf(m);
-}
-
-void glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- getDispatch()->glMultiTexCoord4f(target, s, t, r, q);
-}
-
-void glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
-{
- getDispatch()->glNormal3f(nx, ny, nz);
-}
-
-void glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
- getDispatch()->glOrthof(left, right, bottom, top, zNear, zFar);
-}
-
-void glPointParameterf(GLenum pname, GLfloat param)
-{
- getDispatch()->glPointParameterf(pname, param);
-}
-
-void glPointParameterfv(GLenum pname, const GLfloat *params)
-{
- getDispatch()->glPointParameterfv(pname, params);
-}
-
-void glPointSize(GLfloat size)
-{
- getDispatch()->glPointSize(size);
-}
-
-void glPolygonOffset(GLfloat factor, GLfloat units)
-{
- getDispatch()->glPolygonOffset(factor, units);
-}
-
-void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
-{
- getDispatch()->glRotatef(angle, x, y, z);
-}
-
-void glScalef(GLfloat x, GLfloat y, GLfloat z)
-{
- getDispatch()->glScalef(x, y, z);
-}
-
-void glTexEnvf(GLenum target, GLenum pname, GLfloat param)
-{
- getDispatch()->glTexEnvf(target, pname, param);
-}
-
-void glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
-{
- getDispatch()->glTexEnvfv(target, pname, params);
-}
-
-void glTexParameterf(GLenum target, GLenum pname, GLfloat param)
-{
- getDispatch()->glTexParameterf(target, pname, param);
-}
-
-void glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
-{
- getDispatch()->glTexParameterfv(target, pname, params);
-}
-
-void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
-{
- getDispatch()->glTranslatef(x, y, z);
-}
-
-void glActiveTexture(GLenum texture)
-{
- getDispatch()->glActiveTexture(texture);
-}
-
-void glAlphaFuncx(GLenum func, GLclampx ref)
-{
- getDispatch()->glAlphaFuncx(func, ref);
-}
-
-void glBindBuffer(GLenum target, GLuint buffer)
-{
- getDispatch()->glBindBuffer(target, buffer);
-}
-
-void glBindTexture(GLenum target, GLuint texture)
-{
- getDispatch()->glBindTexture(target, texture);
-}
-
-void glBlendFunc(GLenum sfactor, GLenum dfactor)
-{
- getDispatch()->glBlendFunc(sfactor, dfactor);
-}
-
-void glBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
-{
- getDispatch()->glBufferData(target, size, data, usage);
-}
-
-void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
-{
- getDispatch()->glBufferSubData(target, offset, size, data);
-}
-
-void glClear(GLbitfield mask)
-{
- getDispatch()->glClear(mask);
-}
-
-void glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
-{
- getDispatch()->glClearColorx(red, green, blue, alpha);
-}
-
-void glClearDepthx(GLclampx depth)
-{
- getDispatch()->glClearDepthx(depth);
-}
-
-void glClearStencil(GLint s)
-{
- getDispatch()->glClearStencil(s);
-}
-
-void glClientActiveTexture(GLenum texture)
-{
- getDispatch()->glClientActiveTexture(texture);
-}
-
-void glClipPlanex(GLenum plane, const GLfixed *equation)
-{
- getDispatch()->glClipPlanex(plane, equation);
-}
-
-void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
-{
- getDispatch()->glColor4ub(red, green, blue, alpha);
-}
-
-void glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
-{
- getDispatch()->glColor4x(red, green, blue, alpha);
-}
-
-void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-{
- getDispatch()->glColorMask(red, green, blue, alpha);
-}
-
-void glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- getDispatch()->glColorPointer(size, type, stride, pointer);
-}
-
-void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
-{
- getDispatch()->glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
-}
-
-void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
-{
- getDispatch()->glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
-}
-
-void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
- getDispatch()->glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
-}
-
-void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- getDispatch()->glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
-}
-
-void glCullFace(GLenum mode)
-{
- getDispatch()->glCullFace(mode);
-}
-
-void glDeleteBuffers(GLsizei n, const GLuint *buffers)
-{
- getDispatch()->glDeleteBuffers(n, buffers);
-}
-
-void glDeleteTextures(GLsizei n, const GLuint *textures)
-{
- getDispatch()->glDeleteTextures(n, textures);
-}
-
-void glDepthFunc(GLenum func)
-{
- getDispatch()->glDepthFunc(func);
-}
-
-void glDepthMask(GLboolean flag)
-{
- getDispatch()->glDepthMask(flag);
-}
-
-void glDepthRangex(GLclampx zNear, GLclampx zFar)
-{
- getDispatch()->glDepthRangex(zNear, zFar);
-}
-
-void glDisable(GLenum cap)
-{
- getDispatch()->glDisable(cap);
-}
-
-void glDisableClientState(GLenum array)
-{
- getDispatch()->glDisableClientState(array);
-}
-
-void glDrawArrays(GLenum mode, GLint first, GLsizei count)
-{
- getDispatch()->glDrawArrays(mode, first, count);
-}
-
-void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
-{
- getDispatch()->glDrawElements(mode, count, type, indices);
-}
-
-void glEnable(GLenum cap)
-{
- getDispatch()->glEnable(cap);
-}
-
-void glEnableClientState(GLenum array)
-{
- getDispatch()->glEnableClientState(array);
-}
-
-void glFinish()
-{
- getDispatch()->glFinish();
-}
-
-void glFlush()
-{
- getDispatch()->glFlush();
-}
-
-void glFogx(GLenum pname, GLfixed param)
-{
- getDispatch()->glFogx(pname, param);
-}
-
-void glFogxv(GLenum pname, const GLfixed *params)
-{
- getDispatch()->glFogxv(pname, params);
-}
-
-void glFrontFace(GLenum mode)
-{
- getDispatch()->glFrontFace(mode);
-}
-
-void glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
- getDispatch()->glFrustumx(left, right, bottom, top, zNear, zFar);
-}
-
-void glGetBooleanv(GLenum pname, GLboolean *params)
-{
- getDispatch()->glGetBooleanv(pname, params);
-}
-
-void glGetBufferParameteriv(GLenum target, GLenum pname, GLint *params)
-{
- getDispatch()->glGetBufferParameteriv(target, pname, params);
-}
-
-void glGetClipPlanex(GLenum pname, GLfixed eqn[4])
-{
- getDispatch()->glGetClipPlanex(pname, eqn);
-}
-
-void glGenBuffers(GLsizei n, GLuint *buffers)
-{
- getDispatch()->glGenBuffers(n, buffers);
-}
-
-void glGenTextures(GLsizei n, GLuint *textures)
-{
- getDispatch()->glGenTextures(n, textures);
-}
-
-GLenum glGetError()
-{
- return getDispatch()->glGetError();
-}
-
-void glGetFixedv(GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetFixedv(pname, params);
-}
-
-void glGetIntegerv(GLenum pname, GLint *params)
-{
- getDispatch()->glGetIntegerv(pname, params);
-}
-
-void glGetLightxv(GLenum light, GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetLightxv(light, pname, params);
-}
-
-void glGetMaterialxv(GLenum face, GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetMaterialxv(face, pname, params);
-}
-
-void glGetPointerv(GLenum pname, GLvoid **params)
-{
- getDispatch()->glGetPointerv(pname, params);
-}
-
-const GLubyte* glGetString(GLenum name)
-{
- return getDispatch()->glGetString(name);
-}
-
-void glGetTexEnviv(GLenum env, GLenum pname, GLint *params)
-{
- getDispatch()->glGetTexEnviv(env, pname, params);
-}
-
-void glGetTexEnvxv(GLenum env, GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetTexEnvxv(env, pname, params);
-}
-
-void glGetTexParameteriv(GLenum target, GLenum pname, GLint *params)
-{
- getDispatch()->glGetTexParameteriv(target, pname, params);
-}
-
-void glGetTexParameterxv(GLenum target, GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetTexParameterxv(target, pname, params);
-}
-
-void glHint(GLenum target, GLenum mode)
-{
- getDispatch()->glHint(target, mode);
-}
-
-GLboolean glIsBuffer(GLuint buffer)
-{
- return getDispatch()->glIsBuffer(buffer);
-}
-
-GLboolean glIsEnabled(GLenum cap)
-{
- return getDispatch()->glIsEnabled(cap);
-}
-
-GLboolean glIsTexture(GLuint texture)
-{
- return getDispatch()->glIsTexture(texture);
-}
-
-void glLightModelx(GLenum pname, GLfixed param)
-{
- getDispatch()->glLightModelx(pname, param);
-}
-
-void glLightModelxv(GLenum pname, const GLfixed *params)
-{
- getDispatch()->glLightModelxv(pname, params);
-}
-
-void glLightx(GLenum light, GLenum pname, GLfixed param)
-{
- getDispatch()->glLightx(light, pname, param);
-}
-
-void glLightxv(GLenum light, GLenum pname, const GLfixed *params)
-{
- getDispatch()->glLightxv(light, pname, params);
-}
-
-void glLineWidthx(GLfixed width)
-{
- getDispatch()->glLineWidthx(width);
-}
-
-void glLoadIdentity()
-{
- getDispatch()->glLoadIdentity();
-}
-
-void glLoadMatrixx(const GLfixed *m)
-{
- getDispatch()->glLoadMatrixx(m);
-}
-
-void glLogicOp(GLenum opcode)
-{
- getDispatch()->glLogicOp(opcode);
-}
-
-void glMaterialx(GLenum face, GLenum pname, GLfixed param)
-{
- getDispatch()->glMaterialx(face, pname, param);
-}
-
-void glMaterialxv(GLenum face, GLenum pname, const GLfixed *params)
-{
- getDispatch()->glMaterialxv(face, pname, params);
-}
-
-void glMatrixMode(GLenum mode)
-{
- getDispatch()->glMatrixMode(mode);
-}
-
-void glMultMatrixx(const GLfixed *m)
-{
- getDispatch()->glMultMatrixx(m);
-}
-
-void glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-{
- getDispatch()->glMultiTexCoord4x(target, s, t, r, q);
-}
-
-void glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz)
-{
- getDispatch()->glNormal3x(nx, ny, nz);
-}
-
-void glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- getDispatch()->glNormalPointer(type, stride, pointer);
-}
-
-void glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
- getDispatch()->glOrthox(left, right, bottom, top, zNear, zFar);
-}
-
-void glPixelStorei(GLenum pname, GLint param)
-{
- getDispatch()->glPixelStorei(pname, param);
-}
-
-void glPointParameterx(GLenum pname, GLfixed param)
-{
- getDispatch()->glPointParameterx(pname, param);
-}
-
-void glPointParameterxv(GLenum pname, const GLfixed *params)
-{
- getDispatch()->glPointParameterxv(pname, params);
-}
-
-void glPointSizex(GLfixed size)
-{
- getDispatch()->glPointSizex(size);
-}
-
-void glPolygonOffsetx(GLfixed factor, GLfixed units)
-{
- getDispatch()->glPolygonOffsetx(factor, units);
-}
-
-void glPopMatrix()
-{
- getDispatch()->glPopMatrix();
-}
-
-void glPushMatrix()
-{
- getDispatch()->glPushMatrix();
-}
-
-void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
-{
- getDispatch()->glReadPixels(x, y, width, height, format, type, pixels);
-}
-
-void glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
-{
- getDispatch()->glRotatex(angle, x, y, z);
-}
-
-void glSampleCoverage(GLclampf value, GLboolean invert)
-{
- getDispatch()->glSampleCoverage(value, invert);
-}
-
-void glSampleCoveragex(GLclampx value, GLboolean invert)
-{
- getDispatch()->glSampleCoveragex(value, invert);
-}
-
-void glScalex(GLfixed x, GLfixed y, GLfixed z)
-{
- getDispatch()->glScalex(x, y, z);
-}
-
-void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- getDispatch()->glScissor(x, y, width, height);
-}
-
-void glShadeModel(GLenum mode)
-{
- getDispatch()->glShadeModel(mode);
-}
-
-void glStencilFunc(GLenum func, GLint ref, GLuint mask)
-{
- getDispatch()->glStencilFunc(func, ref, mask);
-}
-
-void glStencilMask(GLuint mask)
-{
- getDispatch()->glStencilMask(mask);
-}
-
-void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
-{
- getDispatch()->glStencilOp(fail, zfail, zpass);
-}
-
-void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- getDispatch()->glTexCoordPointer(size, type, stride, pointer);
-}
-
-void glTexEnvi(GLenum target, GLenum pname, GLint param)
-{
- getDispatch()->glTexEnvi(target, pname, param);
-}
-
-void glTexEnvx(GLenum target, GLenum pname, GLfixed param)
-{
- getDispatch()->glTexEnvx(target, pname, param);
-}
-
-void glTexEnviv(GLenum target, GLenum pname, const GLint *params)
-{
- getDispatch()->glTexEnviv(target, pname, params);
-}
-
-void glTexEnvxv(GLenum target, GLenum pname, const GLfixed *params)
-{
- getDispatch()->glTexEnvxv(target, pname, params);
-}
-
-void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
-{
- getDispatch()->glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
-}
-
-void glTexParameteri(GLenum target, GLenum pname, GLint param)
-{
- getDispatch()->glTexParameteri(target, pname, param);
-}
-
-void glTexParameterx(GLenum target, GLenum pname, GLfixed param)
-{
- getDispatch()->glTexParameterx(target, pname, param);
-}
-
-void glTexParameteriv(GLenum target, GLenum pname, const GLint *params)
-{
- getDispatch()->glTexParameteriv(target, pname, params);
-}
-
-void glTexParameterxv(GLenum target, GLenum pname, const GLfixed *params)
-{
- getDispatch()->glTexParameterxv(target, pname, params);
-}
-
-void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
-{
- getDispatch()->glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
-}
-
-void glTranslatex(GLfixed x, GLfixed y, GLfixed z)
-{
- getDispatch()->glTranslatex(x, y, z);
-}
-
-void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- getDispatch()->glVertexPointer(size, type, stride, pointer);
-}
-
-void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- getDispatch()->glViewport(x, y, width, height);
-}
-
-void glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- getDispatch()->glPointSizePointerOES(type, stride, pointer);
-}
-
-void glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha)
-{
- getDispatch()->glBlendEquationSeparateOES(modeRGB, modeAlpha);
-}
-
-void glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-{
- getDispatch()->glBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-
-void glBlendEquationOES(GLenum mode)
-{
- getDispatch()->glBlendEquationOES(mode);
-}
-
-void glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
-{
- getDispatch()->glDrawTexsOES(x, y, z, width, height);
-}
-
-void glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
-{
- getDispatch()->glDrawTexiOES(x, y, z, width, height);
-}
-
-void glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
-{
- getDispatch()->glDrawTexxOES(x, y, z, width, height);
-}
-
-void glDrawTexsvOES(const GLshort *coords)
-{
- getDispatch()->glDrawTexsvOES(coords);
-}
-
-void glDrawTexivOES(const GLint *coords)
-{
- getDispatch()->glDrawTexivOES(coords);
-}
-
-void glDrawTexxvOES(const GLfixed *coords)
-{
- getDispatch()->glDrawTexxvOES(coords);
-}
-
-void glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
-{
- getDispatch()->glDrawTexfOES(x, y, z, width, height);
-}
-
-void glDrawTexfvOES(const GLfloat *coords)
-{
- getDispatch()->glDrawTexfvOES(coords);
-}
-
-void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
-{
- getDispatch()->glEGLImageTargetTexture2DOES(target, image);
-}
-
-void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
-{
- getDispatch()->glEGLImageTargetRenderbufferStorageOES(target, image);
-}
-
-void glAlphaFuncxOES(GLenum func, GLclampx ref)
-{
- getDispatch()->glAlphaFuncxOES(func, ref);
-}
-
-void glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
-{
- getDispatch()->glClearColorxOES(red, green, blue, alpha);
-}
-
-void glClearDepthxOES(GLclampx depth)
-{
- getDispatch()->glClearDepthxOES(depth);
-}
-
-void glClipPlanexOES(GLenum plane, const GLfixed *equation)
-{
- getDispatch()->glClipPlanexOES(plane, equation);
-}
-
-void glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
-{
- getDispatch()->glColor4xOES(red, green, blue, alpha);
-}
-
-void glDepthRangexOES(GLclampx zNear, GLclampx zFar)
-{
- getDispatch()->glDepthRangexOES(zNear, zFar);
-}
-
-void glFogxOES(GLenum pname, GLfixed param)
-{
- getDispatch()->glFogxOES(pname, param);
-}
-
-void glFogxvOES(GLenum pname, const GLfixed *params)
-{
- getDispatch()->glFogxvOES(pname, params);
-}
-
-void glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
- getDispatch()->glFrustumxOES(left, right, bottom, top, zNear, zFar);
-}
-
-void glGetClipPlanexOES(GLenum pname, GLfixed eqn[4])
-{
- getDispatch()->glGetClipPlanexOES(pname, eqn);
-}
-
-void glGetFixedvOES(GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetFixedvOES(pname, params);
-}
-
-void glGetLightxvOES(GLenum light, GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetLightxvOES(light, pname, params);
-}
-
-void glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetMaterialxvOES(face, pname, params);
-}
-
-void glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetTexEnvxvOES(env, pname, params);
-}
-
-void glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetTexParameterxvOES(target, pname, params);
-}
-
-void glLightModelxOES(GLenum pname, GLfixed param)
-{
- getDispatch()->glLightModelxOES(pname, param);
-}
-
-void glLightModelxvOES(GLenum pname, const GLfixed *params)
-{
- getDispatch()->glLightModelxvOES(pname, params);
-}
-
-void glLightxOES(GLenum light, GLenum pname, GLfixed param)
-{
- getDispatch()->glLightxOES(light, pname, param);
-}
-
-void glLightxvOES(GLenum light, GLenum pname, const GLfixed *params)
-{
- getDispatch()->glLightxvOES(light, pname, params);
-}
-
-void glLineWidthxOES(GLfixed width)
-{
- getDispatch()->glLineWidthxOES(width);
-}
-
-void glLoadMatrixxOES(const GLfixed *m)
-{
- getDispatch()->glLoadMatrixxOES(m);
-}
-
-void glMaterialxOES(GLenum face, GLenum pname, GLfixed param)
-{
- getDispatch()->glMaterialxOES(face, pname, param);
-}
-
-void glMaterialxvOES(GLenum face, GLenum pname, const GLfixed *params)
-{
- getDispatch()->glMaterialxvOES(face, pname, params);
-}
-
-void glMultMatrixxOES(const GLfixed *m)
-{
- getDispatch()->glMultMatrixxOES(m);
-}
-
-void glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-{
- getDispatch()->glMultiTexCoord4xOES(target, s, t, r, q);
-}
-
-void glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz)
-{
- getDispatch()->glNormal3xOES(nx, ny, nz);
-}
-
-void glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-{
- getDispatch()->glOrthoxOES(left, right, bottom, top, zNear, zFar);
-}
-
-void glPointParameterxOES(GLenum pname, GLfixed param)
-{
- getDispatch()->glPointParameterxOES(pname, param);
-}
-
-void glPointParameterxvOES(GLenum pname, const GLfixed *params)
-{
- getDispatch()->glPointParameterxvOES(pname, params);
-}
-
-void glPointSizexOES(GLfixed size)
-{
- getDispatch()->glPointSizexOES(size);
-}
-
-void glPolygonOffsetxOES(GLfixed factor, GLfixed units)
-{
- getDispatch()->glPolygonOffsetxOES(factor, units);
-}
-
-void glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
-{
- getDispatch()->glRotatexOES(angle, x, y, z);
-}
-
-void glSampleCoveragexOES(GLclampx value, GLboolean invert)
-{
- getDispatch()->glSampleCoveragexOES(value, invert);
-}
-
-void glScalexOES(GLfixed x, GLfixed y, GLfixed z)
-{
- getDispatch()->glScalexOES(x, y, z);
-}
-
-void glTexEnvxOES(GLenum target, GLenum pname, GLfixed param)
-{
- getDispatch()->glTexEnvxOES(target, pname, param);
-}
-
-void glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed *params)
-{
- getDispatch()->glTexEnvxvOES(target, pname, params);
-}
-
-void glTexParameterxOES(GLenum target, GLenum pname, GLfixed param)
-{
- getDispatch()->glTexParameterxOES(target, pname, param);
-}
-
-void glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed *params)
-{
- getDispatch()->glTexParameterxvOES(target, pname, params);
-}
-
-void glTranslatexOES(GLfixed x, GLfixed y, GLfixed z)
-{
- getDispatch()->glTranslatexOES(x, y, z);
-}
-
-GLboolean glIsRenderbufferOES(GLuint renderbuffer)
-{
- return getDispatch()->glIsRenderbufferOES(renderbuffer);
-}
-
-void glBindRenderbufferOES(GLenum target, GLuint renderbuffer)
-{
- getDispatch()->glBindRenderbufferOES(target, renderbuffer);
-}
-
-void glDeleteRenderbuffersOES(GLsizei n, const GLuint *renderbuffers)
-{
- getDispatch()->glDeleteRenderbuffersOES(n, renderbuffers);
-}
-
-void glGenRenderbuffersOES(GLsizei n, GLuint *renderbuffers)
-{
- getDispatch()->glGenRenderbuffersOES(n, renderbuffers);
-}
-
-void glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
- getDispatch()->glRenderbufferStorageOES(target, internalformat, width, height);
-}
-
-void glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint *params)
-{
- getDispatch()->glGetRenderbufferParameterivOES(target, pname, params);
-}
-
-GLboolean glIsFramebufferOES(GLuint framebuffer)
-{
- return getDispatch()->glIsFramebufferOES(framebuffer);
-}
-
-void glBindFramebufferOES(GLenum target, GLuint framebuffer)
-{
- getDispatch()->glBindFramebufferOES(target, framebuffer);
-}
-
-void glDeleteFramebuffersOES(GLsizei n, const GLuint *framebuffers)
-{
- getDispatch()->glDeleteFramebuffersOES(n, framebuffers);
-}
-
-void glGenFramebuffersOES(GLsizei n, GLuint *framebuffers)
-{
- getDispatch()->glGenFramebuffersOES(n, framebuffers);
-}
-
-GLenum glCheckFramebufferStatusOES(GLenum target)
-{
- return getDispatch()->glCheckFramebufferStatusOES(target);
-}
-
-void glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
- getDispatch()->glFramebufferRenderbufferOES(target, attachment, renderbuffertarget, renderbuffer);
-}
-
-void glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- getDispatch()->glFramebufferTexture2DOES(target, attachment, textarget, texture, level);
-}
-
-void glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint *params)
-{
- getDispatch()->glGetFramebufferAttachmentParameterivOES(target, attachment, pname, params);
-}
-
-void glGenerateMipmapOES(GLenum target)
-{
- getDispatch()->glGenerateMipmapOES(target);
-}
-
-void* glMapBufferOES(GLenum target, GLenum access)
-{
- return getDispatch()->glMapBufferOES(target, access);
-}
-
-GLboolean glUnmapBufferOES(GLenum target)
-{
- return getDispatch()->glUnmapBufferOES(target);
-}
-
-void glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid **ptr)
-{
- getDispatch()->glGetBufferPointervOES(target, pname, ptr);
-}
-
-void glCurrentPaletteMatrixOES(GLuint matrixpaletteindex)
-{
- getDispatch()->glCurrentPaletteMatrixOES(matrixpaletteindex);
-}
-
-void glLoadPaletteFromModelViewMatrixOES()
-{
- getDispatch()->glLoadPaletteFromModelViewMatrixOES();
-}
-
-void glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- getDispatch()->glMatrixIndexPointerOES(size, type, stride, pointer);
-}
-
-void glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- getDispatch()->glWeightPointerOES(size, type, stride, pointer);
-}
-
-GLbitfield glQueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16])
-{
- return getDispatch()->glQueryMatrixxOES(mantissa, exponent);
-}
-
-void glDepthRangefOES(GLclampf zNear, GLclampf zFar)
-{
- getDispatch()->glDepthRangefOES(zNear, zFar);
-}
-
-void glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
- getDispatch()->glFrustumfOES(left, right, bottom, top, zNear, zFar);
-}
-
-void glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-{
- getDispatch()->glOrthofOES(left, right, bottom, top, zNear, zFar);
-}
-
-void glClipPlanefOES(GLenum plane, const GLfloat *equation)
-{
- getDispatch()->glClipPlanefOES(plane, equation);
-}
-
-void glGetClipPlanefOES(GLenum pname, GLfloat eqn[4])
-{
- getDispatch()->glGetClipPlanefOES(pname, eqn);
-}
-
-void glClearDepthfOES(GLclampf depth)
-{
- getDispatch()->glClearDepthfOES(depth);
-}
-
-void glTexGenfOES(GLenum coord, GLenum pname, GLfloat param)
-{
- getDispatch()->glTexGenfOES(coord, pname, param);
-}
-
-void glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat *params)
-{
- getDispatch()->glTexGenfvOES(coord, pname, params);
-}
-
-void glTexGeniOES(GLenum coord, GLenum pname, GLint param)
-{
- getDispatch()->glTexGeniOES(coord, pname, param);
-}
-
-void glTexGenivOES(GLenum coord, GLenum pname, const GLint *params)
-{
- getDispatch()->glTexGenivOES(coord, pname, params);
-}
-
-void glTexGenxOES(GLenum coord, GLenum pname, GLfixed param)
-{
- getDispatch()->glTexGenxOES(coord, pname, param);
-}
-
-void glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params)
-{
- getDispatch()->glTexGenxvOES(coord, pname, params);
-}
-
-void glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params)
-{
- getDispatch()->glGetTexGenfvOES(coord, pname, params);
-}
-
-void glGetTexGenivOES(GLenum coord, GLenum pname, GLint *params)
-{
- getDispatch()->glGetTexGenivOES(coord, pname, params);
-}
-
-void glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params)
-{
- getDispatch()->glGetTexGenxvOES(coord, pname, params);
-}
-
-void glBindVertexArrayOES(GLuint array)
-{
- getDispatch()->glBindVertexArrayOES(array);
-}
-
-void glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays)
-{
- getDispatch()->glDeleteVertexArraysOES(n, arrays);
-}
-
-void glGenVertexArraysOES(GLsizei n, GLuint *arrays)
-{
- getDispatch()->glGenVertexArraysOES(n, arrays);
-}
-
-GLboolean glIsVertexArrayOES(GLuint array)
-{
- return getDispatch()->glIsVertexArrayOES(array);
-}
-
-void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments)
-{
- getDispatch()->glDiscardFramebufferEXT(target, numAttachments, attachments);
-}
-
-void glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount)
-{
- getDispatch()->glMultiDrawArraysEXT(mode, first, count, primcount);
-}
-
-void glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)
-{
- getDispatch()->glMultiDrawElementsEXT(mode, count, type, indices, primcount);
-}
-
-void glClipPlanefIMG(GLenum p, const GLfloat *eqn)
-{
- getDispatch()->glClipPlanefIMG(p, eqn);
-}
-
-void glClipPlanexIMG(GLenum p, const GLfixed *eqn)
-{
- getDispatch()->glClipPlanexIMG(p, eqn);
-}
-
-void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-{
- getDispatch()->glRenderbufferStorageMultisampleIMG(target, samples, internalformat, width, height);
-}
-
-void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
-{
- getDispatch()->glFramebufferTexture2DMultisampleIMG(target, attachment, textarget, texture, level, samples);
-}
-
-void glDeleteFencesNV(GLsizei n, const GLuint *fences)
-{
- getDispatch()->glDeleteFencesNV(n, fences);
-}
-
-void glGenFencesNV(GLsizei n, GLuint *fences)
-{
- getDispatch()->glGenFencesNV(n, fences);
-}
-
-GLboolean glIsFenceNV(GLuint fence)
-{
- return getDispatch()->glIsFenceNV(fence);
-}
-
-GLboolean glTestFenceNV(GLuint fence)
-{
- return getDispatch()->glTestFenceNV(fence);
-}
-
-void glGetFenceivNV(GLuint fence, GLenum pname, GLint *params)
-{
- getDispatch()->glGetFenceivNV(fence, pname, params);
-}
-
-void glFinishFenceNV(GLuint fence)
-{
- getDispatch()->glFinishFenceNV(fence);
-}
-
-void glSetFenceNV(GLuint fence, GLenum condition)
-{
- getDispatch()->glSetFenceNV(fence, condition);
-}
-
-void glGetDriverControlsQCOM(GLint *num, GLsizei size, GLuint *driverControls)
-{
- getDispatch()->glGetDriverControlsQCOM(num, size, driverControls);
-}
-
-void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString)
-{
- getDispatch()->glGetDriverControlStringQCOM(driverControl, bufSize, length, driverControlString);
-}
-
-void glEnableDriverControlQCOM(GLuint driverControl)
-{
- getDispatch()->glEnableDriverControlQCOM(driverControl);
-}
-
-void glDisableDriverControlQCOM(GLuint driverControl)
-{
- getDispatch()->glDisableDriverControlQCOM(driverControl);
-}
-
-void glExtGetTexturesQCOM(GLuint *textures, GLint maxTextures, GLint *numTextures)
-{
- getDispatch()->glExtGetTexturesQCOM(textures, maxTextures, numTextures);
-}
-
-void glExtGetBuffersQCOM(GLuint *buffers, GLint maxBuffers, GLint *numBuffers)
-{
- getDispatch()->glExtGetBuffersQCOM(buffers, maxBuffers, numBuffers);
-}
-
-void glExtGetRenderbuffersQCOM(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers)
-{
- getDispatch()->glExtGetRenderbuffersQCOM(renderbuffers, maxRenderbuffers, numRenderbuffers);
-}
-
-void glExtGetFramebuffersQCOM(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers)
-{
- getDispatch()->glExtGetFramebuffersQCOM(framebuffers, maxFramebuffers, numFramebuffers);
-}
-
-void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params)
-{
- getDispatch()->glExtGetTexLevelParameterivQCOM(texture, face, level, pname, params);
-}
-
-void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param)
-{
- getDispatch()->glExtTexObjectStateOverrideiQCOM(target, pname, param);
-}
-
-void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels)
-{
- getDispatch()->glExtGetTexSubImageQCOM(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
-}
-
-void glExtGetBufferPointervQCOM(GLenum target, GLvoid **params)
-{
- getDispatch()->glExtGetBufferPointervQCOM(target, params);
-}
-
-void glExtGetShadersQCOM(GLuint *shaders, GLint maxShaders, GLint *numShaders)
-{
- getDispatch()->glExtGetShadersQCOM(shaders, maxShaders, numShaders);
-}
-
-void glExtGetProgramsQCOM(GLuint *programs, GLint maxPrograms, GLint *numPrograms)
-{
- getDispatch()->glExtGetProgramsQCOM(programs, maxPrograms, numPrograms);
-}
-
-GLboolean glExtIsProgramBinaryQCOM(GLuint program)
-{
- return getDispatch()->glExtIsProgramBinaryQCOM(program);
-}
-
-void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar *source, GLint *length)
-{
- getDispatch()->glExtGetProgramBinarySourceQCOM(program, shadertype, source, length);
-}
-
-void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
-{
- getDispatch()->glStartTilingQCOM(x, y, width, height, preserveMask);
-}
-
-void glEndTilingQCOM(GLbitfield preserveMask)
-{
- getDispatch()->glEndTilingQCOM(preserveMask);
-}
-
+++ /dev/null
-/*
-* Copyright (C) 2011 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 "gles_dispatch.h"
-#include <stdio.h>
-#include <dlfcn.h>
-
-gles_dispatch *create_gles_dispatch(void *gles_android)
-{
- gles_dispatch *disp = new gles_dispatch;
-
- void *ptr;
- ptr = dlsym(gles_android,"glAlphaFunc"); disp->set_glAlphaFunc((glAlphaFunc_t)ptr);
- ptr = dlsym(gles_android,"glClearColor"); disp->set_glClearColor((glClearColor_t)ptr);
- ptr = dlsym(gles_android,"glClearDepthf"); disp->set_glClearDepthf((glClearDepthf_t)ptr);
- ptr = dlsym(gles_android,"glClipPlanef"); disp->set_glClipPlanef((glClipPlanef_t)ptr);
- ptr = dlsym(gles_android,"glColor4f"); disp->set_glColor4f((glColor4f_t)ptr);
- ptr = dlsym(gles_android,"glDepthRangef"); disp->set_glDepthRangef((glDepthRangef_t)ptr);
- ptr = dlsym(gles_android,"glFogf"); disp->set_glFogf((glFogf_t)ptr);
- ptr = dlsym(gles_android,"glFogfv"); disp->set_glFogfv((glFogfv_t)ptr);
- ptr = dlsym(gles_android,"glFrustumf"); disp->set_glFrustumf((glFrustumf_t)ptr);
- ptr = dlsym(gles_android,"glGetClipPlanef"); disp->set_glGetClipPlanef((glGetClipPlanef_t)ptr);
- ptr = dlsym(gles_android,"glGetFloatv"); disp->set_glGetFloatv((glGetFloatv_t)ptr);
- ptr = dlsym(gles_android,"glGetLightfv"); disp->set_glGetLightfv((glGetLightfv_t)ptr);
- ptr = dlsym(gles_android,"glGetMaterialfv"); disp->set_glGetMaterialfv((glGetMaterialfv_t)ptr);
- ptr = dlsym(gles_android,"glGetTexEnvfv"); disp->set_glGetTexEnvfv((glGetTexEnvfv_t)ptr);
- ptr = dlsym(gles_android,"glGetTexParameterfv"); disp->set_glGetTexParameterfv((glGetTexParameterfv_t)ptr);
- ptr = dlsym(gles_android,"glLightModelf"); disp->set_glLightModelf((glLightModelf_t)ptr);
- ptr = dlsym(gles_android,"glLightModelfv"); disp->set_glLightModelfv((glLightModelfv_t)ptr);
- ptr = dlsym(gles_android,"glLightf"); disp->set_glLightf((glLightf_t)ptr);
- ptr = dlsym(gles_android,"glLightfv"); disp->set_glLightfv((glLightfv_t)ptr);
- ptr = dlsym(gles_android,"glLineWidth"); disp->set_glLineWidth((glLineWidth_t)ptr);
- ptr = dlsym(gles_android,"glLoadMatrixf"); disp->set_glLoadMatrixf((glLoadMatrixf_t)ptr);
- ptr = dlsym(gles_android,"glMaterialf"); disp->set_glMaterialf((glMaterialf_t)ptr);
- ptr = dlsym(gles_android,"glMaterialfv"); disp->set_glMaterialfv((glMaterialfv_t)ptr);
- ptr = dlsym(gles_android,"glMultMatrixf"); disp->set_glMultMatrixf((glMultMatrixf_t)ptr);
- ptr = dlsym(gles_android,"glMultiTexCoord4f"); disp->set_glMultiTexCoord4f((glMultiTexCoord4f_t)ptr);
- ptr = dlsym(gles_android,"glNormal3f"); disp->set_glNormal3f((glNormal3f_t)ptr);
- ptr = dlsym(gles_android,"glOrthof"); disp->set_glOrthof((glOrthof_t)ptr);
- ptr = dlsym(gles_android,"glPointParameterf"); disp->set_glPointParameterf((glPointParameterf_t)ptr);
- ptr = dlsym(gles_android,"glPointParameterfv"); disp->set_glPointParameterfv((glPointParameterfv_t)ptr);
- ptr = dlsym(gles_android,"glPointSize"); disp->set_glPointSize((glPointSize_t)ptr);
- ptr = dlsym(gles_android,"glPolygonOffset"); disp->set_glPolygonOffset((glPolygonOffset_t)ptr);
- ptr = dlsym(gles_android,"glRotatef"); disp->set_glRotatef((glRotatef_t)ptr);
- ptr = dlsym(gles_android,"glScalef"); disp->set_glScalef((glScalef_t)ptr);
- ptr = dlsym(gles_android,"glTexEnvf"); disp->set_glTexEnvf((glTexEnvf_t)ptr);
- ptr = dlsym(gles_android,"glTexEnvfv"); disp->set_glTexEnvfv((glTexEnvfv_t)ptr);
- ptr = dlsym(gles_android,"glTexParameterf"); disp->set_glTexParameterf((glTexParameterf_t)ptr);
- ptr = dlsym(gles_android,"glTexParameterfv"); disp->set_glTexParameterfv((glTexParameterfv_t)ptr);
- ptr = dlsym(gles_android,"glTranslatef"); disp->set_glTranslatef((glTranslatef_t)ptr);
- ptr = dlsym(gles_android,"glActiveTexture"); disp->set_glActiveTexture((glActiveTexture_t)ptr);
- ptr = dlsym(gles_android,"glAlphaFuncx"); disp->set_glAlphaFuncx((glAlphaFuncx_t)ptr);
- ptr = dlsym(gles_android,"glBindBuffer"); disp->set_glBindBuffer((glBindBuffer_t)ptr);
- ptr = dlsym(gles_android,"glBindTexture"); disp->set_glBindTexture((glBindTexture_t)ptr);
- ptr = dlsym(gles_android,"glBlendFunc"); disp->set_glBlendFunc((glBlendFunc_t)ptr);
- ptr = dlsym(gles_android,"glBufferData"); disp->set_glBufferData((glBufferData_t)ptr);
- ptr = dlsym(gles_android,"glBufferSubData"); disp->set_glBufferSubData((glBufferSubData_t)ptr);
- ptr = dlsym(gles_android,"glClear"); disp->set_glClear((glClear_t)ptr);
- ptr = dlsym(gles_android,"glClearColorx"); disp->set_glClearColorx((glClearColorx_t)ptr);
- ptr = dlsym(gles_android,"glClearDepthx"); disp->set_glClearDepthx((glClearDepthx_t)ptr);
- ptr = dlsym(gles_android,"glClearStencil"); disp->set_glClearStencil((glClearStencil_t)ptr);
- ptr = dlsym(gles_android,"glClientActiveTexture"); disp->set_glClientActiveTexture((glClientActiveTexture_t)ptr);
- ptr = dlsym(gles_android,"glClipPlanex"); disp->set_glClipPlanex((glClipPlanex_t)ptr);
- ptr = dlsym(gles_android,"glColor4ub"); disp->set_glColor4ub((glColor4ub_t)ptr);
- ptr = dlsym(gles_android,"glColor4x"); disp->set_glColor4x((glColor4x_t)ptr);
- ptr = dlsym(gles_android,"glColorMask"); disp->set_glColorMask((glColorMask_t)ptr);
- ptr = dlsym(gles_android,"glColorPointer"); disp->set_glColorPointer((glColorPointer_t)ptr);
- ptr = dlsym(gles_android,"glCompressedTexImage2D"); disp->set_glCompressedTexImage2D((glCompressedTexImage2D_t)ptr);
- ptr = dlsym(gles_android,"glCompressedTexSubImage2D"); disp->set_glCompressedTexSubImage2D((glCompressedTexSubImage2D_t)ptr);
- ptr = dlsym(gles_android,"glCopyTexImage2D"); disp->set_glCopyTexImage2D((glCopyTexImage2D_t)ptr);
- ptr = dlsym(gles_android,"glCopyTexSubImage2D"); disp->set_glCopyTexSubImage2D((glCopyTexSubImage2D_t)ptr);
- ptr = dlsym(gles_android,"glCullFace"); disp->set_glCullFace((glCullFace_t)ptr);
- ptr = dlsym(gles_android,"glDeleteBuffers"); disp->set_glDeleteBuffers((glDeleteBuffers_t)ptr);
- ptr = dlsym(gles_android,"glDeleteTextures"); disp->set_glDeleteTextures((glDeleteTextures_t)ptr);
- ptr = dlsym(gles_android,"glDepthFunc"); disp->set_glDepthFunc((glDepthFunc_t)ptr);
- ptr = dlsym(gles_android,"glDepthMask"); disp->set_glDepthMask((glDepthMask_t)ptr);
- ptr = dlsym(gles_android,"glDepthRangex"); disp->set_glDepthRangex((glDepthRangex_t)ptr);
- ptr = dlsym(gles_android,"glDisable"); disp->set_glDisable((glDisable_t)ptr);
- ptr = dlsym(gles_android,"glDisableClientState"); disp->set_glDisableClientState((glDisableClientState_t)ptr);
- ptr = dlsym(gles_android,"glDrawArrays"); disp->set_glDrawArrays((glDrawArrays_t)ptr);
- ptr = dlsym(gles_android,"glDrawElements"); disp->set_glDrawElements((glDrawElements_t)ptr);
- ptr = dlsym(gles_android,"glEnable"); disp->set_glEnable((glEnable_t)ptr);
- ptr = dlsym(gles_android,"glEnableClientState"); disp->set_glEnableClientState((glEnableClientState_t)ptr);
- ptr = dlsym(gles_android,"glFinish"); disp->set_glFinish((glFinish_t)ptr);
- ptr = dlsym(gles_android,"glFlush"); disp->set_glFlush((glFlush_t)ptr);
- ptr = dlsym(gles_android,"glFogx"); disp->set_glFogx((glFogx_t)ptr);
- ptr = dlsym(gles_android,"glFogxv"); disp->set_glFogxv((glFogxv_t)ptr);
- ptr = dlsym(gles_android,"glFrontFace"); disp->set_glFrontFace((glFrontFace_t)ptr);
- ptr = dlsym(gles_android,"glFrustumx"); disp->set_glFrustumx((glFrustumx_t)ptr);
- ptr = dlsym(gles_android,"glGetBooleanv"); disp->set_glGetBooleanv((glGetBooleanv_t)ptr);
- ptr = dlsym(gles_android,"glGetBufferParameteriv"); disp->set_glGetBufferParameteriv((glGetBufferParameteriv_t)ptr);
- ptr = dlsym(gles_android,"glGetClipPlanex"); disp->set_glGetClipPlanex((glGetClipPlanex_t)ptr);
- ptr = dlsym(gles_android,"glGenBuffers"); disp->set_glGenBuffers((glGenBuffers_t)ptr);
- ptr = dlsym(gles_android,"glGenTextures"); disp->set_glGenTextures((glGenTextures_t)ptr);
- ptr = dlsym(gles_android,"glGetError"); disp->set_glGetError((glGetError_t)ptr);
- ptr = dlsym(gles_android,"glGetFixedv"); disp->set_glGetFixedv((glGetFixedv_t)ptr);
- ptr = dlsym(gles_android,"glGetIntegerv"); disp->set_glGetIntegerv((glGetIntegerv_t)ptr);
- ptr = dlsym(gles_android,"glGetLightxv"); disp->set_glGetLightxv((glGetLightxv_t)ptr);
- ptr = dlsym(gles_android,"glGetMaterialxv"); disp->set_glGetMaterialxv((glGetMaterialxv_t)ptr);
- ptr = dlsym(gles_android,"glGetPointerv"); disp->set_glGetPointerv((glGetPointerv_t)ptr);
- ptr = dlsym(gles_android,"glGetString"); disp->set_glGetString((glGetString_t)ptr);
- ptr = dlsym(gles_android,"glGetTexEnviv"); disp->set_glGetTexEnviv((glGetTexEnviv_t)ptr);
- ptr = dlsym(gles_android,"glGetTexEnvxv"); disp->set_glGetTexEnvxv((glGetTexEnvxv_t)ptr);
- ptr = dlsym(gles_android,"glGetTexParameteriv"); disp->set_glGetTexParameteriv((glGetTexParameteriv_t)ptr);
- ptr = dlsym(gles_android,"glGetTexParameterxv"); disp->set_glGetTexParameterxv((glGetTexParameterxv_t)ptr);
- ptr = dlsym(gles_android,"glHint"); disp->set_glHint((glHint_t)ptr);
- ptr = dlsym(gles_android,"glIsBuffer"); disp->set_glIsBuffer((glIsBuffer_t)ptr);
- ptr = dlsym(gles_android,"glIsEnabled"); disp->set_glIsEnabled((glIsEnabled_t)ptr);
- ptr = dlsym(gles_android,"glIsTexture"); disp->set_glIsTexture((glIsTexture_t)ptr);
- ptr = dlsym(gles_android,"glLightModelx"); disp->set_glLightModelx((glLightModelx_t)ptr);
- ptr = dlsym(gles_android,"glLightModelxv"); disp->set_glLightModelxv((glLightModelxv_t)ptr);
- ptr = dlsym(gles_android,"glLightx"); disp->set_glLightx((glLightx_t)ptr);
- ptr = dlsym(gles_android,"glLightxv"); disp->set_glLightxv((glLightxv_t)ptr);
- ptr = dlsym(gles_android,"glLineWidthx"); disp->set_glLineWidthx((glLineWidthx_t)ptr);
- ptr = dlsym(gles_android,"glLoadIdentity"); disp->set_glLoadIdentity((glLoadIdentity_t)ptr);
- ptr = dlsym(gles_android,"glLoadMatrixx"); disp->set_glLoadMatrixx((glLoadMatrixx_t)ptr);
- ptr = dlsym(gles_android,"glLogicOp"); disp->set_glLogicOp((glLogicOp_t)ptr);
- ptr = dlsym(gles_android,"glMaterialx"); disp->set_glMaterialx((glMaterialx_t)ptr);
- ptr = dlsym(gles_android,"glMaterialxv"); disp->set_glMaterialxv((glMaterialxv_t)ptr);
- ptr = dlsym(gles_android,"glMatrixMode"); disp->set_glMatrixMode((glMatrixMode_t)ptr);
- ptr = dlsym(gles_android,"glMultMatrixx"); disp->set_glMultMatrixx((glMultMatrixx_t)ptr);
- ptr = dlsym(gles_android,"glMultiTexCoord4x"); disp->set_glMultiTexCoord4x((glMultiTexCoord4x_t)ptr);
- ptr = dlsym(gles_android,"glNormal3x"); disp->set_glNormal3x((glNormal3x_t)ptr);
- ptr = dlsym(gles_android,"glNormalPointer"); disp->set_glNormalPointer((glNormalPointer_t)ptr);
- ptr = dlsym(gles_android,"glOrthox"); disp->set_glOrthox((glOrthox_t)ptr);
- ptr = dlsym(gles_android,"glPixelStorei"); disp->set_glPixelStorei((glPixelStorei_t)ptr);
- ptr = dlsym(gles_android,"glPointParameterx"); disp->set_glPointParameterx((glPointParameterx_t)ptr);
- ptr = dlsym(gles_android,"glPointParameterxv"); disp->set_glPointParameterxv((glPointParameterxv_t)ptr);
- ptr = dlsym(gles_android,"glPointSizex"); disp->set_glPointSizex((glPointSizex_t)ptr);
- ptr = dlsym(gles_android,"glPolygonOffsetx"); disp->set_glPolygonOffsetx((glPolygonOffsetx_t)ptr);
- ptr = dlsym(gles_android,"glPopMatrix"); disp->set_glPopMatrix((glPopMatrix_t)ptr);
- ptr = dlsym(gles_android,"glPushMatrix"); disp->set_glPushMatrix((glPushMatrix_t)ptr);
- ptr = dlsym(gles_android,"glReadPixels"); disp->set_glReadPixels((glReadPixels_t)ptr);
- ptr = dlsym(gles_android,"glRotatex"); disp->set_glRotatex((glRotatex_t)ptr);
- ptr = dlsym(gles_android,"glSampleCoverage"); disp->set_glSampleCoverage((glSampleCoverage_t)ptr);
- ptr = dlsym(gles_android,"glSampleCoveragex"); disp->set_glSampleCoveragex((glSampleCoveragex_t)ptr);
- ptr = dlsym(gles_android,"glScalex"); disp->set_glScalex((glScalex_t)ptr);
- ptr = dlsym(gles_android,"glScissor"); disp->set_glScissor((glScissor_t)ptr);
- ptr = dlsym(gles_android,"glShadeModel"); disp->set_glShadeModel((glShadeModel_t)ptr);
- ptr = dlsym(gles_android,"glStencilFunc"); disp->set_glStencilFunc((glStencilFunc_t)ptr);
- ptr = dlsym(gles_android,"glStencilMask"); disp->set_glStencilMask((glStencilMask_t)ptr);
- ptr = dlsym(gles_android,"glStencilOp"); disp->set_glStencilOp((glStencilOp_t)ptr);
- ptr = dlsym(gles_android,"glTexCoordPointer"); disp->set_glTexCoordPointer((glTexCoordPointer_t)ptr);
- ptr = dlsym(gles_android,"glTexEnvi"); disp->set_glTexEnvi((glTexEnvi_t)ptr);
- ptr = dlsym(gles_android,"glTexEnvx"); disp->set_glTexEnvx((glTexEnvx_t)ptr);
- ptr = dlsym(gles_android,"glTexEnviv"); disp->set_glTexEnviv((glTexEnviv_t)ptr);
- ptr = dlsym(gles_android,"glTexEnvxv"); disp->set_glTexEnvxv((glTexEnvxv_t)ptr);
- ptr = dlsym(gles_android,"glTexImage2D"); disp->set_glTexImage2D((glTexImage2D_t)ptr);
- ptr = dlsym(gles_android,"glTexParameteri"); disp->set_glTexParameteri((glTexParameteri_t)ptr);
- ptr = dlsym(gles_android,"glTexParameterx"); disp->set_glTexParameterx((glTexParameterx_t)ptr);
- ptr = dlsym(gles_android,"glTexParameteriv"); disp->set_glTexParameteriv((glTexParameteriv_t)ptr);
- ptr = dlsym(gles_android,"glTexParameterxv"); disp->set_glTexParameterxv((glTexParameterxv_t)ptr);
- ptr = dlsym(gles_android,"glTexSubImage2D"); disp->set_glTexSubImage2D((glTexSubImage2D_t)ptr);
- ptr = dlsym(gles_android,"glTranslatex"); disp->set_glTranslatex((glTranslatex_t)ptr);
- ptr = dlsym(gles_android,"glVertexPointer"); disp->set_glVertexPointer((glVertexPointer_t)ptr);
- ptr = dlsym(gles_android,"glViewport"); disp->set_glViewport((glViewport_t)ptr);
- ptr = dlsym(gles_android,"glPointSizePointerOES"); disp->set_glPointSizePointerOES((glPointSizePointerOES_t)ptr);
- ptr = dlsym(gles_android,"glBlendEquationSeparateOES"); disp->set_glBlendEquationSeparateOES((glBlendEquationSeparateOES_t)ptr);
- ptr = dlsym(gles_android,"glBlendFuncSeparateOES"); disp->set_glBlendFuncSeparateOES((glBlendFuncSeparateOES_t)ptr);
- ptr = dlsym(gles_android,"glBlendEquationOES"); disp->set_glBlendEquationOES((glBlendEquationOES_t)ptr);
- ptr = dlsym(gles_android,"glDrawTexsOES"); disp->set_glDrawTexsOES((glDrawTexsOES_t)ptr);
- ptr = dlsym(gles_android,"glDrawTexiOES"); disp->set_glDrawTexiOES((glDrawTexiOES_t)ptr);
- ptr = dlsym(gles_android,"glDrawTexxOES"); disp->set_glDrawTexxOES((glDrawTexxOES_t)ptr);
- ptr = dlsym(gles_android,"glDrawTexsvOES"); disp->set_glDrawTexsvOES((glDrawTexsvOES_t)ptr);
- ptr = dlsym(gles_android,"glDrawTexivOES"); disp->set_glDrawTexivOES((glDrawTexivOES_t)ptr);
- ptr = dlsym(gles_android,"glDrawTexxvOES"); disp->set_glDrawTexxvOES((glDrawTexxvOES_t)ptr);
- ptr = dlsym(gles_android,"glDrawTexfOES"); disp->set_glDrawTexfOES((glDrawTexfOES_t)ptr);
- ptr = dlsym(gles_android,"glDrawTexfvOES"); disp->set_glDrawTexfvOES((glDrawTexfvOES_t)ptr);
- ptr = dlsym(gles_android,"glEGLImageTargetTexture2DOES"); disp->set_glEGLImageTargetTexture2DOES((glEGLImageTargetTexture2DOES_t)ptr);
- ptr = dlsym(gles_android,"glEGLImageTargetRenderbufferStorageOES"); disp->set_glEGLImageTargetRenderbufferStorageOES((glEGLImageTargetRenderbufferStorageOES_t)ptr);
- ptr = dlsym(gles_android,"glAlphaFuncxOES"); disp->set_glAlphaFuncxOES((glAlphaFuncxOES_t)ptr);
- ptr = dlsym(gles_android,"glClearColorxOES"); disp->set_glClearColorxOES((glClearColorxOES_t)ptr);
- ptr = dlsym(gles_android,"glClearDepthxOES"); disp->set_glClearDepthxOES((glClearDepthxOES_t)ptr);
- ptr = dlsym(gles_android,"glClipPlanexOES"); disp->set_glClipPlanexOES((glClipPlanexOES_t)ptr);
- ptr = dlsym(gles_android,"glColor4xOES"); disp->set_glColor4xOES((glColor4xOES_t)ptr);
- ptr = dlsym(gles_android,"glDepthRangexOES"); disp->set_glDepthRangexOES((glDepthRangexOES_t)ptr);
- ptr = dlsym(gles_android,"glFogxOES"); disp->set_glFogxOES((glFogxOES_t)ptr);
- ptr = dlsym(gles_android,"glFogxvOES"); disp->set_glFogxvOES((glFogxvOES_t)ptr);
- ptr = dlsym(gles_android,"glFrustumxOES"); disp->set_glFrustumxOES((glFrustumxOES_t)ptr);
- ptr = dlsym(gles_android,"glGetClipPlanexOES"); disp->set_glGetClipPlanexOES((glGetClipPlanexOES_t)ptr);
- ptr = dlsym(gles_android,"glGetFixedvOES"); disp->set_glGetFixedvOES((glGetFixedvOES_t)ptr);
- ptr = dlsym(gles_android,"glGetLightxvOES"); disp->set_glGetLightxvOES((glGetLightxvOES_t)ptr);
- ptr = dlsym(gles_android,"glGetMaterialxvOES"); disp->set_glGetMaterialxvOES((glGetMaterialxvOES_t)ptr);
- ptr = dlsym(gles_android,"glGetTexEnvxvOES"); disp->set_glGetTexEnvxvOES((glGetTexEnvxvOES_t)ptr);
- ptr = dlsym(gles_android,"glGetTexParameterxvOES"); disp->set_glGetTexParameterxvOES((glGetTexParameterxvOES_t)ptr);
- ptr = dlsym(gles_android,"glLightModelxOES"); disp->set_glLightModelxOES((glLightModelxOES_t)ptr);
- ptr = dlsym(gles_android,"glLightModelxvOES"); disp->set_glLightModelxvOES((glLightModelxvOES_t)ptr);
- ptr = dlsym(gles_android,"glLightxOES"); disp->set_glLightxOES((glLightxOES_t)ptr);
- ptr = dlsym(gles_android,"glLightxvOES"); disp->set_glLightxvOES((glLightxvOES_t)ptr);
- ptr = dlsym(gles_android,"glLineWidthxOES"); disp->set_glLineWidthxOES((glLineWidthxOES_t)ptr);
- ptr = dlsym(gles_android,"glLoadMatrixxOES"); disp->set_glLoadMatrixxOES((glLoadMatrixxOES_t)ptr);
- ptr = dlsym(gles_android,"glMaterialxOES"); disp->set_glMaterialxOES((glMaterialxOES_t)ptr);
- ptr = dlsym(gles_android,"glMaterialxvOES"); disp->set_glMaterialxvOES((glMaterialxvOES_t)ptr);
- ptr = dlsym(gles_android,"glMultMatrixxOES"); disp->set_glMultMatrixxOES((glMultMatrixxOES_t)ptr);
- ptr = dlsym(gles_android,"glMultiTexCoord4xOES"); disp->set_glMultiTexCoord4xOES((glMultiTexCoord4xOES_t)ptr);
- ptr = dlsym(gles_android,"glNormal3xOES"); disp->set_glNormal3xOES((glNormal3xOES_t)ptr);
- ptr = dlsym(gles_android,"glOrthoxOES"); disp->set_glOrthoxOES((glOrthoxOES_t)ptr);
- ptr = dlsym(gles_android,"glPointParameterxOES"); disp->set_glPointParameterxOES((glPointParameterxOES_t)ptr);
- ptr = dlsym(gles_android,"glPointParameterxvOES"); disp->set_glPointParameterxvOES((glPointParameterxvOES_t)ptr);
- ptr = dlsym(gles_android,"glPointSizexOES"); disp->set_glPointSizexOES((glPointSizexOES_t)ptr);
- ptr = dlsym(gles_android,"glPolygonOffsetxOES"); disp->set_glPolygonOffsetxOES((glPolygonOffsetxOES_t)ptr);
- ptr = dlsym(gles_android,"glRotatexOES"); disp->set_glRotatexOES((glRotatexOES_t)ptr);
- ptr = dlsym(gles_android,"glSampleCoveragexOES"); disp->set_glSampleCoveragexOES((glSampleCoveragexOES_t)ptr);
- ptr = dlsym(gles_android,"glScalexOES"); disp->set_glScalexOES((glScalexOES_t)ptr);
- ptr = dlsym(gles_android,"glTexEnvxOES"); disp->set_glTexEnvxOES((glTexEnvxOES_t)ptr);
- ptr = dlsym(gles_android,"glTexEnvxvOES"); disp->set_glTexEnvxvOES((glTexEnvxvOES_t)ptr);
- ptr = dlsym(gles_android,"glTexParameterxOES"); disp->set_glTexParameterxOES((glTexParameterxOES_t)ptr);
- ptr = dlsym(gles_android,"glTexParameterxvOES"); disp->set_glTexParameterxvOES((glTexParameterxvOES_t)ptr);
- ptr = dlsym(gles_android,"glTranslatexOES"); disp->set_glTranslatexOES((glTranslatexOES_t)ptr);
- ptr = dlsym(gles_android,"glIsRenderbufferOES"); disp->set_glIsRenderbufferOES((glIsRenderbufferOES_t)ptr);
- ptr = dlsym(gles_android,"glBindRenderbufferOES"); disp->set_glBindRenderbufferOES((glBindRenderbufferOES_t)ptr);
- ptr = dlsym(gles_android,"glDeleteRenderbuffersOES"); disp->set_glDeleteRenderbuffersOES((glDeleteRenderbuffersOES_t)ptr);
- ptr = dlsym(gles_android,"glGenRenderbuffersOES"); disp->set_glGenRenderbuffersOES((glGenRenderbuffersOES_t)ptr);
- ptr = dlsym(gles_android,"glRenderbufferStorageOES"); disp->set_glRenderbufferStorageOES((glRenderbufferStorageOES_t)ptr);
- ptr = dlsym(gles_android,"glGetRenderbufferParameterivOES"); disp->set_glGetRenderbufferParameterivOES((glGetRenderbufferParameterivOES_t)ptr);
- ptr = dlsym(gles_android,"glIsFramebufferOES"); disp->set_glIsFramebufferOES((glIsFramebufferOES_t)ptr);
- ptr = dlsym(gles_android,"glBindFramebufferOES"); disp->set_glBindFramebufferOES((glBindFramebufferOES_t)ptr);
- ptr = dlsym(gles_android,"glDeleteFramebuffersOES"); disp->set_glDeleteFramebuffersOES((glDeleteFramebuffersOES_t)ptr);
- ptr = dlsym(gles_android,"glGenFramebuffersOES"); disp->set_glGenFramebuffersOES((glGenFramebuffersOES_t)ptr);
- ptr = dlsym(gles_android,"glCheckFramebufferStatusOES"); disp->set_glCheckFramebufferStatusOES((glCheckFramebufferStatusOES_t)ptr);
- ptr = dlsym(gles_android,"glFramebufferRenderbufferOES"); disp->set_glFramebufferRenderbufferOES((glFramebufferRenderbufferOES_t)ptr);
- ptr = dlsym(gles_android,"glFramebufferTexture2DOES"); disp->set_glFramebufferTexture2DOES((glFramebufferTexture2DOES_t)ptr);
- ptr = dlsym(gles_android,"glGetFramebufferAttachmentParameterivOES"); disp->set_glGetFramebufferAttachmentParameterivOES((glGetFramebufferAttachmentParameterivOES_t)ptr);
- ptr = dlsym(gles_android,"glGenerateMipmapOES"); disp->set_glGenerateMipmapOES((glGenerateMipmapOES_t)ptr);
- ptr = dlsym(gles_android,"glMapBufferOES"); disp->set_glMapBufferOES((glMapBufferOES_t)ptr);
- ptr = dlsym(gles_android,"glUnmapBufferOES"); disp->set_glUnmapBufferOES((glUnmapBufferOES_t)ptr);
- ptr = dlsym(gles_android,"glGetBufferPointervOES"); disp->set_glGetBufferPointervOES((glGetBufferPointervOES_t)ptr);
- ptr = dlsym(gles_android,"glCurrentPaletteMatrixOES"); disp->set_glCurrentPaletteMatrixOES((glCurrentPaletteMatrixOES_t)ptr);
- ptr = dlsym(gles_android,"glLoadPaletteFromModelViewMatrixOES"); disp->set_glLoadPaletteFromModelViewMatrixOES((glLoadPaletteFromModelViewMatrixOES_t)ptr);
- ptr = dlsym(gles_android,"glMatrixIndexPointerOES"); disp->set_glMatrixIndexPointerOES((glMatrixIndexPointerOES_t)ptr);
- ptr = dlsym(gles_android,"glWeightPointerOES"); disp->set_glWeightPointerOES((glWeightPointerOES_t)ptr);
- ptr = dlsym(gles_android,"glQueryMatrixxOES"); disp->set_glQueryMatrixxOES((glQueryMatrixxOES_t)ptr);
- ptr = dlsym(gles_android,"glDepthRangefOES"); disp->set_glDepthRangefOES((glDepthRangefOES_t)ptr);
- ptr = dlsym(gles_android,"glFrustumfOES"); disp->set_glFrustumfOES((glFrustumfOES_t)ptr);
- ptr = dlsym(gles_android,"glOrthofOES"); disp->set_glOrthofOES((glOrthofOES_t)ptr);
- ptr = dlsym(gles_android,"glClipPlanefOES"); disp->set_glClipPlanefOES((glClipPlanefOES_t)ptr);
- ptr = dlsym(gles_android,"glGetClipPlanefOES"); disp->set_glGetClipPlanefOES((glGetClipPlanefOES_t)ptr);
- ptr = dlsym(gles_android,"glClearDepthfOES"); disp->set_glClearDepthfOES((glClearDepthfOES_t)ptr);
- ptr = dlsym(gles_android,"glTexGenfOES"); disp->set_glTexGenfOES((glTexGenfOES_t)ptr);
- ptr = dlsym(gles_android,"glTexGenfvOES"); disp->set_glTexGenfvOES((glTexGenfvOES_t)ptr);
- ptr = dlsym(gles_android,"glTexGeniOES"); disp->set_glTexGeniOES((glTexGeniOES_t)ptr);
- ptr = dlsym(gles_android,"glTexGenivOES"); disp->set_glTexGenivOES((glTexGenivOES_t)ptr);
- ptr = dlsym(gles_android,"glTexGenxOES"); disp->set_glTexGenxOES((glTexGenxOES_t)ptr);
- ptr = dlsym(gles_android,"glTexGenxvOES"); disp->set_glTexGenxvOES((glTexGenxvOES_t)ptr);
- ptr = dlsym(gles_android,"glGetTexGenfvOES"); disp->set_glGetTexGenfvOES((glGetTexGenfvOES_t)ptr);
- ptr = dlsym(gles_android,"glGetTexGenivOES"); disp->set_glGetTexGenivOES((glGetTexGenivOES_t)ptr);
- ptr = dlsym(gles_android,"glGetTexGenxvOES"); disp->set_glGetTexGenxvOES((glGetTexGenxvOES_t)ptr);
- ptr = dlsym(gles_android,"glBindVertexArrayOES"); disp->set_glBindVertexArrayOES((glBindVertexArrayOES_t)ptr);
- ptr = dlsym(gles_android,"glDeleteVertexArraysOES"); disp->set_glDeleteVertexArraysOES((glDeleteVertexArraysOES_t)ptr);
- ptr = dlsym(gles_android,"glGenVertexArraysOES"); disp->set_glGenVertexArraysOES((glGenVertexArraysOES_t)ptr);
- ptr = dlsym(gles_android,"glIsVertexArrayOES"); disp->set_glIsVertexArrayOES((glIsVertexArrayOES_t)ptr);
- ptr = dlsym(gles_android,"glDiscardFramebufferEXT"); disp->set_glDiscardFramebufferEXT((glDiscardFramebufferEXT_t)ptr);
- ptr = dlsym(gles_android,"glMultiDrawArraysEXT"); disp->set_glMultiDrawArraysEXT((glMultiDrawArraysEXT_t)ptr);
- ptr = dlsym(gles_android,"glMultiDrawElementsEXT"); disp->set_glMultiDrawElementsEXT((glMultiDrawElementsEXT_t)ptr);
- ptr = dlsym(gles_android,"glClipPlanefIMG"); disp->set_glClipPlanefIMG((glClipPlanefIMG_t)ptr);
- ptr = dlsym(gles_android,"glClipPlanexIMG"); disp->set_glClipPlanexIMG((glClipPlanexIMG_t)ptr);
- ptr = dlsym(gles_android,"glRenderbufferStorageMultisampleIMG"); disp->set_glRenderbufferStorageMultisampleIMG((glRenderbufferStorageMultisampleIMG_t)ptr);
- ptr = dlsym(gles_android,"glFramebufferTexture2DMultisampleIMG"); disp->set_glFramebufferTexture2DMultisampleIMG((glFramebufferTexture2DMultisampleIMG_t)ptr);
- ptr = dlsym(gles_android,"glDeleteFencesNV"); disp->set_glDeleteFencesNV((glDeleteFencesNV_t)ptr);
- ptr = dlsym(gles_android,"glGenFencesNV"); disp->set_glGenFencesNV((glGenFencesNV_t)ptr);
- ptr = dlsym(gles_android,"glIsFenceNV"); disp->set_glIsFenceNV((glIsFenceNV_t)ptr);
- ptr = dlsym(gles_android,"glTestFenceNV"); disp->set_glTestFenceNV((glTestFenceNV_t)ptr);
- ptr = dlsym(gles_android,"glGetFenceivNV"); disp->set_glGetFenceivNV((glGetFenceivNV_t)ptr);
- ptr = dlsym(gles_android,"glFinishFenceNV"); disp->set_glFinishFenceNV((glFinishFenceNV_t)ptr);
- ptr = dlsym(gles_android,"glSetFenceNV"); disp->set_glSetFenceNV((glSetFenceNV_t)ptr);
- ptr = dlsym(gles_android,"glGetDriverControlsQCOM"); disp->set_glGetDriverControlsQCOM((glGetDriverControlsQCOM_t)ptr);
- ptr = dlsym(gles_android,"glGetDriverControlStringQCOM"); disp->set_glGetDriverControlStringQCOM((glGetDriverControlStringQCOM_t)ptr);
- ptr = dlsym(gles_android,"glEnableDriverControlQCOM"); disp->set_glEnableDriverControlQCOM((glEnableDriverControlQCOM_t)ptr);
- ptr = dlsym(gles_android,"glDisableDriverControlQCOM"); disp->set_glDisableDriverControlQCOM((glDisableDriverControlQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtGetTexturesQCOM"); disp->set_glExtGetTexturesQCOM((glExtGetTexturesQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtGetBuffersQCOM"); disp->set_glExtGetBuffersQCOM((glExtGetBuffersQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtGetRenderbuffersQCOM"); disp->set_glExtGetRenderbuffersQCOM((glExtGetRenderbuffersQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtGetFramebuffersQCOM"); disp->set_glExtGetFramebuffersQCOM((glExtGetFramebuffersQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtGetTexLevelParameterivQCOM"); disp->set_glExtGetTexLevelParameterivQCOM((glExtGetTexLevelParameterivQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtTexObjectStateOverrideiQCOM"); disp->set_glExtTexObjectStateOverrideiQCOM((glExtTexObjectStateOverrideiQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtGetTexSubImageQCOM"); disp->set_glExtGetTexSubImageQCOM((glExtGetTexSubImageQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtGetBufferPointervQCOM"); disp->set_glExtGetBufferPointervQCOM((glExtGetBufferPointervQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtGetShadersQCOM"); disp->set_glExtGetShadersQCOM((glExtGetShadersQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtGetProgramsQCOM"); disp->set_glExtGetProgramsQCOM((glExtGetProgramsQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtIsProgramBinaryQCOM"); disp->set_glExtIsProgramBinaryQCOM((glExtIsProgramBinaryQCOM_t)ptr);
- ptr = dlsym(gles_android,"glExtGetProgramBinarySourceQCOM"); disp->set_glExtGetProgramBinarySourceQCOM((glExtGetProgramBinarySourceQCOM_t)ptr);
- ptr = dlsym(gles_android,"glStartTilingQCOM"); disp->set_glStartTilingQCOM((glStartTilingQCOM_t)ptr);
- ptr = dlsym(gles_android,"glEndTilingQCOM"); disp->set_glEndTilingQCOM((glEndTilingQCOM_t)ptr);
-
- return disp;
-}
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _GLES_DISPATCH_H
-#define _GLES_DISPATCH_H
-
-#include "gles_proc.h"
-
-
-struct gles_dispatch {
- glAlphaFunc_t glAlphaFunc;
- glClearColor_t glClearColor;
- glClearDepthf_t glClearDepthf;
- glClipPlanef_t glClipPlanef;
- glColor4f_t glColor4f;
- glDepthRangef_t glDepthRangef;
- glFogf_t glFogf;
- glFogfv_t glFogfv;
- glFrustumf_t glFrustumf;
- glGetClipPlanef_t glGetClipPlanef;
- glGetFloatv_t glGetFloatv;
- glGetLightfv_t glGetLightfv;
- glGetMaterialfv_t glGetMaterialfv;
- glGetTexEnvfv_t glGetTexEnvfv;
- glGetTexParameterfv_t glGetTexParameterfv;
- glLightModelf_t glLightModelf;
- glLightModelfv_t glLightModelfv;
- glLightf_t glLightf;
- glLightfv_t glLightfv;
- glLineWidth_t glLineWidth;
- glLoadMatrixf_t glLoadMatrixf;
- glMaterialf_t glMaterialf;
- glMaterialfv_t glMaterialfv;
- glMultMatrixf_t glMultMatrixf;
- glMultiTexCoord4f_t glMultiTexCoord4f;
- glNormal3f_t glNormal3f;
- glOrthof_t glOrthof;
- glPointParameterf_t glPointParameterf;
- glPointParameterfv_t glPointParameterfv;
- glPointSize_t glPointSize;
- glPolygonOffset_t glPolygonOffset;
- glRotatef_t glRotatef;
- glScalef_t glScalef;
- glTexEnvf_t glTexEnvf;
- glTexEnvfv_t glTexEnvfv;
- glTexParameterf_t glTexParameterf;
- glTexParameterfv_t glTexParameterfv;
- glTranslatef_t glTranslatef;
- glActiveTexture_t glActiveTexture;
- glAlphaFuncx_t glAlphaFuncx;
- glBindBuffer_t glBindBuffer;
- glBindTexture_t glBindTexture;
- glBlendFunc_t glBlendFunc;
- glBufferData_t glBufferData;
- glBufferSubData_t glBufferSubData;
- glClear_t glClear;
- glClearColorx_t glClearColorx;
- glClearDepthx_t glClearDepthx;
- glClearStencil_t glClearStencil;
- glClientActiveTexture_t glClientActiveTexture;
- glClipPlanex_t glClipPlanex;
- glColor4ub_t glColor4ub;
- glColor4x_t glColor4x;
- glColorMask_t glColorMask;
- glColorPointer_t glColorPointer;
- glCompressedTexImage2D_t glCompressedTexImage2D;
- glCompressedTexSubImage2D_t glCompressedTexSubImage2D;
- glCopyTexImage2D_t glCopyTexImage2D;
- glCopyTexSubImage2D_t glCopyTexSubImage2D;
- glCullFace_t glCullFace;
- glDeleteBuffers_t glDeleteBuffers;
- glDeleteTextures_t glDeleteTextures;
- glDepthFunc_t glDepthFunc;
- glDepthMask_t glDepthMask;
- glDepthRangex_t glDepthRangex;
- glDisable_t glDisable;
- glDisableClientState_t glDisableClientState;
- glDrawArrays_t glDrawArrays;
- glDrawElements_t glDrawElements;
- glEnable_t glEnable;
- glEnableClientState_t glEnableClientState;
- glFinish_t glFinish;
- glFlush_t glFlush;
- glFogx_t glFogx;
- glFogxv_t glFogxv;
- glFrontFace_t glFrontFace;
- glFrustumx_t glFrustumx;
- glGetBooleanv_t glGetBooleanv;
- glGetBufferParameteriv_t glGetBufferParameteriv;
- glGetClipPlanex_t glGetClipPlanex;
- glGenBuffers_t glGenBuffers;
- glGenTextures_t glGenTextures;
- glGetError_t glGetError;
- glGetFixedv_t glGetFixedv;
- glGetIntegerv_t glGetIntegerv;
- glGetLightxv_t glGetLightxv;
- glGetMaterialxv_t glGetMaterialxv;
- glGetPointerv_t glGetPointerv;
- glGetString_t glGetString;
- glGetTexEnviv_t glGetTexEnviv;
- glGetTexEnvxv_t glGetTexEnvxv;
- glGetTexParameteriv_t glGetTexParameteriv;
- glGetTexParameterxv_t glGetTexParameterxv;
- glHint_t glHint;
- glIsBuffer_t glIsBuffer;
- glIsEnabled_t glIsEnabled;
- glIsTexture_t glIsTexture;
- glLightModelx_t glLightModelx;
- glLightModelxv_t glLightModelxv;
- glLightx_t glLightx;
- glLightxv_t glLightxv;
- glLineWidthx_t glLineWidthx;
- glLoadIdentity_t glLoadIdentity;
- glLoadMatrixx_t glLoadMatrixx;
- glLogicOp_t glLogicOp;
- glMaterialx_t glMaterialx;
- glMaterialxv_t glMaterialxv;
- glMatrixMode_t glMatrixMode;
- glMultMatrixx_t glMultMatrixx;
- glMultiTexCoord4x_t glMultiTexCoord4x;
- glNormal3x_t glNormal3x;
- glNormalPointer_t glNormalPointer;
- glOrthox_t glOrthox;
- glPixelStorei_t glPixelStorei;
- glPointParameterx_t glPointParameterx;
- glPointParameterxv_t glPointParameterxv;
- glPointSizex_t glPointSizex;
- glPolygonOffsetx_t glPolygonOffsetx;
- glPopMatrix_t glPopMatrix;
- glPushMatrix_t glPushMatrix;
- glReadPixels_t glReadPixels;
- glRotatex_t glRotatex;
- glSampleCoverage_t glSampleCoverage;
- glSampleCoveragex_t glSampleCoveragex;
- glScalex_t glScalex;
- glScissor_t glScissor;
- glShadeModel_t glShadeModel;
- glStencilFunc_t glStencilFunc;
- glStencilMask_t glStencilMask;
- glStencilOp_t glStencilOp;
- glTexCoordPointer_t glTexCoordPointer;
- glTexEnvi_t glTexEnvi;
- glTexEnvx_t glTexEnvx;
- glTexEnviv_t glTexEnviv;
- glTexEnvxv_t glTexEnvxv;
- glTexImage2D_t glTexImage2D;
- glTexParameteri_t glTexParameteri;
- glTexParameterx_t glTexParameterx;
- glTexParameteriv_t glTexParameteriv;
- glTexParameterxv_t glTexParameterxv;
- glTexSubImage2D_t glTexSubImage2D;
- glTranslatex_t glTranslatex;
- glVertexPointer_t glVertexPointer;
- glViewport_t glViewport;
- glPointSizePointerOES_t glPointSizePointerOES;
- glBlendEquationSeparateOES_t glBlendEquationSeparateOES;
- glBlendFuncSeparateOES_t glBlendFuncSeparateOES;
- glBlendEquationOES_t glBlendEquationOES;
- glDrawTexsOES_t glDrawTexsOES;
- glDrawTexiOES_t glDrawTexiOES;
- glDrawTexxOES_t glDrawTexxOES;
- glDrawTexsvOES_t glDrawTexsvOES;
- glDrawTexivOES_t glDrawTexivOES;
- glDrawTexxvOES_t glDrawTexxvOES;
- glDrawTexfOES_t glDrawTexfOES;
- glDrawTexfvOES_t glDrawTexfvOES;
- glEGLImageTargetTexture2DOES_t glEGLImageTargetTexture2DOES;
- glEGLImageTargetRenderbufferStorageOES_t glEGLImageTargetRenderbufferStorageOES;
- glAlphaFuncxOES_t glAlphaFuncxOES;
- glClearColorxOES_t glClearColorxOES;
- glClearDepthxOES_t glClearDepthxOES;
- glClipPlanexOES_t glClipPlanexOES;
- glColor4xOES_t glColor4xOES;
- glDepthRangexOES_t glDepthRangexOES;
- glFogxOES_t glFogxOES;
- glFogxvOES_t glFogxvOES;
- glFrustumxOES_t glFrustumxOES;
- glGetClipPlanexOES_t glGetClipPlanexOES;
- glGetFixedvOES_t glGetFixedvOES;
- glGetLightxvOES_t glGetLightxvOES;
- glGetMaterialxvOES_t glGetMaterialxvOES;
- glGetTexEnvxvOES_t glGetTexEnvxvOES;
- glGetTexParameterxvOES_t glGetTexParameterxvOES;
- glLightModelxOES_t glLightModelxOES;
- glLightModelxvOES_t glLightModelxvOES;
- glLightxOES_t glLightxOES;
- glLightxvOES_t glLightxvOES;
- glLineWidthxOES_t glLineWidthxOES;
- glLoadMatrixxOES_t glLoadMatrixxOES;
- glMaterialxOES_t glMaterialxOES;
- glMaterialxvOES_t glMaterialxvOES;
- glMultMatrixxOES_t glMultMatrixxOES;
- glMultiTexCoord4xOES_t glMultiTexCoord4xOES;
- glNormal3xOES_t glNormal3xOES;
- glOrthoxOES_t glOrthoxOES;
- glPointParameterxOES_t glPointParameterxOES;
- glPointParameterxvOES_t glPointParameterxvOES;
- glPointSizexOES_t glPointSizexOES;
- glPolygonOffsetxOES_t glPolygonOffsetxOES;
- glRotatexOES_t glRotatexOES;
- glSampleCoveragexOES_t glSampleCoveragexOES;
- glScalexOES_t glScalexOES;
- glTexEnvxOES_t glTexEnvxOES;
- glTexEnvxvOES_t glTexEnvxvOES;
- glTexParameterxOES_t glTexParameterxOES;
- glTexParameterxvOES_t glTexParameterxvOES;
- glTranslatexOES_t glTranslatexOES;
- glIsRenderbufferOES_t glIsRenderbufferOES;
- glBindRenderbufferOES_t glBindRenderbufferOES;
- glDeleteRenderbuffersOES_t glDeleteRenderbuffersOES;
- glGenRenderbuffersOES_t glGenRenderbuffersOES;
- glRenderbufferStorageOES_t glRenderbufferStorageOES;
- glGetRenderbufferParameterivOES_t glGetRenderbufferParameterivOES;
- glIsFramebufferOES_t glIsFramebufferOES;
- glBindFramebufferOES_t glBindFramebufferOES;
- glDeleteFramebuffersOES_t glDeleteFramebuffersOES;
- glGenFramebuffersOES_t glGenFramebuffersOES;
- glCheckFramebufferStatusOES_t glCheckFramebufferStatusOES;
- glFramebufferRenderbufferOES_t glFramebufferRenderbufferOES;
- glFramebufferTexture2DOES_t glFramebufferTexture2DOES;
- glGetFramebufferAttachmentParameterivOES_t glGetFramebufferAttachmentParameterivOES;
- glGenerateMipmapOES_t glGenerateMipmapOES;
- glMapBufferOES_t glMapBufferOES;
- glUnmapBufferOES_t glUnmapBufferOES;
- glGetBufferPointervOES_t glGetBufferPointervOES;
- glCurrentPaletteMatrixOES_t glCurrentPaletteMatrixOES;
- glLoadPaletteFromModelViewMatrixOES_t glLoadPaletteFromModelViewMatrixOES;
- glMatrixIndexPointerOES_t glMatrixIndexPointerOES;
- glWeightPointerOES_t glWeightPointerOES;
- glQueryMatrixxOES_t glQueryMatrixxOES;
- glDepthRangefOES_t glDepthRangefOES;
- glFrustumfOES_t glFrustumfOES;
- glOrthofOES_t glOrthofOES;
- glClipPlanefOES_t glClipPlanefOES;
- glGetClipPlanefOES_t glGetClipPlanefOES;
- glClearDepthfOES_t glClearDepthfOES;
- glTexGenfOES_t glTexGenfOES;
- glTexGenfvOES_t glTexGenfvOES;
- glTexGeniOES_t glTexGeniOES;
- glTexGenivOES_t glTexGenivOES;
- glTexGenxOES_t glTexGenxOES;
- glTexGenxvOES_t glTexGenxvOES;
- glGetTexGenfvOES_t glGetTexGenfvOES;
- glGetTexGenivOES_t glGetTexGenivOES;
- glGetTexGenxvOES_t glGetTexGenxvOES;
- glBindVertexArrayOES_t glBindVertexArrayOES;
- glDeleteVertexArraysOES_t glDeleteVertexArraysOES;
- glGenVertexArraysOES_t glGenVertexArraysOES;
- glIsVertexArrayOES_t glIsVertexArrayOES;
- glDiscardFramebufferEXT_t glDiscardFramebufferEXT;
- glMultiDrawArraysEXT_t glMultiDrawArraysEXT;
- glMultiDrawElementsEXT_t glMultiDrawElementsEXT;
- glClipPlanefIMG_t glClipPlanefIMG;
- glClipPlanexIMG_t glClipPlanexIMG;
- glRenderbufferStorageMultisampleIMG_t glRenderbufferStorageMultisampleIMG;
- glFramebufferTexture2DMultisampleIMG_t glFramebufferTexture2DMultisampleIMG;
- glDeleteFencesNV_t glDeleteFencesNV;
- glGenFencesNV_t glGenFencesNV;
- glIsFenceNV_t glIsFenceNV;
- glTestFenceNV_t glTestFenceNV;
- glGetFenceivNV_t glGetFenceivNV;
- glFinishFenceNV_t glFinishFenceNV;
- glSetFenceNV_t glSetFenceNV;
- glGetDriverControlsQCOM_t glGetDriverControlsQCOM;
- glGetDriverControlStringQCOM_t glGetDriverControlStringQCOM;
- glEnableDriverControlQCOM_t glEnableDriverControlQCOM;
- glDisableDriverControlQCOM_t glDisableDriverControlQCOM;
- glExtGetTexturesQCOM_t glExtGetTexturesQCOM;
- glExtGetBuffersQCOM_t glExtGetBuffersQCOM;
- glExtGetRenderbuffersQCOM_t glExtGetRenderbuffersQCOM;
- glExtGetFramebuffersQCOM_t glExtGetFramebuffersQCOM;
- glExtGetTexLevelParameterivQCOM_t glExtGetTexLevelParameterivQCOM;
- glExtTexObjectStateOverrideiQCOM_t glExtTexObjectStateOverrideiQCOM;
- glExtGetTexSubImageQCOM_t glExtGetTexSubImageQCOM;
- glExtGetBufferPointervQCOM_t glExtGetBufferPointervQCOM;
- glExtGetShadersQCOM_t glExtGetShadersQCOM;
- glExtGetProgramsQCOM_t glExtGetProgramsQCOM;
- glExtIsProgramBinaryQCOM_t glExtIsProgramBinaryQCOM;
- glExtGetProgramBinarySourceQCOM_t glExtGetProgramBinarySourceQCOM;
- glStartTilingQCOM_t glStartTilingQCOM;
- glEndTilingQCOM_t glEndTilingQCOM;
- //Accessors
- glAlphaFunc_t set_glAlphaFunc(glAlphaFunc_t f) { glAlphaFunc_t retval = glAlphaFunc; glAlphaFunc = f; return retval;}
- glClearColor_t set_glClearColor(glClearColor_t f) { glClearColor_t retval = glClearColor; glClearColor = f; return retval;}
- glClearDepthf_t set_glClearDepthf(glClearDepthf_t f) { glClearDepthf_t retval = glClearDepthf; glClearDepthf = f; return retval;}
- glClipPlanef_t set_glClipPlanef(glClipPlanef_t f) { glClipPlanef_t retval = glClipPlanef; glClipPlanef = f; return retval;}
- glColor4f_t set_glColor4f(glColor4f_t f) { glColor4f_t retval = glColor4f; glColor4f = f; return retval;}
- glDepthRangef_t set_glDepthRangef(glDepthRangef_t f) { glDepthRangef_t retval = glDepthRangef; glDepthRangef = f; return retval;}
- glFogf_t set_glFogf(glFogf_t f) { glFogf_t retval = glFogf; glFogf = f; return retval;}
- glFogfv_t set_glFogfv(glFogfv_t f) { glFogfv_t retval = glFogfv; glFogfv = f; return retval;}
- glFrustumf_t set_glFrustumf(glFrustumf_t f) { glFrustumf_t retval = glFrustumf; glFrustumf = f; return retval;}
- glGetClipPlanef_t set_glGetClipPlanef(glGetClipPlanef_t f) { glGetClipPlanef_t retval = glGetClipPlanef; glGetClipPlanef = f; return retval;}
- glGetFloatv_t set_glGetFloatv(glGetFloatv_t f) { glGetFloatv_t retval = glGetFloatv; glGetFloatv = f; return retval;}
- glGetLightfv_t set_glGetLightfv(glGetLightfv_t f) { glGetLightfv_t retval = glGetLightfv; glGetLightfv = f; return retval;}
- glGetMaterialfv_t set_glGetMaterialfv(glGetMaterialfv_t f) { glGetMaterialfv_t retval = glGetMaterialfv; glGetMaterialfv = f; return retval;}
- glGetTexEnvfv_t set_glGetTexEnvfv(glGetTexEnvfv_t f) { glGetTexEnvfv_t retval = glGetTexEnvfv; glGetTexEnvfv = f; return retval;}
- glGetTexParameterfv_t set_glGetTexParameterfv(glGetTexParameterfv_t f) { glGetTexParameterfv_t retval = glGetTexParameterfv; glGetTexParameterfv = f; return retval;}
- glLightModelf_t set_glLightModelf(glLightModelf_t f) { glLightModelf_t retval = glLightModelf; glLightModelf = f; return retval;}
- glLightModelfv_t set_glLightModelfv(glLightModelfv_t f) { glLightModelfv_t retval = glLightModelfv; glLightModelfv = f; return retval;}
- glLightf_t set_glLightf(glLightf_t f) { glLightf_t retval = glLightf; glLightf = f; return retval;}
- glLightfv_t set_glLightfv(glLightfv_t f) { glLightfv_t retval = glLightfv; glLightfv = f; return retval;}
- glLineWidth_t set_glLineWidth(glLineWidth_t f) { glLineWidth_t retval = glLineWidth; glLineWidth = f; return retval;}
- glLoadMatrixf_t set_glLoadMatrixf(glLoadMatrixf_t f) { glLoadMatrixf_t retval = glLoadMatrixf; glLoadMatrixf = f; return retval;}
- glMaterialf_t set_glMaterialf(glMaterialf_t f) { glMaterialf_t retval = glMaterialf; glMaterialf = f; return retval;}
- glMaterialfv_t set_glMaterialfv(glMaterialfv_t f) { glMaterialfv_t retval = glMaterialfv; glMaterialfv = f; return retval;}
- glMultMatrixf_t set_glMultMatrixf(glMultMatrixf_t f) { glMultMatrixf_t retval = glMultMatrixf; glMultMatrixf = f; return retval;}
- glMultiTexCoord4f_t set_glMultiTexCoord4f(glMultiTexCoord4f_t f) { glMultiTexCoord4f_t retval = glMultiTexCoord4f; glMultiTexCoord4f = f; return retval;}
- glNormal3f_t set_glNormal3f(glNormal3f_t f) { glNormal3f_t retval = glNormal3f; glNormal3f = f; return retval;}
- glOrthof_t set_glOrthof(glOrthof_t f) { glOrthof_t retval = glOrthof; glOrthof = f; return retval;}
- glPointParameterf_t set_glPointParameterf(glPointParameterf_t f) { glPointParameterf_t retval = glPointParameterf; glPointParameterf = f; return retval;}
- glPointParameterfv_t set_glPointParameterfv(glPointParameterfv_t f) { glPointParameterfv_t retval = glPointParameterfv; glPointParameterfv = f; return retval;}
- glPointSize_t set_glPointSize(glPointSize_t f) { glPointSize_t retval = glPointSize; glPointSize = f; return retval;}
- glPolygonOffset_t set_glPolygonOffset(glPolygonOffset_t f) { glPolygonOffset_t retval = glPolygonOffset; glPolygonOffset = f; return retval;}
- glRotatef_t set_glRotatef(glRotatef_t f) { glRotatef_t retval = glRotatef; glRotatef = f; return retval;}
- glScalef_t set_glScalef(glScalef_t f) { glScalef_t retval = glScalef; glScalef = f; return retval;}
- glTexEnvf_t set_glTexEnvf(glTexEnvf_t f) { glTexEnvf_t retval = glTexEnvf; glTexEnvf = f; return retval;}
- glTexEnvfv_t set_glTexEnvfv(glTexEnvfv_t f) { glTexEnvfv_t retval = glTexEnvfv; glTexEnvfv = f; return retval;}
- glTexParameterf_t set_glTexParameterf(glTexParameterf_t f) { glTexParameterf_t retval = glTexParameterf; glTexParameterf = f; return retval;}
- glTexParameterfv_t set_glTexParameterfv(glTexParameterfv_t f) { glTexParameterfv_t retval = glTexParameterfv; glTexParameterfv = f; return retval;}
- glTranslatef_t set_glTranslatef(glTranslatef_t f) { glTranslatef_t retval = glTranslatef; glTranslatef = f; return retval;}
- glActiveTexture_t set_glActiveTexture(glActiveTexture_t f) { glActiveTexture_t retval = glActiveTexture; glActiveTexture = f; return retval;}
- glAlphaFuncx_t set_glAlphaFuncx(glAlphaFuncx_t f) { glAlphaFuncx_t retval = glAlphaFuncx; glAlphaFuncx = f; return retval;}
- glBindBuffer_t set_glBindBuffer(glBindBuffer_t f) { glBindBuffer_t retval = glBindBuffer; glBindBuffer = f; return retval;}
- glBindTexture_t set_glBindTexture(glBindTexture_t f) { glBindTexture_t retval = glBindTexture; glBindTexture = f; return retval;}
- glBlendFunc_t set_glBlendFunc(glBlendFunc_t f) { glBlendFunc_t retval = glBlendFunc; glBlendFunc = f; return retval;}
- glBufferData_t set_glBufferData(glBufferData_t f) { glBufferData_t retval = glBufferData; glBufferData = f; return retval;}
- glBufferSubData_t set_glBufferSubData(glBufferSubData_t f) { glBufferSubData_t retval = glBufferSubData; glBufferSubData = f; return retval;}
- glClear_t set_glClear(glClear_t f) { glClear_t retval = glClear; glClear = f; return retval;}
- glClearColorx_t set_glClearColorx(glClearColorx_t f) { glClearColorx_t retval = glClearColorx; glClearColorx = f; return retval;}
- glClearDepthx_t set_glClearDepthx(glClearDepthx_t f) { glClearDepthx_t retval = glClearDepthx; glClearDepthx = f; return retval;}
- glClearStencil_t set_glClearStencil(glClearStencil_t f) { glClearStencil_t retval = glClearStencil; glClearStencil = f; return retval;}
- glClientActiveTexture_t set_glClientActiveTexture(glClientActiveTexture_t f) { glClientActiveTexture_t retval = glClientActiveTexture; glClientActiveTexture = f; return retval;}
- glClipPlanex_t set_glClipPlanex(glClipPlanex_t f) { glClipPlanex_t retval = glClipPlanex; glClipPlanex = f; return retval;}
- glColor4ub_t set_glColor4ub(glColor4ub_t f) { glColor4ub_t retval = glColor4ub; glColor4ub = f; return retval;}
- glColor4x_t set_glColor4x(glColor4x_t f) { glColor4x_t retval = glColor4x; glColor4x = f; return retval;}
- glColorMask_t set_glColorMask(glColorMask_t f) { glColorMask_t retval = glColorMask; glColorMask = f; return retval;}
- glColorPointer_t set_glColorPointer(glColorPointer_t f) { glColorPointer_t retval = glColorPointer; glColorPointer = f; return retval;}
- glCompressedTexImage2D_t set_glCompressedTexImage2D(glCompressedTexImage2D_t f) { glCompressedTexImage2D_t retval = glCompressedTexImage2D; glCompressedTexImage2D = f; return retval;}
- glCompressedTexSubImage2D_t set_glCompressedTexSubImage2D(glCompressedTexSubImage2D_t f) { glCompressedTexSubImage2D_t retval = glCompressedTexSubImage2D; glCompressedTexSubImage2D = f; return retval;}
- glCopyTexImage2D_t set_glCopyTexImage2D(glCopyTexImage2D_t f) { glCopyTexImage2D_t retval = glCopyTexImage2D; glCopyTexImage2D = f; return retval;}
- glCopyTexSubImage2D_t set_glCopyTexSubImage2D(glCopyTexSubImage2D_t f) { glCopyTexSubImage2D_t retval = glCopyTexSubImage2D; glCopyTexSubImage2D = f; return retval;}
- glCullFace_t set_glCullFace(glCullFace_t f) { glCullFace_t retval = glCullFace; glCullFace = f; return retval;}
- glDeleteBuffers_t set_glDeleteBuffers(glDeleteBuffers_t f) { glDeleteBuffers_t retval = glDeleteBuffers; glDeleteBuffers = f; return retval;}
- glDeleteTextures_t set_glDeleteTextures(glDeleteTextures_t f) { glDeleteTextures_t retval = glDeleteTextures; glDeleteTextures = f; return retval;}
- glDepthFunc_t set_glDepthFunc(glDepthFunc_t f) { glDepthFunc_t retval = glDepthFunc; glDepthFunc = f; return retval;}
- glDepthMask_t set_glDepthMask(glDepthMask_t f) { glDepthMask_t retval = glDepthMask; glDepthMask = f; return retval;}
- glDepthRangex_t set_glDepthRangex(glDepthRangex_t f) { glDepthRangex_t retval = glDepthRangex; glDepthRangex = f; return retval;}
- glDisable_t set_glDisable(glDisable_t f) { glDisable_t retval = glDisable; glDisable = f; return retval;}
- glDisableClientState_t set_glDisableClientState(glDisableClientState_t f) { glDisableClientState_t retval = glDisableClientState; glDisableClientState = f; return retval;}
- glDrawArrays_t set_glDrawArrays(glDrawArrays_t f) { glDrawArrays_t retval = glDrawArrays; glDrawArrays = f; return retval;}
- glDrawElements_t set_glDrawElements(glDrawElements_t f) { glDrawElements_t retval = glDrawElements; glDrawElements = f; return retval;}
- glEnable_t set_glEnable(glEnable_t f) { glEnable_t retval = glEnable; glEnable = f; return retval;}
- glEnableClientState_t set_glEnableClientState(glEnableClientState_t f) { glEnableClientState_t retval = glEnableClientState; glEnableClientState = f; return retval;}
- glFinish_t set_glFinish(glFinish_t f) { glFinish_t retval = glFinish; glFinish = f; return retval;}
- glFlush_t set_glFlush(glFlush_t f) { glFlush_t retval = glFlush; glFlush = f; return retval;}
- glFogx_t set_glFogx(glFogx_t f) { glFogx_t retval = glFogx; glFogx = f; return retval;}
- glFogxv_t set_glFogxv(glFogxv_t f) { glFogxv_t retval = glFogxv; glFogxv = f; return retval;}
- glFrontFace_t set_glFrontFace(glFrontFace_t f) { glFrontFace_t retval = glFrontFace; glFrontFace = f; return retval;}
- glFrustumx_t set_glFrustumx(glFrustumx_t f) { glFrustumx_t retval = glFrustumx; glFrustumx = f; return retval;}
- glGetBooleanv_t set_glGetBooleanv(glGetBooleanv_t f) { glGetBooleanv_t retval = glGetBooleanv; glGetBooleanv = f; return retval;}
- glGetBufferParameteriv_t set_glGetBufferParameteriv(glGetBufferParameteriv_t f) { glGetBufferParameteriv_t retval = glGetBufferParameteriv; glGetBufferParameteriv = f; return retval;}
- glGetClipPlanex_t set_glGetClipPlanex(glGetClipPlanex_t f) { glGetClipPlanex_t retval = glGetClipPlanex; glGetClipPlanex = f; return retval;}
- glGenBuffers_t set_glGenBuffers(glGenBuffers_t f) { glGenBuffers_t retval = glGenBuffers; glGenBuffers = f; return retval;}
- glGenTextures_t set_glGenTextures(glGenTextures_t f) { glGenTextures_t retval = glGenTextures; glGenTextures = f; return retval;}
- glGetError_t set_glGetError(glGetError_t f) { glGetError_t retval = glGetError; glGetError = f; return retval;}
- glGetFixedv_t set_glGetFixedv(glGetFixedv_t f) { glGetFixedv_t retval = glGetFixedv; glGetFixedv = f; return retval;}
- glGetIntegerv_t set_glGetIntegerv(glGetIntegerv_t f) { glGetIntegerv_t retval = glGetIntegerv; glGetIntegerv = f; return retval;}
- glGetLightxv_t set_glGetLightxv(glGetLightxv_t f) { glGetLightxv_t retval = glGetLightxv; glGetLightxv = f; return retval;}
- glGetMaterialxv_t set_glGetMaterialxv(glGetMaterialxv_t f) { glGetMaterialxv_t retval = glGetMaterialxv; glGetMaterialxv = f; return retval;}
- glGetPointerv_t set_glGetPointerv(glGetPointerv_t f) { glGetPointerv_t retval = glGetPointerv; glGetPointerv = f; return retval;}
- glGetString_t set_glGetString(glGetString_t f) { glGetString_t retval = glGetString; glGetString = f; return retval;}
- glGetTexEnviv_t set_glGetTexEnviv(glGetTexEnviv_t f) { glGetTexEnviv_t retval = glGetTexEnviv; glGetTexEnviv = f; return retval;}
- glGetTexEnvxv_t set_glGetTexEnvxv(glGetTexEnvxv_t f) { glGetTexEnvxv_t retval = glGetTexEnvxv; glGetTexEnvxv = f; return retval;}
- glGetTexParameteriv_t set_glGetTexParameteriv(glGetTexParameteriv_t f) { glGetTexParameteriv_t retval = glGetTexParameteriv; glGetTexParameteriv = f; return retval;}
- glGetTexParameterxv_t set_glGetTexParameterxv(glGetTexParameterxv_t f) { glGetTexParameterxv_t retval = glGetTexParameterxv; glGetTexParameterxv = f; return retval;}
- glHint_t set_glHint(glHint_t f) { glHint_t retval = glHint; glHint = f; return retval;}
- glIsBuffer_t set_glIsBuffer(glIsBuffer_t f) { glIsBuffer_t retval = glIsBuffer; glIsBuffer = f; return retval;}
- glIsEnabled_t set_glIsEnabled(glIsEnabled_t f) { glIsEnabled_t retval = glIsEnabled; glIsEnabled = f; return retval;}
- glIsTexture_t set_glIsTexture(glIsTexture_t f) { glIsTexture_t retval = glIsTexture; glIsTexture = f; return retval;}
- glLightModelx_t set_glLightModelx(glLightModelx_t f) { glLightModelx_t retval = glLightModelx; glLightModelx = f; return retval;}
- glLightModelxv_t set_glLightModelxv(glLightModelxv_t f) { glLightModelxv_t retval = glLightModelxv; glLightModelxv = f; return retval;}
- glLightx_t set_glLightx(glLightx_t f) { glLightx_t retval = glLightx; glLightx = f; return retval;}
- glLightxv_t set_glLightxv(glLightxv_t f) { glLightxv_t retval = glLightxv; glLightxv = f; return retval;}
- glLineWidthx_t set_glLineWidthx(glLineWidthx_t f) { glLineWidthx_t retval = glLineWidthx; glLineWidthx = f; return retval;}
- glLoadIdentity_t set_glLoadIdentity(glLoadIdentity_t f) { glLoadIdentity_t retval = glLoadIdentity; glLoadIdentity = f; return retval;}
- glLoadMatrixx_t set_glLoadMatrixx(glLoadMatrixx_t f) { glLoadMatrixx_t retval = glLoadMatrixx; glLoadMatrixx = f; return retval;}
- glLogicOp_t set_glLogicOp(glLogicOp_t f) { glLogicOp_t retval = glLogicOp; glLogicOp = f; return retval;}
- glMaterialx_t set_glMaterialx(glMaterialx_t f) { glMaterialx_t retval = glMaterialx; glMaterialx = f; return retval;}
- glMaterialxv_t set_glMaterialxv(glMaterialxv_t f) { glMaterialxv_t retval = glMaterialxv; glMaterialxv = f; return retval;}
- glMatrixMode_t set_glMatrixMode(glMatrixMode_t f) { glMatrixMode_t retval = glMatrixMode; glMatrixMode = f; return retval;}
- glMultMatrixx_t set_glMultMatrixx(glMultMatrixx_t f) { glMultMatrixx_t retval = glMultMatrixx; glMultMatrixx = f; return retval;}
- glMultiTexCoord4x_t set_glMultiTexCoord4x(glMultiTexCoord4x_t f) { glMultiTexCoord4x_t retval = glMultiTexCoord4x; glMultiTexCoord4x = f; return retval;}
- glNormal3x_t set_glNormal3x(glNormal3x_t f) { glNormal3x_t retval = glNormal3x; glNormal3x = f; return retval;}
- glNormalPointer_t set_glNormalPointer(glNormalPointer_t f) { glNormalPointer_t retval = glNormalPointer; glNormalPointer = f; return retval;}
- glOrthox_t set_glOrthox(glOrthox_t f) { glOrthox_t retval = glOrthox; glOrthox = f; return retval;}
- glPixelStorei_t set_glPixelStorei(glPixelStorei_t f) { glPixelStorei_t retval = glPixelStorei; glPixelStorei = f; return retval;}
- glPointParameterx_t set_glPointParameterx(glPointParameterx_t f) { glPointParameterx_t retval = glPointParameterx; glPointParameterx = f; return retval;}
- glPointParameterxv_t set_glPointParameterxv(glPointParameterxv_t f) { glPointParameterxv_t retval = glPointParameterxv; glPointParameterxv = f; return retval;}
- glPointSizex_t set_glPointSizex(glPointSizex_t f) { glPointSizex_t retval = glPointSizex; glPointSizex = f; return retval;}
- glPolygonOffsetx_t set_glPolygonOffsetx(glPolygonOffsetx_t f) { glPolygonOffsetx_t retval = glPolygonOffsetx; glPolygonOffsetx = f; return retval;}
- glPopMatrix_t set_glPopMatrix(glPopMatrix_t f) { glPopMatrix_t retval = glPopMatrix; glPopMatrix = f; return retval;}
- glPushMatrix_t set_glPushMatrix(glPushMatrix_t f) { glPushMatrix_t retval = glPushMatrix; glPushMatrix = f; return retval;}
- glReadPixels_t set_glReadPixels(glReadPixels_t f) { glReadPixels_t retval = glReadPixels; glReadPixels = f; return retval;}
- glRotatex_t set_glRotatex(glRotatex_t f) { glRotatex_t retval = glRotatex; glRotatex = f; return retval;}
- glSampleCoverage_t set_glSampleCoverage(glSampleCoverage_t f) { glSampleCoverage_t retval = glSampleCoverage; glSampleCoverage = f; return retval;}
- glSampleCoveragex_t set_glSampleCoveragex(glSampleCoveragex_t f) { glSampleCoveragex_t retval = glSampleCoveragex; glSampleCoveragex = f; return retval;}
- glScalex_t set_glScalex(glScalex_t f) { glScalex_t retval = glScalex; glScalex = f; return retval;}
- glScissor_t set_glScissor(glScissor_t f) { glScissor_t retval = glScissor; glScissor = f; return retval;}
- glShadeModel_t set_glShadeModel(glShadeModel_t f) { glShadeModel_t retval = glShadeModel; glShadeModel = f; return retval;}
- glStencilFunc_t set_glStencilFunc(glStencilFunc_t f) { glStencilFunc_t retval = glStencilFunc; glStencilFunc = f; return retval;}
- glStencilMask_t set_glStencilMask(glStencilMask_t f) { glStencilMask_t retval = glStencilMask; glStencilMask = f; return retval;}
- glStencilOp_t set_glStencilOp(glStencilOp_t f) { glStencilOp_t retval = glStencilOp; glStencilOp = f; return retval;}
- glTexCoordPointer_t set_glTexCoordPointer(glTexCoordPointer_t f) { glTexCoordPointer_t retval = glTexCoordPointer; glTexCoordPointer = f; return retval;}
- glTexEnvi_t set_glTexEnvi(glTexEnvi_t f) { glTexEnvi_t retval = glTexEnvi; glTexEnvi = f; return retval;}
- glTexEnvx_t set_glTexEnvx(glTexEnvx_t f) { glTexEnvx_t retval = glTexEnvx; glTexEnvx = f; return retval;}
- glTexEnviv_t set_glTexEnviv(glTexEnviv_t f) { glTexEnviv_t retval = glTexEnviv; glTexEnviv = f; return retval;}
- glTexEnvxv_t set_glTexEnvxv(glTexEnvxv_t f) { glTexEnvxv_t retval = glTexEnvxv; glTexEnvxv = f; return retval;}
- glTexImage2D_t set_glTexImage2D(glTexImage2D_t f) { glTexImage2D_t retval = glTexImage2D; glTexImage2D = f; return retval;}
- glTexParameteri_t set_glTexParameteri(glTexParameteri_t f) { glTexParameteri_t retval = glTexParameteri; glTexParameteri = f; return retval;}
- glTexParameterx_t set_glTexParameterx(glTexParameterx_t f) { glTexParameterx_t retval = glTexParameterx; glTexParameterx = f; return retval;}
- glTexParameteriv_t set_glTexParameteriv(glTexParameteriv_t f) { glTexParameteriv_t retval = glTexParameteriv; glTexParameteriv = f; return retval;}
- glTexParameterxv_t set_glTexParameterxv(glTexParameterxv_t f) { glTexParameterxv_t retval = glTexParameterxv; glTexParameterxv = f; return retval;}
- glTexSubImage2D_t set_glTexSubImage2D(glTexSubImage2D_t f) { glTexSubImage2D_t retval = glTexSubImage2D; glTexSubImage2D = f; return retval;}
- glTranslatex_t set_glTranslatex(glTranslatex_t f) { glTranslatex_t retval = glTranslatex; glTranslatex = f; return retval;}
- glVertexPointer_t set_glVertexPointer(glVertexPointer_t f) { glVertexPointer_t retval = glVertexPointer; glVertexPointer = f; return retval;}
- glViewport_t set_glViewport(glViewport_t f) { glViewport_t retval = glViewport; glViewport = f; return retval;}
- glPointSizePointerOES_t set_glPointSizePointerOES(glPointSizePointerOES_t f) { glPointSizePointerOES_t retval = glPointSizePointerOES; glPointSizePointerOES = f; return retval;}
- glBlendEquationSeparateOES_t set_glBlendEquationSeparateOES(glBlendEquationSeparateOES_t f) { glBlendEquationSeparateOES_t retval = glBlendEquationSeparateOES; glBlendEquationSeparateOES = f; return retval;}
- glBlendFuncSeparateOES_t set_glBlendFuncSeparateOES(glBlendFuncSeparateOES_t f) { glBlendFuncSeparateOES_t retval = glBlendFuncSeparateOES; glBlendFuncSeparateOES = f; return retval;}
- glBlendEquationOES_t set_glBlendEquationOES(glBlendEquationOES_t f) { glBlendEquationOES_t retval = glBlendEquationOES; glBlendEquationOES = f; return retval;}
- glDrawTexsOES_t set_glDrawTexsOES(glDrawTexsOES_t f) { glDrawTexsOES_t retval = glDrawTexsOES; glDrawTexsOES = f; return retval;}
- glDrawTexiOES_t set_glDrawTexiOES(glDrawTexiOES_t f) { glDrawTexiOES_t retval = glDrawTexiOES; glDrawTexiOES = f; return retval;}
- glDrawTexxOES_t set_glDrawTexxOES(glDrawTexxOES_t f) { glDrawTexxOES_t retval = glDrawTexxOES; glDrawTexxOES = f; return retval;}
- glDrawTexsvOES_t set_glDrawTexsvOES(glDrawTexsvOES_t f) { glDrawTexsvOES_t retval = glDrawTexsvOES; glDrawTexsvOES = f; return retval;}
- glDrawTexivOES_t set_glDrawTexivOES(glDrawTexivOES_t f) { glDrawTexivOES_t retval = glDrawTexivOES; glDrawTexivOES = f; return retval;}
- glDrawTexxvOES_t set_glDrawTexxvOES(glDrawTexxvOES_t f) { glDrawTexxvOES_t retval = glDrawTexxvOES; glDrawTexxvOES = f; return retval;}
- glDrawTexfOES_t set_glDrawTexfOES(glDrawTexfOES_t f) { glDrawTexfOES_t retval = glDrawTexfOES; glDrawTexfOES = f; return retval;}
- glDrawTexfvOES_t set_glDrawTexfvOES(glDrawTexfvOES_t f) { glDrawTexfvOES_t retval = glDrawTexfvOES; glDrawTexfvOES = f; return retval;}
- glEGLImageTargetTexture2DOES_t set_glEGLImageTargetTexture2DOES(glEGLImageTargetTexture2DOES_t f) { glEGLImageTargetTexture2DOES_t retval = glEGLImageTargetTexture2DOES; glEGLImageTargetTexture2DOES = f; return retval;}
- glEGLImageTargetRenderbufferStorageOES_t set_glEGLImageTargetRenderbufferStorageOES(glEGLImageTargetRenderbufferStorageOES_t f) { glEGLImageTargetRenderbufferStorageOES_t retval = glEGLImageTargetRenderbufferStorageOES; glEGLImageTargetRenderbufferStorageOES = f; return retval;}
- glAlphaFuncxOES_t set_glAlphaFuncxOES(glAlphaFuncxOES_t f) { glAlphaFuncxOES_t retval = glAlphaFuncxOES; glAlphaFuncxOES = f; return retval;}
- glClearColorxOES_t set_glClearColorxOES(glClearColorxOES_t f) { glClearColorxOES_t retval = glClearColorxOES; glClearColorxOES = f; return retval;}
- glClearDepthxOES_t set_glClearDepthxOES(glClearDepthxOES_t f) { glClearDepthxOES_t retval = glClearDepthxOES; glClearDepthxOES = f; return retval;}
- glClipPlanexOES_t set_glClipPlanexOES(glClipPlanexOES_t f) { glClipPlanexOES_t retval = glClipPlanexOES; glClipPlanexOES = f; return retval;}
- glColor4xOES_t set_glColor4xOES(glColor4xOES_t f) { glColor4xOES_t retval = glColor4xOES; glColor4xOES = f; return retval;}
- glDepthRangexOES_t set_glDepthRangexOES(glDepthRangexOES_t f) { glDepthRangexOES_t retval = glDepthRangexOES; glDepthRangexOES = f; return retval;}
- glFogxOES_t set_glFogxOES(glFogxOES_t f) { glFogxOES_t retval = glFogxOES; glFogxOES = f; return retval;}
- glFogxvOES_t set_glFogxvOES(glFogxvOES_t f) { glFogxvOES_t retval = glFogxvOES; glFogxvOES = f; return retval;}
- glFrustumxOES_t set_glFrustumxOES(glFrustumxOES_t f) { glFrustumxOES_t retval = glFrustumxOES; glFrustumxOES = f; return retval;}
- glGetClipPlanexOES_t set_glGetClipPlanexOES(glGetClipPlanexOES_t f) { glGetClipPlanexOES_t retval = glGetClipPlanexOES; glGetClipPlanexOES = f; return retval;}
- glGetFixedvOES_t set_glGetFixedvOES(glGetFixedvOES_t f) { glGetFixedvOES_t retval = glGetFixedvOES; glGetFixedvOES = f; return retval;}
- glGetLightxvOES_t set_glGetLightxvOES(glGetLightxvOES_t f) { glGetLightxvOES_t retval = glGetLightxvOES; glGetLightxvOES = f; return retval;}
- glGetMaterialxvOES_t set_glGetMaterialxvOES(glGetMaterialxvOES_t f) { glGetMaterialxvOES_t retval = glGetMaterialxvOES; glGetMaterialxvOES = f; return retval;}
- glGetTexEnvxvOES_t set_glGetTexEnvxvOES(glGetTexEnvxvOES_t f) { glGetTexEnvxvOES_t retval = glGetTexEnvxvOES; glGetTexEnvxvOES = f; return retval;}
- glGetTexParameterxvOES_t set_glGetTexParameterxvOES(glGetTexParameterxvOES_t f) { glGetTexParameterxvOES_t retval = glGetTexParameterxvOES; glGetTexParameterxvOES = f; return retval;}
- glLightModelxOES_t set_glLightModelxOES(glLightModelxOES_t f) { glLightModelxOES_t retval = glLightModelxOES; glLightModelxOES = f; return retval;}
- glLightModelxvOES_t set_glLightModelxvOES(glLightModelxvOES_t f) { glLightModelxvOES_t retval = glLightModelxvOES; glLightModelxvOES = f; return retval;}
- glLightxOES_t set_glLightxOES(glLightxOES_t f) { glLightxOES_t retval = glLightxOES; glLightxOES = f; return retval;}
- glLightxvOES_t set_glLightxvOES(glLightxvOES_t f) { glLightxvOES_t retval = glLightxvOES; glLightxvOES = f; return retval;}
- glLineWidthxOES_t set_glLineWidthxOES(glLineWidthxOES_t f) { glLineWidthxOES_t retval = glLineWidthxOES; glLineWidthxOES = f; return retval;}
- glLoadMatrixxOES_t set_glLoadMatrixxOES(glLoadMatrixxOES_t f) { glLoadMatrixxOES_t retval = glLoadMatrixxOES; glLoadMatrixxOES = f; return retval;}
- glMaterialxOES_t set_glMaterialxOES(glMaterialxOES_t f) { glMaterialxOES_t retval = glMaterialxOES; glMaterialxOES = f; return retval;}
- glMaterialxvOES_t set_glMaterialxvOES(glMaterialxvOES_t f) { glMaterialxvOES_t retval = glMaterialxvOES; glMaterialxvOES = f; return retval;}
- glMultMatrixxOES_t set_glMultMatrixxOES(glMultMatrixxOES_t f) { glMultMatrixxOES_t retval = glMultMatrixxOES; glMultMatrixxOES = f; return retval;}
- glMultiTexCoord4xOES_t set_glMultiTexCoord4xOES(glMultiTexCoord4xOES_t f) { glMultiTexCoord4xOES_t retval = glMultiTexCoord4xOES; glMultiTexCoord4xOES = f; return retval;}
- glNormal3xOES_t set_glNormal3xOES(glNormal3xOES_t f) { glNormal3xOES_t retval = glNormal3xOES; glNormal3xOES = f; return retval;}
- glOrthoxOES_t set_glOrthoxOES(glOrthoxOES_t f) { glOrthoxOES_t retval = glOrthoxOES; glOrthoxOES = f; return retval;}
- glPointParameterxOES_t set_glPointParameterxOES(glPointParameterxOES_t f) { glPointParameterxOES_t retval = glPointParameterxOES; glPointParameterxOES = f; return retval;}
- glPointParameterxvOES_t set_glPointParameterxvOES(glPointParameterxvOES_t f) { glPointParameterxvOES_t retval = glPointParameterxvOES; glPointParameterxvOES = f; return retval;}
- glPointSizexOES_t set_glPointSizexOES(glPointSizexOES_t f) { glPointSizexOES_t retval = glPointSizexOES; glPointSizexOES = f; return retval;}
- glPolygonOffsetxOES_t set_glPolygonOffsetxOES(glPolygonOffsetxOES_t f) { glPolygonOffsetxOES_t retval = glPolygonOffsetxOES; glPolygonOffsetxOES = f; return retval;}
- glRotatexOES_t set_glRotatexOES(glRotatexOES_t f) { glRotatexOES_t retval = glRotatexOES; glRotatexOES = f; return retval;}
- glSampleCoveragexOES_t set_glSampleCoveragexOES(glSampleCoveragexOES_t f) { glSampleCoveragexOES_t retval = glSampleCoveragexOES; glSampleCoveragexOES = f; return retval;}
- glScalexOES_t set_glScalexOES(glScalexOES_t f) { glScalexOES_t retval = glScalexOES; glScalexOES = f; return retval;}
- glTexEnvxOES_t set_glTexEnvxOES(glTexEnvxOES_t f) { glTexEnvxOES_t retval = glTexEnvxOES; glTexEnvxOES = f; return retval;}
- glTexEnvxvOES_t set_glTexEnvxvOES(glTexEnvxvOES_t f) { glTexEnvxvOES_t retval = glTexEnvxvOES; glTexEnvxvOES = f; return retval;}
- glTexParameterxOES_t set_glTexParameterxOES(glTexParameterxOES_t f) { glTexParameterxOES_t retval = glTexParameterxOES; glTexParameterxOES = f; return retval;}
- glTexParameterxvOES_t set_glTexParameterxvOES(glTexParameterxvOES_t f) { glTexParameterxvOES_t retval = glTexParameterxvOES; glTexParameterxvOES = f; return retval;}
- glTranslatexOES_t set_glTranslatexOES(glTranslatexOES_t f) { glTranslatexOES_t retval = glTranslatexOES; glTranslatexOES = f; return retval;}
- glIsRenderbufferOES_t set_glIsRenderbufferOES(glIsRenderbufferOES_t f) { glIsRenderbufferOES_t retval = glIsRenderbufferOES; glIsRenderbufferOES = f; return retval;}
- glBindRenderbufferOES_t set_glBindRenderbufferOES(glBindRenderbufferOES_t f) { glBindRenderbufferOES_t retval = glBindRenderbufferOES; glBindRenderbufferOES = f; return retval;}
- glDeleteRenderbuffersOES_t set_glDeleteRenderbuffersOES(glDeleteRenderbuffersOES_t f) { glDeleteRenderbuffersOES_t retval = glDeleteRenderbuffersOES; glDeleteRenderbuffersOES = f; return retval;}
- glGenRenderbuffersOES_t set_glGenRenderbuffersOES(glGenRenderbuffersOES_t f) { glGenRenderbuffersOES_t retval = glGenRenderbuffersOES; glGenRenderbuffersOES = f; return retval;}
- glRenderbufferStorageOES_t set_glRenderbufferStorageOES(glRenderbufferStorageOES_t f) { glRenderbufferStorageOES_t retval = glRenderbufferStorageOES; glRenderbufferStorageOES = f; return retval;}
- glGetRenderbufferParameterivOES_t set_glGetRenderbufferParameterivOES(glGetRenderbufferParameterivOES_t f) { glGetRenderbufferParameterivOES_t retval = glGetRenderbufferParameterivOES; glGetRenderbufferParameterivOES = f; return retval;}
- glIsFramebufferOES_t set_glIsFramebufferOES(glIsFramebufferOES_t f) { glIsFramebufferOES_t retval = glIsFramebufferOES; glIsFramebufferOES = f; return retval;}
- glBindFramebufferOES_t set_glBindFramebufferOES(glBindFramebufferOES_t f) { glBindFramebufferOES_t retval = glBindFramebufferOES; glBindFramebufferOES = f; return retval;}
- glDeleteFramebuffersOES_t set_glDeleteFramebuffersOES(glDeleteFramebuffersOES_t f) { glDeleteFramebuffersOES_t retval = glDeleteFramebuffersOES; glDeleteFramebuffersOES = f; return retval;}
- glGenFramebuffersOES_t set_glGenFramebuffersOES(glGenFramebuffersOES_t f) { glGenFramebuffersOES_t retval = glGenFramebuffersOES; glGenFramebuffersOES = f; return retval;}
- glCheckFramebufferStatusOES_t set_glCheckFramebufferStatusOES(glCheckFramebufferStatusOES_t f) { glCheckFramebufferStatusOES_t retval = glCheckFramebufferStatusOES; glCheckFramebufferStatusOES = f; return retval;}
- glFramebufferRenderbufferOES_t set_glFramebufferRenderbufferOES(glFramebufferRenderbufferOES_t f) { glFramebufferRenderbufferOES_t retval = glFramebufferRenderbufferOES; glFramebufferRenderbufferOES = f; return retval;}
- glFramebufferTexture2DOES_t set_glFramebufferTexture2DOES(glFramebufferTexture2DOES_t f) { glFramebufferTexture2DOES_t retval = glFramebufferTexture2DOES; glFramebufferTexture2DOES = f; return retval;}
- glGetFramebufferAttachmentParameterivOES_t set_glGetFramebufferAttachmentParameterivOES(glGetFramebufferAttachmentParameterivOES_t f) { glGetFramebufferAttachmentParameterivOES_t retval = glGetFramebufferAttachmentParameterivOES; glGetFramebufferAttachmentParameterivOES = f; return retval;}
- glGenerateMipmapOES_t set_glGenerateMipmapOES(glGenerateMipmapOES_t f) { glGenerateMipmapOES_t retval = glGenerateMipmapOES; glGenerateMipmapOES = f; return retval;}
- glMapBufferOES_t set_glMapBufferOES(glMapBufferOES_t f) { glMapBufferOES_t retval = glMapBufferOES; glMapBufferOES = f; return retval;}
- glUnmapBufferOES_t set_glUnmapBufferOES(glUnmapBufferOES_t f) { glUnmapBufferOES_t retval = glUnmapBufferOES; glUnmapBufferOES = f; return retval;}
- glGetBufferPointervOES_t set_glGetBufferPointervOES(glGetBufferPointervOES_t f) { glGetBufferPointervOES_t retval = glGetBufferPointervOES; glGetBufferPointervOES = f; return retval;}
- glCurrentPaletteMatrixOES_t set_glCurrentPaletteMatrixOES(glCurrentPaletteMatrixOES_t f) { glCurrentPaletteMatrixOES_t retval = glCurrentPaletteMatrixOES; glCurrentPaletteMatrixOES = f; return retval;}
- glLoadPaletteFromModelViewMatrixOES_t set_glLoadPaletteFromModelViewMatrixOES(glLoadPaletteFromModelViewMatrixOES_t f) { glLoadPaletteFromModelViewMatrixOES_t retval = glLoadPaletteFromModelViewMatrixOES; glLoadPaletteFromModelViewMatrixOES = f; return retval;}
- glMatrixIndexPointerOES_t set_glMatrixIndexPointerOES(glMatrixIndexPointerOES_t f) { glMatrixIndexPointerOES_t retval = glMatrixIndexPointerOES; glMatrixIndexPointerOES = f; return retval;}
- glWeightPointerOES_t set_glWeightPointerOES(glWeightPointerOES_t f) { glWeightPointerOES_t retval = glWeightPointerOES; glWeightPointerOES = f; return retval;}
- glQueryMatrixxOES_t set_glQueryMatrixxOES(glQueryMatrixxOES_t f) { glQueryMatrixxOES_t retval = glQueryMatrixxOES; glQueryMatrixxOES = f; return retval;}
- glDepthRangefOES_t set_glDepthRangefOES(glDepthRangefOES_t f) { glDepthRangefOES_t retval = glDepthRangefOES; glDepthRangefOES = f; return retval;}
- glFrustumfOES_t set_glFrustumfOES(glFrustumfOES_t f) { glFrustumfOES_t retval = glFrustumfOES; glFrustumfOES = f; return retval;}
- glOrthofOES_t set_glOrthofOES(glOrthofOES_t f) { glOrthofOES_t retval = glOrthofOES; glOrthofOES = f; return retval;}
- glClipPlanefOES_t set_glClipPlanefOES(glClipPlanefOES_t f) { glClipPlanefOES_t retval = glClipPlanefOES; glClipPlanefOES = f; return retval;}
- glGetClipPlanefOES_t set_glGetClipPlanefOES(glGetClipPlanefOES_t f) { glGetClipPlanefOES_t retval = glGetClipPlanefOES; glGetClipPlanefOES = f; return retval;}
- glClearDepthfOES_t set_glClearDepthfOES(glClearDepthfOES_t f) { glClearDepthfOES_t retval = glClearDepthfOES; glClearDepthfOES = f; return retval;}
- glTexGenfOES_t set_glTexGenfOES(glTexGenfOES_t f) { glTexGenfOES_t retval = glTexGenfOES; glTexGenfOES = f; return retval;}
- glTexGenfvOES_t set_glTexGenfvOES(glTexGenfvOES_t f) { glTexGenfvOES_t retval = glTexGenfvOES; glTexGenfvOES = f; return retval;}
- glTexGeniOES_t set_glTexGeniOES(glTexGeniOES_t f) { glTexGeniOES_t retval = glTexGeniOES; glTexGeniOES = f; return retval;}
- glTexGenivOES_t set_glTexGenivOES(glTexGenivOES_t f) { glTexGenivOES_t retval = glTexGenivOES; glTexGenivOES = f; return retval;}
- glTexGenxOES_t set_glTexGenxOES(glTexGenxOES_t f) { glTexGenxOES_t retval = glTexGenxOES; glTexGenxOES = f; return retval;}
- glTexGenxvOES_t set_glTexGenxvOES(glTexGenxvOES_t f) { glTexGenxvOES_t retval = glTexGenxvOES; glTexGenxvOES = f; return retval;}
- glGetTexGenfvOES_t set_glGetTexGenfvOES(glGetTexGenfvOES_t f) { glGetTexGenfvOES_t retval = glGetTexGenfvOES; glGetTexGenfvOES = f; return retval;}
- glGetTexGenivOES_t set_glGetTexGenivOES(glGetTexGenivOES_t f) { glGetTexGenivOES_t retval = glGetTexGenivOES; glGetTexGenivOES = f; return retval;}
- glGetTexGenxvOES_t set_glGetTexGenxvOES(glGetTexGenxvOES_t f) { glGetTexGenxvOES_t retval = glGetTexGenxvOES; glGetTexGenxvOES = f; return retval;}
- glBindVertexArrayOES_t set_glBindVertexArrayOES(glBindVertexArrayOES_t f) { glBindVertexArrayOES_t retval = glBindVertexArrayOES; glBindVertexArrayOES = f; return retval;}
- glDeleteVertexArraysOES_t set_glDeleteVertexArraysOES(glDeleteVertexArraysOES_t f) { glDeleteVertexArraysOES_t retval = glDeleteVertexArraysOES; glDeleteVertexArraysOES = f; return retval;}
- glGenVertexArraysOES_t set_glGenVertexArraysOES(glGenVertexArraysOES_t f) { glGenVertexArraysOES_t retval = glGenVertexArraysOES; glGenVertexArraysOES = f; return retval;}
- glIsVertexArrayOES_t set_glIsVertexArrayOES(glIsVertexArrayOES_t f) { glIsVertexArrayOES_t retval = glIsVertexArrayOES; glIsVertexArrayOES = f; return retval;}
- glDiscardFramebufferEXT_t set_glDiscardFramebufferEXT(glDiscardFramebufferEXT_t f) { glDiscardFramebufferEXT_t retval = glDiscardFramebufferEXT; glDiscardFramebufferEXT = f; return retval;}
- glMultiDrawArraysEXT_t set_glMultiDrawArraysEXT(glMultiDrawArraysEXT_t f) { glMultiDrawArraysEXT_t retval = glMultiDrawArraysEXT; glMultiDrawArraysEXT = f; return retval;}
- glMultiDrawElementsEXT_t set_glMultiDrawElementsEXT(glMultiDrawElementsEXT_t f) { glMultiDrawElementsEXT_t retval = glMultiDrawElementsEXT; glMultiDrawElementsEXT = f; return retval;}
- glClipPlanefIMG_t set_glClipPlanefIMG(glClipPlanefIMG_t f) { glClipPlanefIMG_t retval = glClipPlanefIMG; glClipPlanefIMG = f; return retval;}
- glClipPlanexIMG_t set_glClipPlanexIMG(glClipPlanexIMG_t f) { glClipPlanexIMG_t retval = glClipPlanexIMG; glClipPlanexIMG = f; return retval;}
- glRenderbufferStorageMultisampleIMG_t set_glRenderbufferStorageMultisampleIMG(glRenderbufferStorageMultisampleIMG_t f) { glRenderbufferStorageMultisampleIMG_t retval = glRenderbufferStorageMultisampleIMG; glRenderbufferStorageMultisampleIMG = f; return retval;}
- glFramebufferTexture2DMultisampleIMG_t set_glFramebufferTexture2DMultisampleIMG(glFramebufferTexture2DMultisampleIMG_t f) { glFramebufferTexture2DMultisampleIMG_t retval = glFramebufferTexture2DMultisampleIMG; glFramebufferTexture2DMultisampleIMG = f; return retval;}
- glDeleteFencesNV_t set_glDeleteFencesNV(glDeleteFencesNV_t f) { glDeleteFencesNV_t retval = glDeleteFencesNV; glDeleteFencesNV = f; return retval;}
- glGenFencesNV_t set_glGenFencesNV(glGenFencesNV_t f) { glGenFencesNV_t retval = glGenFencesNV; glGenFencesNV = f; return retval;}
- glIsFenceNV_t set_glIsFenceNV(glIsFenceNV_t f) { glIsFenceNV_t retval = glIsFenceNV; glIsFenceNV = f; return retval;}
- glTestFenceNV_t set_glTestFenceNV(glTestFenceNV_t f) { glTestFenceNV_t retval = glTestFenceNV; glTestFenceNV = f; return retval;}
- glGetFenceivNV_t set_glGetFenceivNV(glGetFenceivNV_t f) { glGetFenceivNV_t retval = glGetFenceivNV; glGetFenceivNV = f; return retval;}
- glFinishFenceNV_t set_glFinishFenceNV(glFinishFenceNV_t f) { glFinishFenceNV_t retval = glFinishFenceNV; glFinishFenceNV = f; return retval;}
- glSetFenceNV_t set_glSetFenceNV(glSetFenceNV_t f) { glSetFenceNV_t retval = glSetFenceNV; glSetFenceNV = f; return retval;}
- glGetDriverControlsQCOM_t set_glGetDriverControlsQCOM(glGetDriverControlsQCOM_t f) { glGetDriverControlsQCOM_t retval = glGetDriverControlsQCOM; glGetDriverControlsQCOM = f; return retval;}
- glGetDriverControlStringQCOM_t set_glGetDriverControlStringQCOM(glGetDriverControlStringQCOM_t f) { glGetDriverControlStringQCOM_t retval = glGetDriverControlStringQCOM; glGetDriverControlStringQCOM = f; return retval;}
- glEnableDriverControlQCOM_t set_glEnableDriverControlQCOM(glEnableDriverControlQCOM_t f) { glEnableDriverControlQCOM_t retval = glEnableDriverControlQCOM; glEnableDriverControlQCOM = f; return retval;}
- glDisableDriverControlQCOM_t set_glDisableDriverControlQCOM(glDisableDriverControlQCOM_t f) { glDisableDriverControlQCOM_t retval = glDisableDriverControlQCOM; glDisableDriverControlQCOM = f; return retval;}
- glExtGetTexturesQCOM_t set_glExtGetTexturesQCOM(glExtGetTexturesQCOM_t f) { glExtGetTexturesQCOM_t retval = glExtGetTexturesQCOM; glExtGetTexturesQCOM = f; return retval;}
- glExtGetBuffersQCOM_t set_glExtGetBuffersQCOM(glExtGetBuffersQCOM_t f) { glExtGetBuffersQCOM_t retval = glExtGetBuffersQCOM; glExtGetBuffersQCOM = f; return retval;}
- glExtGetRenderbuffersQCOM_t set_glExtGetRenderbuffersQCOM(glExtGetRenderbuffersQCOM_t f) { glExtGetRenderbuffersQCOM_t retval = glExtGetRenderbuffersQCOM; glExtGetRenderbuffersQCOM = f; return retval;}
- glExtGetFramebuffersQCOM_t set_glExtGetFramebuffersQCOM(glExtGetFramebuffersQCOM_t f) { glExtGetFramebuffersQCOM_t retval = glExtGetFramebuffersQCOM; glExtGetFramebuffersQCOM = f; return retval;}
- glExtGetTexLevelParameterivQCOM_t set_glExtGetTexLevelParameterivQCOM(glExtGetTexLevelParameterivQCOM_t f) { glExtGetTexLevelParameterivQCOM_t retval = glExtGetTexLevelParameterivQCOM; glExtGetTexLevelParameterivQCOM = f; return retval;}
- glExtTexObjectStateOverrideiQCOM_t set_glExtTexObjectStateOverrideiQCOM(glExtTexObjectStateOverrideiQCOM_t f) { glExtTexObjectStateOverrideiQCOM_t retval = glExtTexObjectStateOverrideiQCOM; glExtTexObjectStateOverrideiQCOM = f; return retval;}
- glExtGetTexSubImageQCOM_t set_glExtGetTexSubImageQCOM(glExtGetTexSubImageQCOM_t f) { glExtGetTexSubImageQCOM_t retval = glExtGetTexSubImageQCOM; glExtGetTexSubImageQCOM = f; return retval;}
- glExtGetBufferPointervQCOM_t set_glExtGetBufferPointervQCOM(glExtGetBufferPointervQCOM_t f) { glExtGetBufferPointervQCOM_t retval = glExtGetBufferPointervQCOM; glExtGetBufferPointervQCOM = f; return retval;}
- glExtGetShadersQCOM_t set_glExtGetShadersQCOM(glExtGetShadersQCOM_t f) { glExtGetShadersQCOM_t retval = glExtGetShadersQCOM; glExtGetShadersQCOM = f; return retval;}
- glExtGetProgramsQCOM_t set_glExtGetProgramsQCOM(glExtGetProgramsQCOM_t f) { glExtGetProgramsQCOM_t retval = glExtGetProgramsQCOM; glExtGetProgramsQCOM = f; return retval;}
- glExtIsProgramBinaryQCOM_t set_glExtIsProgramBinaryQCOM(glExtIsProgramBinaryQCOM_t f) { glExtIsProgramBinaryQCOM_t retval = glExtIsProgramBinaryQCOM; glExtIsProgramBinaryQCOM = f; return retval;}
- glExtGetProgramBinarySourceQCOM_t set_glExtGetProgramBinarySourceQCOM(glExtGetProgramBinarySourceQCOM_t f) { glExtGetProgramBinarySourceQCOM_t retval = glExtGetProgramBinarySourceQCOM; glExtGetProgramBinarySourceQCOM = f; return retval;}
- glStartTilingQCOM_t set_glStartTilingQCOM(glStartTilingQCOM_t f) { glStartTilingQCOM_t retval = glStartTilingQCOM; glStartTilingQCOM = f; return retval;}
- glEndTilingQCOM_t set_glEndTilingQCOM(glEndTilingQCOM_t f) { glEndTilingQCOM_t retval = glEndTilingQCOM; glEndTilingQCOM = f; return retval;}
-};
-
-gles_dispatch *create_gles_dispatch(void *gles_andorid);
-
-#endif
+++ /dev/null
-angeles
-my-tritex
-org.zeroxlab.benchmark
-com.cooliris.media
-com.polarbit.waveblazerlite
-test-opengl-gl2_basic
-com.trendy.ddapp
+++ /dev/null
-/*
-* Copyright (C) 2011 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.
-*/
-static struct _gles_funcs_by_name {
- const char *name;
- void *proc;
-} gles_funcs_by_name[] = {
- {"glAlphaFunc", (void *)glAlphaFunc},
- {"glClearColor", (void *)glClearColor},
- {"glClearDepthf", (void *)glClearDepthf},
- {"glClipPlanef", (void *)glClipPlanef},
- {"glColor4f", (void *)glColor4f},
- {"glDepthRangef", (void *)glDepthRangef},
- {"glFogf", (void *)glFogf},
- {"glFogfv", (void *)glFogfv},
- {"glFrustumf", (void *)glFrustumf},
- {"glGetClipPlanef", (void *)glGetClipPlanef},
- {"glGetFloatv", (void *)glGetFloatv},
- {"glGetLightfv", (void *)glGetLightfv},
- {"glGetMaterialfv", (void *)glGetMaterialfv},
- {"glGetTexEnvfv", (void *)glGetTexEnvfv},
- {"glGetTexParameterfv", (void *)glGetTexParameterfv},
- {"glLightModelf", (void *)glLightModelf},
- {"glLightModelfv", (void *)glLightModelfv},
- {"glLightf", (void *)glLightf},
- {"glLightfv", (void *)glLightfv},
- {"glLineWidth", (void *)glLineWidth},
- {"glLoadMatrixf", (void *)glLoadMatrixf},
- {"glMaterialf", (void *)glMaterialf},
- {"glMaterialfv", (void *)glMaterialfv},
- {"glMultMatrixf", (void *)glMultMatrixf},
- {"glMultiTexCoord4f", (void *)glMultiTexCoord4f},
- {"glNormal3f", (void *)glNormal3f},
- {"glOrthof", (void *)glOrthof},
- {"glPointParameterf", (void *)glPointParameterf},
- {"glPointParameterfv", (void *)glPointParameterfv},
- {"glPointSize", (void *)glPointSize},
- {"glPolygonOffset", (void *)glPolygonOffset},
- {"glRotatef", (void *)glRotatef},
- {"glScalef", (void *)glScalef},
- {"glTexEnvf", (void *)glTexEnvf},
- {"glTexEnvfv", (void *)glTexEnvfv},
- {"glTexParameterf", (void *)glTexParameterf},
- {"glTexParameterfv", (void *)glTexParameterfv},
- {"glTranslatef", (void *)glTranslatef},
- {"glActiveTexture", (void *)glActiveTexture},
- {"glAlphaFuncx", (void *)glAlphaFuncx},
- {"glBindBuffer", (void *)glBindBuffer},
- {"glBindTexture", (void *)glBindTexture},
- {"glBlendFunc", (void *)glBlendFunc},
- {"glBufferData", (void *)glBufferData},
- {"glBufferSubData", (void *)glBufferSubData},
- {"glClear", (void *)glClear},
- {"glClearColorx", (void *)glClearColorx},
- {"glClearDepthx", (void *)glClearDepthx},
- {"glClearStencil", (void *)glClearStencil},
- {"glClientActiveTexture", (void *)glClientActiveTexture},
- {"glClipPlanex", (void *)glClipPlanex},
- {"glColor4ub", (void *)glColor4ub},
- {"glColor4x", (void *)glColor4x},
- {"glColorMask", (void *)glColorMask},
- {"glColorPointer", (void *)glColorPointer},
- {"glCompressedTexImage2D", (void *)glCompressedTexImage2D},
- {"glCompressedTexSubImage2D", (void *)glCompressedTexSubImage2D},
- {"glCopyTexImage2D", (void *)glCopyTexImage2D},
- {"glCopyTexSubImage2D", (void *)glCopyTexSubImage2D},
- {"glCullFace", (void *)glCullFace},
- {"glDeleteBuffers", (void *)glDeleteBuffers},
- {"glDeleteTextures", (void *)glDeleteTextures},
- {"glDepthFunc", (void *)glDepthFunc},
- {"glDepthMask", (void *)glDepthMask},
- {"glDepthRangex", (void *)glDepthRangex},
- {"glDisable", (void *)glDisable},
- {"glDisableClientState", (void *)glDisableClientState},
- {"glDrawArrays", (void *)glDrawArrays},
- {"glDrawElements", (void *)glDrawElements},
- {"glEnable", (void *)glEnable},
- {"glEnableClientState", (void *)glEnableClientState},
- {"glFinish", (void *)glFinish},
- {"glFlush", (void *)glFlush},
- {"glFogx", (void *)glFogx},
- {"glFogxv", (void *)glFogxv},
- {"glFrontFace", (void *)glFrontFace},
- {"glFrustumx", (void *)glFrustumx},
- {"glGetBooleanv", (void *)glGetBooleanv},
- {"glGetBufferParameteriv", (void *)glGetBufferParameteriv},
- {"glGetClipPlanex", (void *)glGetClipPlanex},
- {"glGenBuffers", (void *)glGenBuffers},
- {"glGenTextures", (void *)glGenTextures},
- {"glGetError", (void *)glGetError},
- {"glGetFixedv", (void *)glGetFixedv},
- {"glGetIntegerv", (void *)glGetIntegerv},
- {"glGetLightxv", (void *)glGetLightxv},
- {"glGetMaterialxv", (void *)glGetMaterialxv},
- {"glGetPointerv", (void *)glGetPointerv},
- {"glGetString", (void *)glGetString},
- {"glGetTexEnviv", (void *)glGetTexEnviv},
- {"glGetTexEnvxv", (void *)glGetTexEnvxv},
- {"glGetTexParameteriv", (void *)glGetTexParameteriv},
- {"glGetTexParameterxv", (void *)glGetTexParameterxv},
- {"glHint", (void *)glHint},
- {"glIsBuffer", (void *)glIsBuffer},
- {"glIsEnabled", (void *)glIsEnabled},
- {"glIsTexture", (void *)glIsTexture},
- {"glLightModelx", (void *)glLightModelx},
- {"glLightModelxv", (void *)glLightModelxv},
- {"glLightx", (void *)glLightx},
- {"glLightxv", (void *)glLightxv},
- {"glLineWidthx", (void *)glLineWidthx},
- {"glLoadIdentity", (void *)glLoadIdentity},
- {"glLoadMatrixx", (void *)glLoadMatrixx},
- {"glLogicOp", (void *)glLogicOp},
- {"glMaterialx", (void *)glMaterialx},
- {"glMaterialxv", (void *)glMaterialxv},
- {"glMatrixMode", (void *)glMatrixMode},
- {"glMultMatrixx", (void *)glMultMatrixx},
- {"glMultiTexCoord4x", (void *)glMultiTexCoord4x},
- {"glNormal3x", (void *)glNormal3x},
- {"glNormalPointer", (void *)glNormalPointer},
- {"glOrthox", (void *)glOrthox},
- {"glPixelStorei", (void *)glPixelStorei},
- {"glPointParameterx", (void *)glPointParameterx},
- {"glPointParameterxv", (void *)glPointParameterxv},
- {"glPointSizex", (void *)glPointSizex},
- {"glPolygonOffsetx", (void *)glPolygonOffsetx},
- {"glPopMatrix", (void *)glPopMatrix},
- {"glPushMatrix", (void *)glPushMatrix},
- {"glReadPixels", (void *)glReadPixels},
- {"glRotatex", (void *)glRotatex},
- {"glSampleCoverage", (void *)glSampleCoverage},
- {"glSampleCoveragex", (void *)glSampleCoveragex},
- {"glScalex", (void *)glScalex},
- {"glScissor", (void *)glScissor},
- {"glShadeModel", (void *)glShadeModel},
- {"glStencilFunc", (void *)glStencilFunc},
- {"glStencilMask", (void *)glStencilMask},
- {"glStencilOp", (void *)glStencilOp},
- {"glTexCoordPointer", (void *)glTexCoordPointer},
- {"glTexEnvi", (void *)glTexEnvi},
- {"glTexEnvx", (void *)glTexEnvx},
- {"glTexEnviv", (void *)glTexEnviv},
- {"glTexEnvxv", (void *)glTexEnvxv},
- {"glTexImage2D", (void *)glTexImage2D},
- {"glTexParameteri", (void *)glTexParameteri},
- {"glTexParameterx", (void *)glTexParameterx},
- {"glTexParameteriv", (void *)glTexParameteriv},
- {"glTexParameterxv", (void *)glTexParameterxv},
- {"glTexSubImage2D", (void *)glTexSubImage2D},
- {"glTranslatex", (void *)glTranslatex},
- {"glVertexPointer", (void *)glVertexPointer},
- {"glViewport", (void *)glViewport},
- {"glPointSizePointerOES", (void *)glPointSizePointerOES},
- {"glBlendEquationSeparateOES", (void *)glBlendEquationSeparateOES},
- {"glBlendFuncSeparateOES", (void *)glBlendFuncSeparateOES},
- {"glBlendEquationOES", (void *)glBlendEquationOES},
- {"glDrawTexsOES", (void *)glDrawTexsOES},
- {"glDrawTexiOES", (void *)glDrawTexiOES},
- {"glDrawTexxOES", (void *)glDrawTexxOES},
- {"glDrawTexsvOES", (void *)glDrawTexsvOES},
- {"glDrawTexivOES", (void *)glDrawTexivOES},
- {"glDrawTexxvOES", (void *)glDrawTexxvOES},
- {"glDrawTexfOES", (void *)glDrawTexfOES},
- {"glDrawTexfvOES", (void *)glDrawTexfvOES},
- {"glEGLImageTargetTexture2DOES", (void *)glEGLImageTargetTexture2DOES},
- {"glEGLImageTargetRenderbufferStorageOES", (void *)glEGLImageTargetRenderbufferStorageOES},
- {"glAlphaFuncxOES", (void *)glAlphaFuncxOES},
- {"glClearColorxOES", (void *)glClearColorxOES},
- {"glClearDepthxOES", (void *)glClearDepthxOES},
- {"glClipPlanexOES", (void *)glClipPlanexOES},
- {"glColor4xOES", (void *)glColor4xOES},
- {"glDepthRangexOES", (void *)glDepthRangexOES},
- {"glFogxOES", (void *)glFogxOES},
- {"glFogxvOES", (void *)glFogxvOES},
- {"glFrustumxOES", (void *)glFrustumxOES},
- {"glGetClipPlanexOES", (void *)glGetClipPlanexOES},
- {"glGetFixedvOES", (void *)glGetFixedvOES},
- {"glGetLightxvOES", (void *)glGetLightxvOES},
- {"glGetMaterialxvOES", (void *)glGetMaterialxvOES},
- {"glGetTexEnvxvOES", (void *)glGetTexEnvxvOES},
- {"glGetTexParameterxvOES", (void *)glGetTexParameterxvOES},
- {"glLightModelxOES", (void *)glLightModelxOES},
- {"glLightModelxvOES", (void *)glLightModelxvOES},
- {"glLightxOES", (void *)glLightxOES},
- {"glLightxvOES", (void *)glLightxvOES},
- {"glLineWidthxOES", (void *)glLineWidthxOES},
- {"glLoadMatrixxOES", (void *)glLoadMatrixxOES},
- {"glMaterialxOES", (void *)glMaterialxOES},
- {"glMaterialxvOES", (void *)glMaterialxvOES},
- {"glMultMatrixxOES", (void *)glMultMatrixxOES},
- {"glMultiTexCoord4xOES", (void *)glMultiTexCoord4xOES},
- {"glNormal3xOES", (void *)glNormal3xOES},
- {"glOrthoxOES", (void *)glOrthoxOES},
- {"glPointParameterxOES", (void *)glPointParameterxOES},
- {"glPointParameterxvOES", (void *)glPointParameterxvOES},
- {"glPointSizexOES", (void *)glPointSizexOES},
- {"glPolygonOffsetxOES", (void *)glPolygonOffsetxOES},
- {"glRotatexOES", (void *)glRotatexOES},
- {"glSampleCoveragexOES", (void *)glSampleCoveragexOES},
- {"glScalexOES", (void *)glScalexOES},
- {"glTexEnvxOES", (void *)glTexEnvxOES},
- {"glTexEnvxvOES", (void *)glTexEnvxvOES},
- {"glTexParameterxOES", (void *)glTexParameterxOES},
- {"glTexParameterxvOES", (void *)glTexParameterxvOES},
- {"glTranslatexOES", (void *)glTranslatexOES},
- {"glIsRenderbufferOES", (void *)glIsRenderbufferOES},
- {"glBindRenderbufferOES", (void *)glBindRenderbufferOES},
- {"glDeleteRenderbuffersOES", (void *)glDeleteRenderbuffersOES},
- {"glGenRenderbuffersOES", (void *)glGenRenderbuffersOES},
- {"glRenderbufferStorageOES", (void *)glRenderbufferStorageOES},
- {"glGetRenderbufferParameterivOES", (void *)glGetRenderbufferParameterivOES},
- {"glIsFramebufferOES", (void *)glIsFramebufferOES},
- {"glBindFramebufferOES", (void *)glBindFramebufferOES},
- {"glDeleteFramebuffersOES", (void *)glDeleteFramebuffersOES},
- {"glGenFramebuffersOES", (void *)glGenFramebuffersOES},
- {"glCheckFramebufferStatusOES", (void *)glCheckFramebufferStatusOES},
- {"glFramebufferRenderbufferOES", (void *)glFramebufferRenderbufferOES},
- {"glFramebufferTexture2DOES", (void *)glFramebufferTexture2DOES},
- {"glGetFramebufferAttachmentParameterivOES", (void *)glGetFramebufferAttachmentParameterivOES},
- {"glGenerateMipmapOES", (void *)glGenerateMipmapOES},
- {"glMapBufferOES", (void *)glMapBufferOES},
- {"glUnmapBufferOES", (void *)glUnmapBufferOES},
- {"glGetBufferPointervOES", (void *)glGetBufferPointervOES},
- {"glCurrentPaletteMatrixOES", (void *)glCurrentPaletteMatrixOES},
- {"glLoadPaletteFromModelViewMatrixOES", (void *)glLoadPaletteFromModelViewMatrixOES},
- {"glMatrixIndexPointerOES", (void *)glMatrixIndexPointerOES},
- {"glWeightPointerOES", (void *)glWeightPointerOES},
- {"glQueryMatrixxOES", (void *)glQueryMatrixxOES},
- {"glDepthRangefOES", (void *)glDepthRangefOES},
- {"glFrustumfOES", (void *)glFrustumfOES},
- {"glOrthofOES", (void *)glOrthofOES},
- {"glClipPlanefOES", (void *)glClipPlanefOES},
- {"glGetClipPlanefOES", (void *)glGetClipPlanefOES},
- {"glClearDepthfOES", (void *)glClearDepthfOES},
- {"glTexGenfOES", (void *)glTexGenfOES},
- {"glTexGenfvOES", (void *)glTexGenfvOES},
- {"glTexGeniOES", (void *)glTexGeniOES},
- {"glTexGenivOES", (void *)glTexGenivOES},
- {"glTexGenxOES", (void *)glTexGenxOES},
- {"glTexGenxvOES", (void *)glTexGenxvOES},
- {"glGetTexGenfvOES", (void *)glGetTexGenfvOES},
- {"glGetTexGenivOES", (void *)glGetTexGenivOES},
- {"glGetTexGenxvOES", (void *)glGetTexGenxvOES},
- {"glBindVertexArrayOES", (void *)glBindVertexArrayOES},
- {"glDeleteVertexArraysOES", (void *)glDeleteVertexArraysOES},
- {"glGenVertexArraysOES", (void *)glGenVertexArraysOES},
- {"glIsVertexArrayOES", (void *)glIsVertexArrayOES},
- {"glDiscardFramebufferEXT", (void *)glDiscardFramebufferEXT},
- {"glMultiDrawArraysEXT", (void *)glMultiDrawArraysEXT},
- {"glMultiDrawElementsEXT", (void *)glMultiDrawElementsEXT},
- {"glClipPlanefIMG", (void *)glClipPlanefIMG},
- {"glClipPlanexIMG", (void *)glClipPlanexIMG},
- {"glRenderbufferStorageMultisampleIMG", (void *)glRenderbufferStorageMultisampleIMG},
- {"glFramebufferTexture2DMultisampleIMG", (void *)glFramebufferTexture2DMultisampleIMG},
- {"glDeleteFencesNV", (void *)glDeleteFencesNV},
- {"glGenFencesNV", (void *)glGenFencesNV},
- {"glIsFenceNV", (void *)glIsFenceNV},
- {"glTestFenceNV", (void *)glTestFenceNV},
- {"glGetFenceivNV", (void *)glGetFenceivNV},
- {"glFinishFenceNV", (void *)glFinishFenceNV},
- {"glSetFenceNV", (void *)glSetFenceNV},
- {"glGetDriverControlsQCOM", (void *)glGetDriverControlsQCOM},
- {"glGetDriverControlStringQCOM", (void *)glGetDriverControlStringQCOM},
- {"glEnableDriverControlQCOM", (void *)glEnableDriverControlQCOM},
- {"glDisableDriverControlQCOM", (void *)glDisableDriverControlQCOM},
- {"glExtGetTexturesQCOM", (void *)glExtGetTexturesQCOM},
- {"glExtGetBuffersQCOM", (void *)glExtGetBuffersQCOM},
- {"glExtGetRenderbuffersQCOM", (void *)glExtGetRenderbuffersQCOM},
- {"glExtGetFramebuffersQCOM", (void *)glExtGetFramebuffersQCOM},
- {"glExtGetTexLevelParameterivQCOM", (void *)glExtGetTexLevelParameterivQCOM},
- {"glExtTexObjectStateOverrideiQCOM", (void *)glExtTexObjectStateOverrideiQCOM},
- {"glExtGetTexSubImageQCOM", (void *)glExtGetTexSubImageQCOM},
- {"glExtGetBufferPointervQCOM", (void *)glExtGetBufferPointervQCOM},
- {"glExtGetShadersQCOM", (void *)glExtGetShadersQCOM},
- {"glExtGetProgramsQCOM", (void *)glExtGetProgramsQCOM},
- {"glExtIsProgramBinaryQCOM", (void *)glExtIsProgramBinaryQCOM},
- {"glExtGetProgramBinarySourceQCOM", (void *)glExtGetProgramBinarySourceQCOM},
- {"glStartTilingQCOM", (void *)glStartTilingQCOM},
- {"glEndTilingQCOM", (void *)glEndTilingQCOM}
-};
-static int gles_num_funcs = sizeof(gles_funcs_by_name) / sizeof(struct _gles_funcs_by_name);
+++ /dev/null
-/*
-* Copyright (C) 2011 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 _GLES_PROC_H
-#define _GLES_PROC_H
-
-#include <GLES/gl.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GLES/glext.h>
-
-typedef void (* glAlphaFunc_t) (GLenum, GLclampf);
-typedef void (* glClearColor_t) (GLclampf, GLclampf, GLclampf, GLclampf);
-typedef void (* glClearDepthf_t) (GLclampf);
-typedef void (* glClipPlanef_t) (GLenum, const GLfloat*);
-typedef void (* glColor4f_t) (GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (* glDepthRangef_t) (GLclampf, GLclampf);
-typedef void (* glFogf_t) (GLenum, GLfloat);
-typedef void (* glFogfv_t) (GLenum, const GLfloat*);
-typedef void (* glFrustumf_t) (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (* glGetClipPlanef_t) (GLenum, GLfloat*);
-typedef void (* glGetFloatv_t) (GLenum, GLfloat*);
-typedef void (* glGetLightfv_t) (GLenum, GLenum, GLfloat*);
-typedef void (* glGetMaterialfv_t) (GLenum, GLenum, GLfloat*);
-typedef void (* glGetTexEnvfv_t) (GLenum, GLenum, GLfloat*);
-typedef void (* glGetTexParameterfv_t) (GLenum, GLenum, GLfloat*);
-typedef void (* glLightModelf_t) (GLenum, GLfloat);
-typedef void (* glLightModelfv_t) (GLenum, const GLfloat*);
-typedef void (* glLightf_t) (GLenum, GLenum, GLfloat);
-typedef void (* glLightfv_t) (GLenum, GLenum, const GLfloat*);
-typedef void (* glLineWidth_t) (GLfloat);
-typedef void (* glLoadMatrixf_t) (const GLfloat*);
-typedef void (* glMaterialf_t) (GLenum, GLenum, GLfloat);
-typedef void (* glMaterialfv_t) (GLenum, GLenum, const GLfloat*);
-typedef void (* glMultMatrixf_t) (const GLfloat*);
-typedef void (* glMultiTexCoord4f_t) (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (* glNormal3f_t) (GLfloat, GLfloat, GLfloat);
-typedef void (* glOrthof_t) (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (* glPointParameterf_t) (GLenum, GLfloat);
-typedef void (* glPointParameterfv_t) (GLenum, const GLfloat*);
-typedef void (* glPointSize_t) (GLfloat);
-typedef void (* glPolygonOffset_t) (GLfloat, GLfloat);
-typedef void (* glRotatef_t) (GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (* glScalef_t) (GLfloat, GLfloat, GLfloat);
-typedef void (* glTexEnvf_t) (GLenum, GLenum, GLfloat);
-typedef void (* glTexEnvfv_t) (GLenum, GLenum, const GLfloat*);
-typedef void (* glTexParameterf_t) (GLenum, GLenum, GLfloat);
-typedef void (* glTexParameterfv_t) (GLenum, GLenum, const GLfloat*);
-typedef void (* glTranslatef_t) (GLfloat, GLfloat, GLfloat);
-typedef void (* glActiveTexture_t) (GLenum);
-typedef void (* glAlphaFuncx_t) (GLenum, GLclampx);
-typedef void (* glBindBuffer_t) (GLenum, GLuint);
-typedef void (* glBindTexture_t) (GLenum, GLuint);
-typedef void (* glBlendFunc_t) (GLenum, GLenum);
-typedef void (* glBufferData_t) (GLenum, GLsizeiptr, const GLvoid*, GLenum);
-typedef void (* glBufferSubData_t) (GLenum, GLintptr, GLsizeiptr, const GLvoid*);
-typedef void (* glClear_t) (GLbitfield);
-typedef void (* glClearColorx_t) (GLclampx, GLclampx, GLclampx, GLclampx);
-typedef void (* glClearDepthx_t) (GLclampx);
-typedef void (* glClearStencil_t) (GLint);
-typedef void (* glClientActiveTexture_t) (GLenum);
-typedef void (* glClipPlanex_t) (GLenum, const GLfixed*);
-typedef void (* glColor4ub_t) (GLubyte, GLubyte, GLubyte, GLubyte);
-typedef void (* glColor4x_t) (GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glColorMask_t) (GLboolean, GLboolean, GLboolean, GLboolean);
-typedef void (* glColorPointer_t) (GLint, GLenum, GLsizei, const GLvoid*);
-typedef void (* glCompressedTexImage2D_t) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
-typedef void (* glCompressedTexSubImage2D_t) (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
-typedef void (* glCopyTexImage2D_t) (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
-typedef void (* glCopyTexSubImage2D_t) (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-typedef void (* glCullFace_t) (GLenum);
-typedef void (* glDeleteBuffers_t) (GLsizei, const GLuint*);
-typedef void (* glDeleteTextures_t) (GLsizei, const GLuint*);
-typedef void (* glDepthFunc_t) (GLenum);
-typedef void (* glDepthMask_t) (GLboolean);
-typedef void (* glDepthRangex_t) (GLclampx, GLclampx);
-typedef void (* glDisable_t) (GLenum);
-typedef void (* glDisableClientState_t) (GLenum);
-typedef void (* glDrawArrays_t) (GLenum, GLint, GLsizei);
-typedef void (* glDrawElements_t) (GLenum, GLsizei, GLenum, const GLvoid*);
-typedef void (* glEnable_t) (GLenum);
-typedef void (* glEnableClientState_t) (GLenum);
-typedef void (* glFinish_t) ();
-typedef void (* glFlush_t) ();
-typedef void (* glFogx_t) (GLenum, GLfixed);
-typedef void (* glFogxv_t) (GLenum, const GLfixed*);
-typedef void (* glFrontFace_t) (GLenum);
-typedef void (* glFrustumx_t) (GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glGetBooleanv_t) (GLenum, GLboolean*);
-typedef void (* glGetBufferParameteriv_t) (GLenum, GLenum, GLint*);
-typedef void (* glGetClipPlanex_t) (GLenum, GLfixed*);
-typedef void (* glGenBuffers_t) (GLsizei, GLuint*);
-typedef void (* glGenTextures_t) (GLsizei, GLuint*);
-typedef GLenum (* glGetError_t) ();
-typedef void (* glGetFixedv_t) (GLenum, GLfixed*);
-typedef void (* glGetIntegerv_t) (GLenum, GLint*);
-typedef void (* glGetLightxv_t) (GLenum, GLenum, GLfixed*);
-typedef void (* glGetMaterialxv_t) (GLenum, GLenum, GLfixed*);
-typedef void (* glGetPointerv_t) (GLenum, GLvoid**);
-typedef const GLubyte* (* glGetString_t) (GLenum);
-typedef void (* glGetTexEnviv_t) (GLenum, GLenum, GLint*);
-typedef void (* glGetTexEnvxv_t) (GLenum, GLenum, GLfixed*);
-typedef void (* glGetTexParameteriv_t) (GLenum, GLenum, GLint*);
-typedef void (* glGetTexParameterxv_t) (GLenum, GLenum, GLfixed*);
-typedef void (* glHint_t) (GLenum, GLenum);
-typedef GLboolean (* glIsBuffer_t) (GLuint);
-typedef GLboolean (* glIsEnabled_t) (GLenum);
-typedef GLboolean (* glIsTexture_t) (GLuint);
-typedef void (* glLightModelx_t) (GLenum, GLfixed);
-typedef void (* glLightModelxv_t) (GLenum, const GLfixed*);
-typedef void (* glLightx_t) (GLenum, GLenum, GLfixed);
-typedef void (* glLightxv_t) (GLenum, GLenum, const GLfixed*);
-typedef void (* glLineWidthx_t) (GLfixed);
-typedef void (* glLoadIdentity_t) ();
-typedef void (* glLoadMatrixx_t) (const GLfixed*);
-typedef void (* glLogicOp_t) (GLenum);
-typedef void (* glMaterialx_t) (GLenum, GLenum, GLfixed);
-typedef void (* glMaterialxv_t) (GLenum, GLenum, const GLfixed*);
-typedef void (* glMatrixMode_t) (GLenum);
-typedef void (* glMultMatrixx_t) (const GLfixed*);
-typedef void (* glMultiTexCoord4x_t) (GLenum, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glNormal3x_t) (GLfixed, GLfixed, GLfixed);
-typedef void (* glNormalPointer_t) (GLenum, GLsizei, const GLvoid*);
-typedef void (* glOrthox_t) (GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glPixelStorei_t) (GLenum, GLint);
-typedef void (* glPointParameterx_t) (GLenum, GLfixed);
-typedef void (* glPointParameterxv_t) (GLenum, const GLfixed*);
-typedef void (* glPointSizex_t) (GLfixed);
-typedef void (* glPolygonOffsetx_t) (GLfixed, GLfixed);
-typedef void (* glPopMatrix_t) ();
-typedef void (* glPushMatrix_t) ();
-typedef void (* glReadPixels_t) (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
-typedef void (* glRotatex_t) (GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glSampleCoverage_t) (GLclampf, GLboolean);
-typedef void (* glSampleCoveragex_t) (GLclampx, GLboolean);
-typedef void (* glScalex_t) (GLfixed, GLfixed, GLfixed);
-typedef void (* glScissor_t) (GLint, GLint, GLsizei, GLsizei);
-typedef void (* glShadeModel_t) (GLenum);
-typedef void (* glStencilFunc_t) (GLenum, GLint, GLuint);
-typedef void (* glStencilMask_t) (GLuint);
-typedef void (* glStencilOp_t) (GLenum, GLenum, GLenum);
-typedef void (* glTexCoordPointer_t) (GLint, GLenum, GLsizei, const GLvoid*);
-typedef void (* glTexEnvi_t) (GLenum, GLenum, GLint);
-typedef void (* glTexEnvx_t) (GLenum, GLenum, GLfixed);
-typedef void (* glTexEnviv_t) (GLenum, GLenum, const GLint*);
-typedef void (* glTexEnvxv_t) (GLenum, GLenum, const GLfixed*);
-typedef void (* glTexImage2D_t) (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
-typedef void (* glTexParameteri_t) (GLenum, GLenum, GLint);
-typedef void (* glTexParameterx_t) (GLenum, GLenum, GLfixed);
-typedef void (* glTexParameteriv_t) (GLenum, GLenum, const GLint*);
-typedef void (* glTexParameterxv_t) (GLenum, GLenum, const GLfixed*);
-typedef void (* glTexSubImage2D_t) (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
-typedef void (* glTranslatex_t) (GLfixed, GLfixed, GLfixed);
-typedef void (* glVertexPointer_t) (GLint, GLenum, GLsizei, const GLvoid*);
-typedef void (* glViewport_t) (GLint, GLint, GLsizei, GLsizei);
-typedef void (* glPointSizePointerOES_t) (GLenum, GLsizei, const GLvoid*);
-typedef void (* glBlendEquationSeparateOES_t) (GLenum, GLenum);
-typedef void (* glBlendFuncSeparateOES_t) (GLenum, GLenum, GLenum, GLenum);
-typedef void (* glBlendEquationOES_t) (GLenum);
-typedef void (* glDrawTexsOES_t) (GLshort, GLshort, GLshort, GLshort, GLshort);
-typedef void (* glDrawTexiOES_t) (GLint, GLint, GLint, GLint, GLint);
-typedef void (* glDrawTexxOES_t) (GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glDrawTexsvOES_t) (const GLshort*);
-typedef void (* glDrawTexivOES_t) (const GLint*);
-typedef void (* glDrawTexxvOES_t) (const GLfixed*);
-typedef void (* glDrawTexfOES_t) (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (* glDrawTexfvOES_t) (const GLfloat*);
-typedef void (* glEGLImageTargetTexture2DOES_t) (GLenum, GLeglImageOES);
-typedef void (* glEGLImageTargetRenderbufferStorageOES_t) (GLenum, GLeglImageOES);
-typedef void (* glAlphaFuncxOES_t) (GLenum, GLclampx);
-typedef void (* glClearColorxOES_t) (GLclampx, GLclampx, GLclampx, GLclampx);
-typedef void (* glClearDepthxOES_t) (GLclampx);
-typedef void (* glClipPlanexOES_t) (GLenum, const GLfixed*);
-typedef void (* glColor4xOES_t) (GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glDepthRangexOES_t) (GLclampx, GLclampx);
-typedef void (* glFogxOES_t) (GLenum, GLfixed);
-typedef void (* glFogxvOES_t) (GLenum, const GLfixed*);
-typedef void (* glFrustumxOES_t) (GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glGetClipPlanexOES_t) (GLenum, GLfixed*);
-typedef void (* glGetFixedvOES_t) (GLenum, GLfixed*);
-typedef void (* glGetLightxvOES_t) (GLenum, GLenum, GLfixed*);
-typedef void (* glGetMaterialxvOES_t) (GLenum, GLenum, GLfixed*);
-typedef void (* glGetTexEnvxvOES_t) (GLenum, GLenum, GLfixed*);
-typedef void (* glGetTexParameterxvOES_t) (GLenum, GLenum, GLfixed*);
-typedef void (* glLightModelxOES_t) (GLenum, GLfixed);
-typedef void (* glLightModelxvOES_t) (GLenum, const GLfixed*);
-typedef void (* glLightxOES_t) (GLenum, GLenum, GLfixed);
-typedef void (* glLightxvOES_t) (GLenum, GLenum, const GLfixed*);
-typedef void (* glLineWidthxOES_t) (GLfixed);
-typedef void (* glLoadMatrixxOES_t) (const GLfixed*);
-typedef void (* glMaterialxOES_t) (GLenum, GLenum, GLfixed);
-typedef void (* glMaterialxvOES_t) (GLenum, GLenum, const GLfixed*);
-typedef void (* glMultMatrixxOES_t) (const GLfixed*);
-typedef void (* glMultiTexCoord4xOES_t) (GLenum, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glNormal3xOES_t) (GLfixed, GLfixed, GLfixed);
-typedef void (* glOrthoxOES_t) (GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glPointParameterxOES_t) (GLenum, GLfixed);
-typedef void (* glPointParameterxvOES_t) (GLenum, const GLfixed*);
-typedef void (* glPointSizexOES_t) (GLfixed);
-typedef void (* glPolygonOffsetxOES_t) (GLfixed, GLfixed);
-typedef void (* glRotatexOES_t) (GLfixed, GLfixed, GLfixed, GLfixed);
-typedef void (* glSampleCoveragexOES_t) (GLclampx, GLboolean);
-typedef void (* glScalexOES_t) (GLfixed, GLfixed, GLfixed);
-typedef void (* glTexEnvxOES_t) (GLenum, GLenum, GLfixed);
-typedef void (* glTexEnvxvOES_t) (GLenum, GLenum, const GLfixed*);
-typedef void (* glTexParameterxOES_t) (GLenum, GLenum, GLfixed);
-typedef void (* glTexParameterxvOES_t) (GLenum, GLenum, const GLfixed*);
-typedef void (* glTranslatexOES_t) (GLfixed, GLfixed, GLfixed);
-typedef GLboolean (* glIsRenderbufferOES_t) (GLuint);
-typedef void (* glBindRenderbufferOES_t) (GLenum, GLuint);
-typedef void (* glDeleteRenderbuffersOES_t) (GLsizei, const GLuint*);
-typedef void (* glGenRenderbuffersOES_t) (GLsizei, GLuint*);
-typedef void (* glRenderbufferStorageOES_t) (GLenum, GLenum, GLsizei, GLsizei);
-typedef void (* glGetRenderbufferParameterivOES_t) (GLenum, GLenum, GLint*);
-typedef GLboolean (* glIsFramebufferOES_t) (GLuint);
-typedef void (* glBindFramebufferOES_t) (GLenum, GLuint);
-typedef void (* glDeleteFramebuffersOES_t) (GLsizei, const GLuint*);
-typedef void (* glGenFramebuffersOES_t) (GLsizei, GLuint*);
-typedef GLenum (* glCheckFramebufferStatusOES_t) (GLenum);
-typedef void (* glFramebufferRenderbufferOES_t) (GLenum, GLenum, GLenum, GLuint);
-typedef void (* glFramebufferTexture2DOES_t) (GLenum, GLenum, GLenum, GLuint, GLint);
-typedef void (* glGetFramebufferAttachmentParameterivOES_t) (GLenum, GLenum, GLenum, GLint*);
-typedef void (* glGenerateMipmapOES_t) (GLenum);
-typedef void* (* glMapBufferOES_t) (GLenum, GLenum);
-typedef GLboolean (* glUnmapBufferOES_t) (GLenum);
-typedef void (* glGetBufferPointervOES_t) (GLenum, GLenum, GLvoid*);
-typedef void (* glCurrentPaletteMatrixOES_t) (GLuint);
-typedef void (* glLoadPaletteFromModelViewMatrixOES_t) ();
-typedef void (* glMatrixIndexPointerOES_t) (GLint, GLenum, GLsizei, const GLvoid*);
-typedef void (* glWeightPointerOES_t) (GLint, GLenum, GLsizei, const GLvoid*);
-typedef GLbitfield (* glQueryMatrixxOES_t) (GLfixed*, GLint*);
-typedef void (* glDepthRangefOES_t) (GLclampf, GLclampf);
-typedef void (* glFrustumfOES_t) (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (* glOrthofOES_t) (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (* glClipPlanefOES_t) (GLenum, const GLfloat*);
-typedef void (* glGetClipPlanefOES_t) (GLenum, GLfloat*);
-typedef void (* glClearDepthfOES_t) (GLclampf);
-typedef void (* glTexGenfOES_t) (GLenum, GLenum, GLfloat);
-typedef void (* glTexGenfvOES_t) (GLenum, GLenum, const GLfloat*);
-typedef void (* glTexGeniOES_t) (GLenum, GLenum, GLint);
-typedef void (* glTexGenivOES_t) (GLenum, GLenum, const GLint*);
-typedef void (* glTexGenxOES_t) (GLenum, GLenum, GLfixed);
-typedef void (* glTexGenxvOES_t) (GLenum, GLenum, const GLfixed*);
-typedef void (* glGetTexGenfvOES_t) (GLenum, GLenum, GLfloat*);
-typedef void (* glGetTexGenivOES_t) (GLenum, GLenum, GLint*);
-typedef void (* glGetTexGenxvOES_t) (GLenum, GLenum, GLfixed*);
-typedef void (* glBindVertexArrayOES_t) (GLuint);
-typedef void (* glDeleteVertexArraysOES_t) (GLsizei, const GLuint*);
-typedef void (* glGenVertexArraysOES_t) (GLsizei, GLuint*);
-typedef GLboolean (* glIsVertexArrayOES_t) (GLuint);
-typedef void (* glDiscardFramebufferEXT_t) (GLenum, GLsizei, const GLenum*);
-typedef void (* glMultiDrawArraysEXT_t) (GLenum, GLint*, GLsizei*, GLsizei);
-typedef void (* glMultiDrawElementsEXT_t) (GLenum, const GLsizei*, GLenum, const GLvoid**, GLsizei);
-typedef void (* glClipPlanefIMG_t) (GLenum, const GLfloat*);
-typedef void (* glClipPlanexIMG_t) (GLenum, const GLfixed*);
-typedef void (* glRenderbufferStorageMultisampleIMG_t) (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
-typedef void (* glFramebufferTexture2DMultisampleIMG_t) (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
-typedef void (* glDeleteFencesNV_t) (GLsizei, const GLuint*);
-typedef void (* glGenFencesNV_t) (GLsizei, GLuint*);
-typedef GLboolean (* glIsFenceNV_t) (GLuint);
-typedef GLboolean (* glTestFenceNV_t) (GLuint);
-typedef void (* glGetFenceivNV_t) (GLuint, GLenum, GLint*);
-typedef void (* glFinishFenceNV_t) (GLuint);
-typedef void (* glSetFenceNV_t) (GLuint, GLenum);
-typedef void (* glGetDriverControlsQCOM_t) (GLint*, GLsizei, GLuint*);
-typedef void (* glGetDriverControlStringQCOM_t) (GLuint, GLsizei, GLsizei*, GLchar*);
-typedef void (* glEnableDriverControlQCOM_t) (GLuint);
-typedef void (* glDisableDriverControlQCOM_t) (GLuint);
-typedef void (* glExtGetTexturesQCOM_t) (GLuint*, GLint, GLint*);
-typedef void (* glExtGetBuffersQCOM_t) (GLuint*, GLint, GLint*);
-typedef void (* glExtGetRenderbuffersQCOM_t) (GLuint*, GLint, GLint*);
-typedef void (* glExtGetFramebuffersQCOM_t) (GLuint*, GLint, GLint*);
-typedef void (* glExtGetTexLevelParameterivQCOM_t) (GLuint, GLenum, GLint, GLenum, GLint*);
-typedef void (* glExtTexObjectStateOverrideiQCOM_t) (GLenum, GLenum, GLint);
-typedef void (* glExtGetTexSubImageQCOM_t) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
-typedef void (* glExtGetBufferPointervQCOM_t) (GLenum, GLvoid**);
-typedef void (* glExtGetShadersQCOM_t) (GLuint*, GLint, GLint*);
-typedef void (* glExtGetProgramsQCOM_t) (GLuint*, GLint, GLint*);
-typedef GLboolean (* glExtIsProgramBinaryQCOM_t) (GLuint);
-typedef void (* glExtGetProgramBinarySourceQCOM_t) (GLuint, GLenum, GLchar*, GLint*);
-typedef void (* glStartTilingQCOM_t) (GLuint, GLuint, GLuint, GLuint, GLbitfield);
-typedef void (* glEndTilingQCOM_t) (GLbitfield);
-
-
-#endif
+++ /dev/null
-/*
-* Copyright 2011 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 <stdlib.h>
-#include "ApiInitializer.h"
-#include <dlfcn.h>
-#include "gl_wrapper_context.h"
-
-extern "C" {
- gl_wrapper_context_t *createFromLib(void *solib, gl_wrapper_context_t *(*accessor)());
-}
-
-gl_wrapper_context_t * createFromLib(void *solib, gl_wrapper_context_t *(accessor)())
-{
- gl_wrapper_context_t *ctx = new gl_wrapper_context_t;
- if (ctx == NULL) {
- return NULL;
- }
- ApiInitializer *initializer = new ApiInitializer(solib);
- ctx->initDispatchByName(ApiInitializer::s_getProc, initializer);
- gl_wrapper_context_t::setContextAccessor(accessor);
- delete initializer;
- return ctx;
-}
-
-
+++ /dev/null
-/*
-* Copyright 2011 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 <stdlib.h>
-#include "ApiInitializer.h"
-#include <dlfcn.h>
-#include "gl2_wrapper_context.h"
-
-extern "C" {
- gl2_wrapper_context_t *createFromLib(void *solib, gl2_wrapper_context_t *(*accessor)());
-}
-
-gl2_wrapper_context_t * createFromLib(void *solib, gl2_wrapper_context_t *(*accessor)())
-{
- gl2_wrapper_context_t *ctx = new gl2_wrapper_context_t;
- if (ctx == NULL) {
- return NULL;
- }
- ApiInitializer *initializer = new ApiInitializer(solib);
- ctx->initDispatchByName(ApiInitializer::s_getProc, initializer);
- gl2_wrapper_context_t::setContextAccessor(accessor);
- delete initializer;
- return ctx;
-}
-
-
-
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-$(call emugl-begin-shared-library,libut_rendercontrol_enc)
-$(call emugl-import,libOpenglCodecCommon)
-$(call emugl-gen-encoder,$(LOCAL_PATH),ut_rendercontrol)
-$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
-$(call emugl-end-module)
-
+++ /dev/null
-GLOBAL
- base_opcode 10000
- encoder_headers <stdint.h>
-
+++ /dev/null
-GL_ENTRY(int, createContext, uint32_t pid, uint32_t handle, uint32_t shareCtx, int version)
-GL_ENTRY(int, createSurface, uint32_t pid, uint32_t handle)
-GL_ENTRY(int, makeCurrentContext, uint32_t pid, uint32_t drawSurface, uint32_t readSurface, uint32_t ctxHandle)
-GL_ENTRY(void, swapBuffers, uint32_t pid, uint32_t surface)
-GL_ENTRY(int, destroyContext, uint32_t pid, uint32_t handle)
-GL_ENTRY(int, destroySurface, uint32_t pid, uint32_t handle)
-
-
-
-
-
+++ /dev/null
-uint32_t 32 0x%08x false
-
+++ /dev/null
-/*
-* Copyright (C) 2011 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 <stdint.h>