From patchwork Tue Dec 24 02:51:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22742 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E7E9720540 for ; Tue, 24 Dec 2013 02:51:50 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf16267404pdj.3 for ; Mon, 23 Dec 2013 18:51:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=X8vATk7IMhLAu6NynMcntf9LtIB7co7uY0vhOmiT4fQ=; b=LMS6gGP8f0UNdCGfhz9OE297X57Mh2q813uO7dZszRNxJJAuknV7VlF2rablu+difV C6aUNJI0Wg31B8QJY4qP8H4df3RP+C4NOfgYRSWq8iH0Ws91uJz73msEV9onM8nfe3HC Vi6Fy7ydBJH0KeRz8CJQEeHLqKjDn9hP80nJxy53hhSZD3EqUQyhO7NiNwfLpLZZoLQW Fz1mQgzAQIcW7sbKHKdzRDw1tZPsOYEV2AyNNlCTQ8+BIlcQqe08mkD9gmP0rC0DUHeW TcQ4uemBM5wT0y8w08hO7yAgTwdKwp3HEPouobuFkrY9T8fzXcwkXh41IAUX1vsOtZ0E E0fg== X-Gm-Message-State: ALoCoQmrExDm+WN/nroQOGDpC88Fb28mQBnR6tjiSoSRG445lqVb2/MCMCbfxSIehOapAEi6gdXM X-Received: by 10.66.190.197 with SMTP id gs5mr11418257pac.14.1387853509851; Mon, 23 Dec 2013 18:51:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.29.197 with SMTP id m5ls1804202qeh.43.gmail; Mon, 23 Dec 2013 18:51:49 -0800 (PST) X-Received: by 10.52.23.13 with SMTP id i13mr12720479vdf.0.1387853509682; Mon, 23 Dec 2013 18:51:49 -0800 (PST) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id eg18si5472798vcb.19.2013.12.23.18.51.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 18:51:49 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jy13so3374988veb.27 for ; Mon, 23 Dec 2013 18:51:49 -0800 (PST) X-Received: by 10.53.13.44 with SMTP id ev12mr12729504vdd.17.1387853509583; Mon, 23 Dec 2013 18:51:49 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp266946ved; Mon, 23 Dec 2013 18:51:49 -0800 (PST) X-Received: by 10.180.105.199 with SMTP id go7mr20807332wib.53.1387853508523; Mon, 23 Dec 2013 18:51:48 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id q13si8154513wiv.34.2013.12.23.18.51.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Dec 2013 18:51:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VvI5z-0006qk-5H; Tue, 24 Dec 2013 02:51:47 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH 2/2] ui/cocoa: Draw black rectangle if we have no data yet Date: Tue, 24 Dec 2013 02:51:47 +0000 Message-Id: <1387853507-26298-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387853507-26298-1-git-send-email-peter.maydell@linaro.org> References: <1387853507-26298-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If our redraw method is called before we have any data from the guest, then draw a black rectangle rather than leaving the window empty. This mostly only matters when the guest machine has no framebuffer device, but it is more in line with the behaviour of other QEMU UIs. Signed-off-by: Peter Maydell --- ui/cocoa.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 9e22d21..39c62ad 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -322,7 +322,12 @@ QemuCocoaView *cocoaView; CGContextSetShouldAntialias (viewContextRef, NO); // draw screen bitmap directly to Core Graphics context - if (dataProviderRef) { + if (!dataProviderRef) { + // Draw request before any guest device has set up a framebuffer: + // just draw an opaque black rectangle + CGContextSetRGBFillColor(viewContextRef, 0, 0, 0, 1.0); + CGContextFillRect(viewContextRef, NSRectToCGRect(rect)); + } else { CGImageRef imageRef = CGImageCreate( screen.width, //width screen.height, //height