1 The renderControl.in file in this directory defines an API which is decoded
2 on the android guest into a stream and get decoded and executed on the host.
3 It is used in order to query the host renderer as well as send the host renderer
4 control commands.
5
6 The following describes each of the entries defined by this renderControl API.
7
8
9 GLint rcGetRendererVersion();
10 This function queries the host renderer version number.
11
12 EGLint rcGetEGLVersion(EGLint* major, EGLint* minor);
13 This function queries the host renderer for the EGL version
14 it supports. returns EGL_FALSE on failure.
15
16 EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize);
17 This function queries the host for EGL string (.i.e EGL_EXTENSIONS).
18 if buffer is NULL or the bufferSize is not big enough the return value
19 is the negative number of bytes required to store the string value
20 otherwise the string value is copied to buffer and its size is
21 returned.
22
23 EGLint rcGetNumConfigs(uint32_t* numAttribs);
24 queries the host for the number of supported EGL configs.
25 The function returns the number of supported configs and returns in
26 numAttribs the number of attributes available for each config.
27
28 EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer);
29 This function queries the host for the all set of supported configs
30 with their attribute values.
31 bufSize is the size of buffer, the size should be at least equal to
32 (numConfigs + 1) * numAttribs * sizeof(GLuint)
33 where numConfigs and numAttribs are the values returned in
34 rcGetNumConfigs. if bufSize is not big enough then the negative number
35 of required bytes is returned otherwise the function returns the number
36 of configs and buffer is filled as follows: The first 'numAttribs'
37 integer values are filled with the EGL enumerant describing a config
38 attribute, next for each config there are 'numAttribs' integer values
39 holding the attribute values for that config, the values are specified
40 in the same order as the attribute vector.
41
42 EGLint rcChooseConfig(EGLint *attribs, uint32_t attribs_size, uint32_t *configs, uint32_t configs_size)
43 This function triggers an eglChooseConfig on the host, to get a list of
44 configs matching the given attribs values.
45 attribs - a list of attribute names followed by the desired values, terminated by EGL_NONE
46 attribs_size - the size of the list
47 configs - the returned matching configuration names (same names as familiar to the client in rcGetConfigs)
48 configs_size - the size of the configs buffers
49 returns - the actual number of matching configurations (<= configs_size)
50
51 EGLint rcGetFBParam(EGLint param);
52 queries the host for framebuffer parameter, see renderControl_types.h
53 for possible values of 'param'.
54
55 uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion);
56 This function creates a rendering context on the host and returns its
57 handle. config is the config index for the context, share is either zero
58 or a handle to a sharing context. glVersion is either 1 or 2 for GLES1
59 or GLES2 context respectively.
60
61
62 void rcDestroyContext(uint32_t context);
63 This function destroys a rendering context on the host.
64 context is a handle returned in rcCreateContext.
65
66 uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height);
67 This function creates a 'window' surface on the host which can be then
68 bind for rendering through rcMakeCurrent.
69 The function returns a handle to the created window surface.
70
71 void rcDestroyWindowSurface(uint32_t windowSurface);
72 This function destoys a window surface.
73
74 uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat);
75 This function creates a colorBuffer object on the host which can be then
76 be specified as a render target for a window surface through
77 rcSetWindowColorBuffer or to be displayed on the framebuffer window
78 through rcFBPost.
79 The function returns a handle to the colorBuffer object.
80
81 void rcDestroyColorBuffer(uint32_t colorbuffer);
82 destroyes a colorBuffer object.
83
84 void rcFlushWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
85 This flushes the current window color buffer
86
87 void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
88 This set the target color buffer for a windowSurface, when set the
89 previous target colorBuffer gets updated before switching to the new
90 colorBuffer.
91
92 EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf);
93 Binds a windowSurface(s) and current rendering context for the
94 calling thread.
95
96 void rcFBPost(uint32_t colorBuffer);
97 This function causes the content of the colorBuffer object to be
98 displayed on the host framebuffer window. The function returns
99 immediatly, the buffer will be displayed at the next swap interval.
100
101 void rcFBSetSwapInterval(EGLint interval);
102 Sets the swap interval for the host framebuffer window.
103
104 void rcBindTexture(uint32_t colorBuffer);
105 This function instruct the host to bind the content of the specified
106 colorBuffer to the current binded texture object of the calling thread.
107 This function should be used to implement eglBindTexImage.
108
109 EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead);
110 This function returns only after all rendering requests for the specified
111 colorBuffer rendering target has been processed and after all 'postCount'
112 posts for the buffer requested previously through rcFBPost has been
113 processed.
114 if 'forRead' is not-zero, the function returns positive value in case
115 there was rendering done to the buffer since the last CacheFlush request
116 with non-zero 'forRead' value, otherwise the function returns zero or
117 negative value on failure.
118
119 void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y,
120 GLint width, GLint height, GLenum format,
121 GLenum type, void* pixels);
122 This function queries the host for the pixel content of a colorBuffer's
123 subregion. It act the same as OpenGL glReadPixels however pixels
124 are always packed with alignment of 1.
125
126 void rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y,
127 GLint width, GLint height, GLenum format,
128 GLenum type, void* pixels);
129 Updates the content of a subregion of a colorBuffer object.
130 pixels are always unpacked with alignment of 1.
131