From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbFfK-0000RD-MR for qemu-devel@nongnu.org; Wed, 21 Nov 2012 14:08:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbFfI-0008Gj-Qp for qemu-devel@nongnu.org; Wed, 21 Nov 2012 14:08:54 -0500 Received: from mail-we0-f173.google.com ([74.125.82.173]:47621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbFfI-0008FZ-Kg for qemu-devel@nongnu.org; Wed, 21 Nov 2012 14:08:52 -0500 Received: by mail-we0-f173.google.com with SMTP id z2so516454wey.4 for ; Wed, 21 Nov 2012 11:08:51 -0800 (PST) From: Henry Harrington Date: Wed, 21 Nov 2012 19:08:43 +0000 Message-Id: <1353524923-15419-1-git-send-email-henry.harrington@gmail.com> Subject: [Qemu-devel] [PATCH] cocoa: Fix VBE function Set Display Start List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: andreas.faerber@web.de, Henry Harrington Register a dpy_gfx_setdata callback so that the Cocoa code is notified whenever the screen start address changes. Signed-off-by: Henry Harrington --- ui/cocoa.m | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 87d2e44..97010bc 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -265,6 +265,7 @@ static int cocoa_keycode_to_qemu(int keycode) BOOL isTabletEnabled; } - (void) resizeContentToWidth:(int)w height:(int)h displayState:(DisplayState *)ds; +- (void) updateDataOffset:(DisplayState *)ds; - (void) grabMouse; - (void) ungrabMouse; - (void) toggleFullScreen:(id)sender; @@ -429,6 +430,17 @@ QemuCocoaView *cocoaView; [self setFrame:NSMakeRect(cx, cy, cw, ch)]; } +- (void) updateDataOffset:(DisplayState *)ds +{ + COCOA_DEBUG("QemuCocoaView: UpdateDataOffset\n"); + + // update screenBuffer + if (dataProviderRef) + CGDataProviderRelease(dataProviderRef); + + dataProviderRef = CGDataProviderCreateWithData(NULL, ds_get_data(ds), ds_get_width(ds) * 4 * ds_get_height(ds), NULL); +} + - (void) toggleFullScreen:(id)sender { COCOA_DEBUG("QemuCocoaView: toggleFullScreen\n"); @@ -1004,6 +1016,11 @@ static void cocoa_refresh(DisplayState *ds) vga_hw_update(); } +static void cocoa_setdata(DisplayState *ds) +{ + [cocoaView updateDataOffset:ds]; +} + static void cocoa_cleanup(void) { COCOA_DEBUG("qemu_cocoa: cocoa_cleanup\n"); @@ -1020,6 +1037,7 @@ void cocoa_display_init(DisplayState *ds, int full_screen) dcl->dpy_gfx_update = cocoa_update; dcl->dpy_gfx_resize = cocoa_resize; dcl->dpy_refresh = cocoa_refresh; + dcl->dpy_gfx_setdata = cocoa_setdata; register_displaychangelistener(ds, dcl); -- 1.7.6.1