qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Henry Harrington <henry.harrington@gmail.com>
To: qemu-devel@nongnu.org
Cc: andreas.faerber@web.de, Henry Harrington <henry.harrington@gmail.com>
Subject: [Qemu-devel] [PATCH] cocoa: Fix VBE function Set Display Start
Date: Wed, 21 Nov 2012 19:08:43 +0000	[thread overview]
Message-ID: <1353524923-15419-1-git-send-email-henry.harrington@gmail.com> (raw)

Register a dpy_gfx_setdata callback so that the Cocoa code
is notified whenever the screen start address changes.

Signed-off-by: Henry Harrington <henry.harrington@gmail.com>
---
 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

             reply	other threads:[~2012-11-21 19:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 19:08 Henry Harrington [this message]
2012-11-27  5:03 ` [Qemu-devel] [PATCH] cocoa: Fix VBE function Set Display Start Andreas Färber
2012-11-27 18:54   ` Henry Harrington

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353524923-15419-1-git-send-email-henry.harrington@gmail.com \
    --to=henry.harrington@gmail.com \
    --cc=andreas.faerber@web.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).