From patchwork Sun Jan 12 22:52:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 23143 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EE57E20A64 for ; Sun, 12 Jan 2014 22:56:44 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id z10sf4100042pdj.5 for ; Sun, 12 Jan 2014 14:56:44 -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:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=0Bozf6xcL/jX6g1EloqDMK4ELEteq+KQ1q4WTFDsfHo=; b=N6c22ajsd5s67V+9lAdVbrv8GymtAqxJ/awR36fqMzcQic0vks/KLto+4QIfOCClPu zRWlmuaYbKXWKp6VAbCyNGC+yaJuac9I+/bGscNEXMvGWgoguCjPHLKeHfs4iPjFwW03 s0Hl6tkVdQLXj6rnhq+5EgNOXmtx3L0MmlfDZI9nKJTVtdBe2m/DANAUPh2YotUEsHCJ 841pbMHxbragmhdp6YMWzQtK9Fqi89V9c1U3Iw7Gg3UggB04b4cl4wbqK8yxV3s3mM9y T1KiV3U2bLVTNds4h21FwchHZEz/AG1uo6xBmy3hVYWRByJpZJQVGatUII7yOyKZypCs E3CQ== X-Gm-Message-State: ALoCoQmKb1pGUuRVKPRzGOjpGj2pgzcRmmNvxnMcRcHQ0cfKj0w0+i7IKUYxsXMWgS09Tjwo6SmG X-Received: by 10.66.193.104 with SMTP id hn8mr1269550pac.46.1389567404205; Sun, 12 Jan 2014 14:56:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.120.164 with SMTP id ld4ls2196619qeb.51.gmail; Sun, 12 Jan 2014 14:56:44 -0800 (PST) X-Received: by 10.58.7.1 with SMTP id f1mr15903276vea.15.1389567404097; Sun, 12 Jan 2014 14:56:44 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id n8si1236194vdv.16.2014.01.12.14.56.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 12 Jan 2014 14:56:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 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.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so4794870veb.26 for ; Sun, 12 Jan 2014 14:56:44 -0800 (PST) X-Received: by 10.58.180.227 with SMTP id dr3mr405507vec.36.1389567404023; Sun, 12 Jan 2014 14:56:44 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp92972ved; Sun, 12 Jan 2014 14:56:43 -0800 (PST) X-Received: by 10.49.63.164 with SMTP id h4mr33200856qes.62.1389567403475; Sun, 12 Jan 2014 14:56:43 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n9si16061525qas.103.2014.01.12.14.56.43 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 12 Jan 2014 14:56:43 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:39780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2TxS-0003FT-HY for patch@linaro.org; Sun, 12 Jan 2014 17:56:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2Ttn-000661-Bb for qemu-devel@nongnu.org; Sun, 12 Jan 2014 17:52:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2Ttm-00057E-9C for qemu-devel@nongnu.org; Sun, 12 Jan 2014 17:52:55 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:44745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2Ttm-00055e-2o for qemu-devel@nongnu.org; Sun, 12 Jan 2014 17:52:54 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1W2TtX-00085z-7h; Sun, 12 Jan 2014 22:52:39 +0000 From: Peter Maydell To: Anthony Liguori Date: Sun, 12 Jan 2014 22:52:36 +0000 Message-Id: <1389567158-31066-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1389567158-31066-1-git-send-email-peter.maydell@linaro.org> References: <1389567158-31066-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Blue Swirl , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PULL 7/9] ui/cocoa: Draw black rectangle if we have no data yet X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.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.181 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Message-id: 1387853507-26298-3-git-send-email-peter.maydell@linaro.org --- ui/cocoa.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 6a1f6b6..22ec29b 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -321,7 +321,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