From 8de6a30e3b2035b39f308febe2f9536671547096 Mon Sep 17 00:00:00 2001 From: Vladimir Chtchetkine Date: Fri, 11 May 2012 07:14:14 -0700 Subject: 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 --- android/multitouch-port.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'android') 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: -- cgit v1.1