Import goldfish HAL sources from devices/generic/goldfish

We import all code here so we can customize and keep in sync with what
we do on the host side more easily.
This commit is contained in:
Simon Fels 2017-01-09 08:05:04 +01:00
commit 23392b9732
196 changed files with 62159 additions and 0 deletions

View file

@ -0,0 +1,12 @@
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)

View file

@ -0,0 +1,142 @@
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.

View file

@ -0,0 +1,45 @@
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

View file

@ -0,0 +1,35 @@
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)
GL_ENTRY(int, rcGetNumDisplays)
GL_ENTRY(int, rcGetDisplayWidth, uint32_t displayId)
GL_ENTRY(int, rcGetDisplayHeight, uint32_t displayId)
GL_ENTRY(int, rcGetDisplayDpiX, uint32_t displayId)
GL_ENTRY(int, rcGetDisplayDpiY, uint32_t displayId)
GL_ENTRY(int, rcGetDisplayVsyncPeriod, uint32_t displayId)

View file

@ -0,0 +1,11 @@
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

View file

@ -0,0 +1,41 @@
// 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

View file

@ -0,0 +1,52 @@
// 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);
rcSelectChecksumCalculator = (rcSelectChecksumCalculator_client_proc_t) getProc("rcSelectChecksumCalculator", userData);
rcGetNumDisplays = (rcGetNumDisplays_client_proc_t) getProc("rcGetNumDisplays", userData);
rcGetDisplayWidth = (rcGetDisplayWidth_client_proc_t) getProc("rcGetDisplayWidth", userData);
rcGetDisplayHeight = (rcGetDisplayHeight_client_proc_t) getProc("rcGetDisplayHeight", userData);
rcGetDisplayDpiX = (rcGetDisplayDpiX_client_proc_t) getProc("rcGetDisplayDpiX", userData);
rcGetDisplayDpiY = (rcGetDisplayDpiY_client_proc_t) getProc("rcGetDisplayDpiY", userData);
rcGetDisplayVsyncPeriod = (rcGetDisplayVsyncPeriod_client_proc_t) getProc("rcGetDisplayVsyncPeriod", userData);
rcPostLayer = (rcPostLayer_client_proc_t) getProc("rcPostLayer", userData);
rcPostAllLayersDone = (rcPostAllLayersDone_client_proc_t) getProc("rcPostAllLayersDone", userData);
return 0;
}

View file

@ -0,0 +1,59 @@
// 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;
rcSelectChecksumCalculator_client_proc_t rcSelectChecksumCalculator;
rcGetNumDisplays_client_proc_t rcGetNumDisplays;
rcGetDisplayWidth_client_proc_t rcGetDisplayWidth;
rcGetDisplayHeight_client_proc_t rcGetDisplayHeight;
rcGetDisplayDpiX_client_proc_t rcGetDisplayDpiX;
rcGetDisplayDpiY_client_proc_t rcGetDisplayDpiY;
rcGetDisplayVsyncPeriod_client_proc_t rcGetDisplayVsyncPeriod;
rcPostLayer_client_proc_t rcPostLayer;
rcPostAllLayersDone_client_proc_t rcPostAllLayersDone;
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

View file

