aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2012-05-15 07:59:51 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2012-05-15 07:59:51 -0700
commit6df71197252e119baccbe4dd060935222af4f8ba (patch)
tree7ea2d2aca6744b1b96f57905316dd2a8ee782ec5 /android
parent86daf2d663697d86d4c20cf571c3c4b66c67d1a5 (diff)
downloadexternal_qemu-6df71197252e119baccbe4dd060935222af4f8ba.zip
external_qemu-6df71197252e119baccbe4dd060935222af4f8ba.tar.gz
external_qemu-6df71197252e119baccbe4dd060935222af4f8ba.tar.bz2
Refresh stale SdkController screen.
When MT handler gets deactivated, and then activated again, it shows a stale emulator display, since it didn't have a chance to catch up with emulator display updates. This CL ensures that entire emulator display is pushed to the device when MT handler gets activated. Change-Id: I58c1680f50e2af3e6afa0518f6bcaa3ed087638d
Diffstat (limited to 'android')
-rw-r--r--android/multitouch-port.c2
-rw-r--r--android/multitouch-screen.c18
-rw-r--r--android/multitouch-screen.h5
3 files changed, 24 insertions, 1 deletions
diff --git a/android/multitouch-port.c b/android/multitouch-port.c
index d872b30..faefdbf 100644
--- a/android/multitouch-port.c
+++ b/android/multitouch-port.c
@@ -260,6 +260,8 @@ _on_multitouch_port_connection(void* opaque,
if (android_hw->hw_gpu_enabled) {
android_setPostCallback(multitouch_opengles_fb_update, NULL);
}
+ /* Refresh (possibly stale) device screen. */
+ multitouch_refresh_screen();
break;
case SDKCTL_PORT_DISABLED:
diff --git a/android/multitouch-screen.c b/android/multitouch-screen.c
index 59d4d75..155218a 100644
--- a/android/multitouch-screen.c
+++ b/android/multitouch-screen.c
@@ -87,7 +87,7 @@ typedef struct MTSState {
} MTSState;
/* Default multi-touch screen descriptor */
-static MTSState _MTSState;
+static MTSState _MTSState = { 0 };
/* Pushes event to the event device. */
static void
@@ -376,6 +376,22 @@ multitouch_opengles_fb_update(void* context,
_mt_fb_common_update(mts_state, 0, 0, w, h);
}
+void multitouch_refresh_screen(void)
+{
+ MTSState* const mts_state = &_MTSState;
+
+ /* Make sure MT port is initialized. */
+ if (!_is_mt_initialized) {
+ return;
+ }
+
+ /* Lets see if any updates have been received so far. */
+ if (NULL != mts_state->current_fb) {
+ _mt_fb_common_update(mts_state, 0, 0, mts_state->fb_header.disp_width,
+ mts_state->fb_header.disp_height);
+ }
+}
+
void
multitouch_init(AndroidMTSPort* mtsp)
{
diff --git a/android/multitouch-screen.h b/android/multitouch-screen.h
index 95ae86a..901d76e 100644
--- a/android/multitouch-screen.h
+++ b/android/multitouch-screen.h
@@ -95,4 +95,9 @@ extern void multitouch_opengles_fb_update(void* context,
int type,
unsigned char* pixels);
+/* Pushes the entire framebuffer to the device. This will force the device to
+ * refresh the entire screen.
+ */
+extern void multitouch_refresh_screen(void);
+
#endif /* ANDROID_MULTITOUCH_SCREEN_H_ */