diff options
Diffstat (limited to 'opengl/system/renderControl_enc')
15 files changed, 0 insertions, 1868 deletions
diff --git a/opengl/system/renderControl_enc/Android.mk b/opengl/system/renderControl_enc/Android.mk deleted file mode 100644 index 5792440f..00000000 --- a/opengl/system/renderControl_enc/Android.mk +++ /dev/null @@ -1,12 +0,0 @@ -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) diff --git a/opengl/system/renderControl_enc/README b/opengl/system/renderControl_enc/README deleted file mode 100644 index 349b6dbd..00000000 --- a/opengl/system/renderControl_enc/README +++ /dev/null @@ -1,142 +0,0 @@ -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. diff --git a/opengl/system/renderControl_enc/renderControl.attrib b/opengl/system/renderControl_enc/renderControl.attrib deleted file mode 100644 index 0fa04691..00000000 --- a/opengl/system/renderControl_enc/renderControl.attrib +++ /dev/null @@ -1,45 +0,0 @@ -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 - diff --git a/opengl/system/renderControl_enc/renderControl.in b/opengl/system/renderControl_enc/renderControl.in deleted file mode 100644 index ebbf0fe7..00000000 --- a/opengl/system/renderControl_enc/renderControl.in +++ /dev/null @@ -1,29 +0,0 @@ -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) diff --git a/opengl/system/renderControl_enc/renderControl.types b/opengl/system/renderControl_enc/renderControl.types deleted file mode 100644 index a7d96abf..00000000 --- a/opengl/system/renderControl_enc/renderControl.types +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/opengl/system/renderControl_enc/renderControl_client_base.h b/opengl/system/renderControl_enc/renderControl_client_base.h deleted file mode 100644 index 4fb5d760..00000000 --- a/opengl/system/renderControl_enc/renderControl_client_base.h +++ /dev/null @@ -1,41 +0,0 @@ -// 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 diff --git a/opengl/system/renderControl_enc/renderControl_client_context.cpp b/opengl/system/renderControl_enc/renderControl_client_context.cpp deleted file mode 100644 index 51b62a6a..00000000 --- a/opengl/system/renderControl_enc/renderControl_client_context.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// 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; -} - diff --git a/opengl/system/renderControl_enc/renderControl_client_context.h b/opengl/system/renderControl_enc/renderControl_client_context.h deleted file mode 100644 index f5230f11..00000000 --- a/opengl/system/renderControl_enc/renderControl_client_context.h +++ /dev/null @@ -1,51 +0,0 @@ -// 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 diff --git a/opengl/system/renderControl_enc/renderControl_client_proc.h b/opengl/system/renderControl_enc/renderControl_client_proc.h deleted file mode 100644 index 7b213d5f..00000000 --- a/opengl/system/renderControl_enc/renderControl_client_proc.h +++ /dev/null @@ -1,43 +0,0 @@ -// 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 diff --git a/opengl/system/renderControl_enc/renderControl_enc.cpp b/opengl/system/renderControl_enc/renderControl_enc.cpp deleted file mode 100644 index 20215137..00000000 --- a/opengl/system/renderControl_enc/renderControl_enc.cpp +++ /dev/null @@ -1,1096 +0,0 @@ -// 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; -} - diff --git a/opengl/system/renderControl_enc/renderControl_enc.h b/opengl/system/renderControl_enc/renderControl_enc.h deleted file mode 100644 index 628cff3b..00000000 --- a/opengl/system/renderControl_enc/renderControl_enc.h +++ /dev/null @@ -1,24 +0,0 @@ -// 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 diff --git a/opengl/system/renderControl_enc/renderControl_entry.cpp b/opengl/system/renderControl_enc/renderControl_entry.cpp deleted file mode 100644 index 6a51108c..00000000 --- a/opengl/system/renderControl_enc/renderControl_entry.cpp +++ /dev/null @@ -1,220 +0,0 @@ -// 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); -} - diff --git a/opengl/system/renderControl_enc/renderControl_ftable.h b/opengl/system/renderControl_enc/renderControl_ftable.h deleted file mode 100644 index ac772e60..00000000 --- a/opengl/system/renderControl_enc/renderControl_ftable.h +++ /dev/null @@ -1,44 +0,0 @@ -// 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 diff --git a/opengl/system/renderControl_enc/renderControl_opcodes.h b/opengl/system/renderControl_enc/renderControl_opcodes.h deleted file mode 100644 index 4861c9c9..00000000 --- a/opengl/system/renderControl_enc/renderControl_opcodes.h +++ /dev/null @@ -1,38 +0,0 @@ -// 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 diff --git a/opengl/system/renderControl_enc/renderControl_types.h b/opengl/system/renderControl_enc/renderControl_types.h deleted file mode 100644 index da215bb4..00000000 --- a/opengl/system/renderControl_enc/renderControl_types.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -* 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 |