diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2012-04-11 13:22:48 -0700 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2012-04-11 13:22:48 -0700 |
commit | 1a820e90d8848c6b0ac7c78b5a2e8b28c9738a3a (patch) | |
tree | 6d7da6487df206f892f3629f62ec71a2d0331fe1 /android/multitouch-port.c | |
parent | b12c531a21d1e6edcc28dcfcd4ea63bd36db30c1 (diff) | |
download | external_qemu-1a820e90d8848c6b0ac7c78b5a2e8b28c9738a3a.zip external_qemu-1a820e90d8848c6b0ac7c78b5a2e8b28c9738a3a.tar.gz external_qemu-1a820e90d8848c6b0ac7c78b5a2e8b28c9738a3a.tar.bz2 |
Enable multi-touch emulation with -gpu on
This CL implements a callback that gets invoked by OpenGLES emulator on it framebuffer
updates. This allows transferring framebuffer changes to the supporting device.
Proper implementation of this new callback also required changes to JPEG compression,
addressing:
1. OpenGLES framebuffer format is RGBA8889, which required implementing line conversion
for this format.
2. OpenGLES framebuffer is (or at least could be) bottom-up arranged. This requires changes
to the compressor, so it compresses the FB starting from the bottom, so the resulting
image is up-bottom.
Change-Id: Icd4efbe4a251c838adfa3518decbfc43a7ef06c8
Diffstat (limited to 'android/multitouch-port.c')
-rw-r--r-- | android/multitouch-port.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/android/multitouch-port.c b/android/multitouch-port.c index c8e3ca5..9a9313c 100644 --- a/android/multitouch-port.c +++ b/android/multitouch-port.c @@ -409,10 +409,12 @@ static void _fb_compress(const AndroidMTSPort* mtsp, const MTFrameHeader* fmt, const uint8_t* fb, - int jpeg_quality) + int jpeg_quality, + int ydir) { jpeg_compressor_compress_fb(mtsp->jpeg_compressor, fmt->x, fmt->y, fmt->w, - fmt->h, fmt->bpp, fmt->bpl, fb, jpeg_quality); + fmt->h, fmt->disp_height, fmt->bpp, fmt->bpl, + fb, jpeg_quality, ydir); } int @@ -420,7 +422,8 @@ mts_port_send_frame(AndroidMTSPort* mtsp, MTFrameHeader* fmt, const uint8_t* fb, async_send_cb cb, - void* cb_opaque) + void* cb_opaque, + int ydir) { char* query; int blob_size, off; @@ -432,7 +435,7 @@ mts_port_send_frame(AndroidMTSPort* mtsp, /* Compress framebuffer region. 10% quality seems to be sufficient. */ fmt->format = MTFB_JPEG; - _fb_compress(mtsp, fmt, fb, 10); + _fb_compress(mtsp, fmt, fb, 10, ydir); /* Total size of the blob: header + JPEG image. */ blob_size = sizeof(MTFrameHeader) + |