aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2012-05-11 07:14:14 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2012-05-11 15:32:23 -0700
commit8de6a30e3b2035b39f308febe2f9536671547096 (patch)
treeb0c0113929e31546f01857cd023d9d4da037e60d /android
parent2c4c30e62aac9f55cf2287feb0ef6ed81c5430d3 (diff)
downloadexternal_qemu-8de6a30e3b2035b39f308febe2f9536671547096.zip
external_qemu-8de6a30e3b2035b39f308febe2f9536671547096.tar.gz
external_qemu-8de6a30e3b2035b39f308febe2f9536671547096.tar.bz2
Catch up with OpenGLES API changes.
It turned out, that OpenGLES framebuffer update callback is expensive, and since it's used rather rarely (since multi-touch emulation is usually off), it's a waste to have that callback always active. So OpenGLES has now an ability to enable / disable framebuffer update callback, and emulator needs to catch up with that change. Change-Id: Iee028ed79f1d9472c3f31bbfbcb5676c4716c34c
Diffstat (limited to 'android')
-rw-r--r--android/multitouch-port.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/android/multitouch-port.c b/android/multitouch-port.c
index 7cb9656..d872b30 100644
--- a/android/multitouch-port.c
+++ b/android/multitouch-port.c
@@ -22,6 +22,7 @@
#include "android/sdk-controller-socket.h"
#include "android/multitouch-port.h"
#include "android/globals.h" /* for android_hw */
+#include "android/opengles.h"
#include "android/utils/misc.h"
#include "android/utils/jpeg-compress.h"
#include "android/utils/debug.h"
@@ -247,14 +248,26 @@ _on_multitouch_port_connection(void* opaque,
case SDKCTL_PORT_DISCONNECTED:
D("Multi-touch: SDK Controller is disconnected");
+ // Disable OpenGLES framebuffer updates.
+ if (android_hw->hw_gpu_enabled) {
+ android_setPostCallback(NULL, NULL);
+ }
break;
case SDKCTL_PORT_ENABLED:
D("Multi-touch: SDK Controller port is enabled.");
+ // Enable OpenGLES framebuffer updates.
+ if (android_hw->hw_gpu_enabled) {
+ android_setPostCallback(multitouch_opengles_fb_update, NULL);
+ }
break;
case SDKCTL_PORT_DISABLED:
D("Multi-touch: SDK Controller port is disabled.");
+ // Disable OpenGLES framebuffer updates.
+ if (android_hw->hw_gpu_enabled) {
+ android_setPostCallback(NULL, NULL);
+ }
break;
case SDKCTL_HANDSHAKE_CONNECTED: