aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-03-21 11:49:42 -0700
committerJesse Hall <jessehall@google.com>2012-03-22 13:30:16 -0700
commit2f4361f1d63751f1f72e1a1f953acfb9c05727da (patch)
tree111a0e5f22638690e26c8a23e73bd44f90bf10d0
parent541a7b25951ed30c7411eda50cce3ff9fa0289e4 (diff)
downloadexternal_qemu-2f4361f1d63751f1f72e1a1f953acfb9c05727da.zip
external_qemu-2f4361f1d63751f1f72e1a1f953acfb9c05727da.tar.gz
external_qemu-2f4361f1d63751f1f72e1a1f953acfb9c05727da.tar.bz2
EmuGL: Add OnPost callback to OpenGL renderer
Match the interface changes in the OpenGL renderer that add a per-frame callback. The callback isn't used in this change. This change is co-dependent on Idae3b026d52ed8dd666cbcdc3f3af80175c90ad3 in development/. Change-Id: Idae3b026d52ed8dd666cbcdc3f3af80175c90ad3
-rw-r--r--android/opengles.c6
-rw-r--r--android/opengles.h10
-rw-r--r--vl-android.c3
3 files changed, 13 insertions, 6 deletions
diff --git a/android/opengles.c b/android/opengles.c
index 5a29d3a..f116f25 100644
--- a/android/opengles.c
+++ b/android/opengles.c
@@ -41,7 +41,7 @@ int android_gles_fast_pipes = 1;
#define DYNLINK_FUNCTIONS \
DYNLINK_FUNC(int,initLibrary,(void),(),return) \
DYNLINK_FUNC(int,setStreamMode,(int a),(a),return) \
- DYNLINK_FUNC(int,initOpenGLRenderer,(int width, int height, int port),(width,height,port),return) \
+ DYNLINK_FUNC(int,initOpenGLRenderer,(int width, int height, int port, OnPostFn onPost, void* onPostContext),(width,height,port,onPost,onPostContext),return) \
DYNLINK_FUNC(int,createOpenGLSubwindow,(void* window, int x, int y, int width, int height, float zRot),(window,x,y,width,height,zRot),return)\
DYNLINK_FUNC(int,destroyOpenGLSubwindow,(void),(),return)\
DYNLINK_FUNC(void,repaintOpenGLDisplay,(void),(),)\
@@ -141,14 +141,14 @@ BAD_EXIT:
}
int
-android_startOpenglesRenderer(int width, int height)
+android_startOpenglesRenderer(int width, int height, OnPostFn onPost, void* onPostContext)
{
if (!rendererLib) {
D("Can't start OpenGLES renderer without support libraries");
return -1;
}
- if (initOpenGLRenderer(width, height,ANDROID_OPENGLES_BASE_PORT) != 0) {
+ if (initOpenGLRenderer(width, height, ANDROID_OPENGLES_BASE_PORT, onPost, onPostContext) != 0) {
D("Can't start OpenGLES renderer?");
return -1;
}
diff --git a/android/opengles.h b/android/opengles.h
index 2202e92..7bb6a3a 100644
--- a/android/opengles.h
+++ b/android/opengles.h
@@ -16,6 +16,10 @@
#define ANDROID_OPENGLES_BASE_PORT 22468
+/* See the description in render_api.h. */
+typedef void (*OnPostFn)(void* context, int width, int height, int ydir,
+ int format, int type, unsigned char* pixels);
+
/* Call this function to initialize the hardware opengles emulation.
* This function will abort if we can't find the corresponding host
* libraries through dlopen() or equivalent.
@@ -23,9 +27,11 @@
int android_initOpenglesEmulation(void);
/* Tries to start the renderer process. Returns 0 on success, -1 on error.
- * At the moment, this must be done before the VM starts.
+ * At the moment, this must be done before the VM starts. The onPost callback
+ * may be NULL.
*/
-int android_startOpenglesRenderer(int width, int height);
+int android_startOpenglesRenderer(int width, int height,
+ OnPostFn onPost, void* onPostContext);
int android_showOpenglesWindow(void* window, int x, int y, int width, int height, float rotation);
diff --git a/vl-android.c b/vl-android.c
index 1ec910b..bf50b77 100644
--- a/vl-android.c
+++ b/vl-android.c
@@ -3877,7 +3877,8 @@ int main(int argc, char **argv, char **envp)
if (android_hw->hw_gpu_enabled) {
if (android_initOpenglesEmulation() == 0) {
gles_emul = 1;
- android_startOpenglesRenderer(android_hw->hw_lcd_width, android_hw->hw_lcd_height);
+ android_startOpenglesRenderer(android_hw->hw_lcd_width, android_hw->hw_lcd_height,
+ NULL, NULL);
} else {
dwarning("Could not initialize OpenglES emulation, using software renderer.");
}