@ -0,0 +1,52 @@
// 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 *rcSelectChecksumCalculator_client_proc_t) (void * ctx, uint32_t, uint32_t);
typedef int (renderControl_APIENTRY *rcGetNumDisplays_client_proc_t) (void * ctx);
typedef int (renderControl_APIENTRY *rcGetDisplayWidth_client_proc_t) (void * ctx, uint32_t);
typedef int (renderControl_APIENTRY *rcGetDisplayHeight_client_proc_t) (void * ctx, uint32_t);
typedef int (renderControl_APIENTRY *rcGetDisplayDpiX_client_proc_t) (void * ctx, uint32_t);
typedef int (renderControl_APIENTRY *rcGetDisplayDpiY_client_proc_t) (void * ctx, uint32_t);
typedef int (renderControl_APIENTRY *rcGetDisplayVsyncPeriod_client_proc_t) (void * ctx, uint32_t);
typedef void (renderControl_APIENTRY *rcPostLayer_client_proc_t) (void * ctx, const char*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
typedef void (renderControl_APIENTRY *rcPostAllLayersDone_client_proc_t) (void * ctx);
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,24 @@
// 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

View file

@ -0,0 +1,276 @@
// 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 rcSelectChecksumCalculator(uint32_t newProtocol, uint32_t reserved);
int rcGetNumDisplays();
int rcGetDisplayWidth(uint32_t displayId);
int rcGetDisplayHeight(uint32_t displayId);
int rcGetDisplayDpiX(uint32_t displayId);
int rcGetDisplayDpiY(uint32_t displayId);
int rcGetDisplayVsyncPeriod(uint32_t displayId);
void rcPostLayer(const char* name, uint32_t colorBuffer, int32_t sourceCropLeft, int32_t sourceCropTop, int32_t sourceCropRight, int32_t sourceCropBottom, int32_t displayFrameLeft, int32_t displayFrameTop, int32_t displayFrameRight, int32_t displayFrameBottom);
void rcPostAllLayersDone();
};
#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 rcSelectChecksumCalculator(uint32_t newProtocol, uint32_t reserved)
{
GET_CONTEXT;
ctx->rcSelectChecksumCalculator(ctx, newProtocol, reserved);
}
int rcGetNumDisplays()
{
GET_CONTEXT;
return ctx->rcGetNumDisplays(ctx);
}
int rcGetDisplayWidth(uint32_t displayId)
{
GET_CONTEXT;
return ctx->rcGetDisplayWidth(ctx, displayId);
}
int rcGetDisplayHeight(uint32_t displayId)
{
GET_CONTEXT;
return ctx->rcGetDisplayHeight(ctx, displayId);
}
int rcGetDisplayDpiX(uint32_t displayId)
{
GET_CONTEXT;
return ctx->rcGetDisplayDpiX(ctx, displayId);
}
int rcGetDisplayDpiY(uint32_t displayId)
{
GET_CONTEXT;
return ctx->rcGetDisplayDpiY(ctx, displayId);
}
int rcGetDisplayVsyncPeriod(uint32_t displayId)
{
GET_CONTEXT;
return ctx->rcGetDisplayVsyncPeriod(ctx, displayId);
}
void rcPostLayer(const char* name, uint32_t colorBuffer, int32_t sourceCropLeft, int32_t sourceCropTop, int32_t sourceCropRight, int32_t sourceCropBottom, int32_t displayFrameLeft, int32_t displayFrameTop, int32_t displayFrameRight, int32_t displayFrameBottom)
{
GET_CONTEXT;
ctx->rcPostLayer(ctx, name, colorBuffer, sourceCropLeft, sourceCropTop, sourceCropRight, sourceCropBottom, displayFrameLeft, displayFrameTop, displayFrameRight, displayFrameBottom);
}
void rcPostAllLayersDone()
{
GET_CONTEXT;
ctx->rcPostAllLayersDone(ctx);
}

View file

@ -0,0 +1,52 @@
// 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},
{"rcSelectChecksumCalculator", (void*)rcSelectChecksumCalculator},
{"rcGetNumDisplays", (void*)rcGetNumDisplays},
{"rcGetDisplayWidth", (void*)rcGetDisplayWidth},
{"rcGetDisplayHeight", (void*)rcGetDisplayHeight},
{"rcGetDisplayDpiX", (void*)rcGetDisplayDpiX},
{"rcGetDisplayDpiY", (void*)rcGetDisplayDpiY},
{"rcGetDisplayVsyncPeriod", (void*)rcGetDisplayVsyncPeriod},
{"rcPostLayer", (void*)rcPostLayer},
{"rcPostAllLayersDone", (void*)rcPostAllLayersDone},
};
static const int renderControl_num_funcs = sizeof(renderControl_funcs_by_name) / sizeof(struct _renderControl_funcs_by_name);
#endif

View file

@ -0,0 +1,46 @@
// 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_rcSelectChecksumCalculator 10028
#define OP_rcGetNumDisplays 10029
#define OP_rcGetDisplayWidth 10030
#define OP_rcGetDisplayHeight 10031
#define OP_rcGetDisplayDpiX 10032
#define OP_rcGetDisplayDpiY 10033
#define OP_rcGetDisplayVsyncPeriod 10034
#define OP_rcPostLayer 10035
#define OP_rcPostAllLayersDone 10036
#define OP_last 10037
#endif

View file

@ -0,0 +1,28 @@
/*
* 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