aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-05-10 21:55:40 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-05-10 21:55:41 -0700
commitecbbf1ca1ab30cac0a1144b43c4e34c10022ed2f (patch)
treed279d4a506bee2b5aabf37c5432e23cfc309939a
parent291744a651760261527f0bf66a7573d4a94a862e (diff)
parentba5c1f674511aff458dae69927a1c61d60e66aa1 (diff)
downloadexternal_qemu-ecbbf1ca1ab30cac0a1144b43c4e34c10022ed2f.zip
external_qemu-ecbbf1ca1ab30cac0a1144b43c4e34c10022ed2f.tar.gz
external_qemu-ecbbf1ca1ab30cac0a1144b43c4e34c10022ed2f.tar.bz2
Merge "Remove init-time GLES per-frame callback"
-rw-r--r--android/opengles.c13
-rw-r--r--android/opengles.h12
-rw-r--r--vl-android.c9
3 files changed, 18 insertions, 16 deletions
diff --git a/android/opengles.c b/android/opengles.c
index 70e3f8c..6f0556f 100644
--- a/android/opengles.c
+++ b/android/opengles.c
@@ -47,6 +47,7 @@ int android_gles_fast_pipes = 1;
DYNLINK_FUNC(initLibrary) \
DYNLINK_FUNC(setStreamMode) \
DYNLINK_FUNC(initOpenGLRenderer) \
+ DYNLINK_FUNC(setPostCallback) \
DYNLINK_FUNC(getHardwareStrings) \
DYNLINK_FUNC(createOpenGLSubwindow) \
DYNLINK_FUNC(destroyOpenGLSubwindow) \
@@ -139,20 +140,28 @@ BAD_EXIT:
}
int
-android_startOpenglesRenderer(int width, int height, OnPostFunc onPost, void* onPostContext)
+android_startOpenglesRenderer(int width, int height)
{
if (!rendererLib) {
D("Can't start OpenGLES renderer without support libraries");
return -1;
}
- if (!initOpenGLRenderer(width, height, ANDROID_OPENGLES_BASE_PORT, onPost, onPostContext)) {
+ if (!initOpenGLRenderer(width, height, ANDROID_OPENGLES_BASE_PORT)) {
D("Can't start OpenGLES renderer?");
return -1;
}
return 0;
}
+void
+android_setPostCallback(OnPostFunc onPost, void* onPostContext)
+{
+ if (rendererLib) {
+ setPostCallback(onPost, onPostContext);
+ }
+}
+
static void strncpy_safe(char* dst, const char* src, size_t n)
{
strncpy(dst, src, n);
diff --git a/android/opengles.h b/android/opengles.h
index 4e83c02..aac6249 100644
--- a/android/opengles.h
+++ b/android/opengles.h
@@ -16,10 +16,6 @@
#define ANDROID_OPENGLES_BASE_PORT 22468
-/* See the description in render_api.h. */
-typedef void (*OnPostFunc)(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.
@@ -30,8 +26,12 @@ int android_initOpenglesEmulation(void);
* At the moment, this must be done before the VM starts. The onPost callback
* may be NULL.
*/
-int android_startOpenglesRenderer(int width, int height,
- OnPostFunc onPost, void* onPostContext);
+int android_startOpenglesRenderer(int width, int height);
+
+/* See the description in render_api.h. */
+typedef void (*OnPostFunc)(void* context, int width, int height, int ydir,
+ int format, int type, unsigned char* pixels);
+void android_setPostCallback(OnPostFunc onPost, void* onPostContext);
/* Retrieve the Vendor/Renderer/Version strings describing the underlying GL
* implementation. The call only works while the renderer is started.
diff --git a/vl-android.c b/vl-android.c
index 1513541..f9afa5c 100644
--- a/vl-android.c
+++ b/vl-android.c
@@ -3877,15 +3877,8 @@ int main(int argc, char **argv, char **envp)
* we just shut it down again once we have the strings. */
{
int qemu_gles = 0;
-
- /* Set framebuffer change notification callback when starting
- * GLES emulation. Currently only multi-touch emulation is
- * interested in FB changes (to transmit them to the device), so
- * the callback is set within MT emulation. */
if (android_initOpenglesEmulation() == 0 &&
- android_startOpenglesRenderer(android_hw->hw_lcd_width,
- android_hw->hw_lcd_height,
- multitouch_opengles_fb_update, NULL) == 0)
+ android_startOpenglesRenderer(android_hw->hw_lcd_width, android_hw->hw_lcd_height) == 0)
{
android_getOpenglesHardwareStrings(
android_gl_vendor, sizeof(android_gl_vendor),