From patchwork Tue May 19 08:23:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 48733 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EFA6421411 for ; Tue, 19 May 2015 08:26:31 +0000 (UTC) Received: by wizk4 with SMTP id k4sf4321867wiz.2 for ; Tue, 19 May 2015 01:26:31 -0700 (PDT) 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=rczNASTqL59KUC+yQn+R7wdoGlUjumgH7xP7k+Okedw=; b=BBQtRla+Gd0DvjBaBS0jveL5Q30K0Tt6FKhHgWK017QJVlWzx72q3qFGqMk+9jqMg0 PfmSsn+M3d/fBA0pj229YbnFgR4jBpNyf/uLs3OruVxv6/97GLLL344R1BCq4TmKqMAn IZ+uo0K+y+tMdrZuNx62y02Z8NGWf3QVNSSD2jp19At2YBPL+R3l+/AAE7nOtMNZPoz9 1481jW5F9F+Z/+7SQFqWVU+6JyB6fzl+b84d+BMR/CzQv9+90ZxlEVqQhwK9ik8ZE5lm vQPRI3FzudJY9gk3gNOk0yJoMTPl6Lp/rU0vqSM9rWcXaZ0JKi6wnEQCAO7H/uqrcsPZ M+0A== X-Gm-Message-State: ALoCoQnQd88jwARKWPQlHDm4zYVVRxL6CW3Cc6TAXQ6r8ckN50hvi6Ds4Gk2BInkxVpIPicEo5Ak X-Received: by 10.180.35.164 with SMTP id i4mr1159763wij.0.1432023991224; Tue, 19 May 2015 01:26:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.196 with SMTP id u4ls26237lau.6.gmail; Tue, 19 May 2015 01:26:31 -0700 (PDT) X-Received: by 10.112.171.101 with SMTP id at5mr21050269lbc.66.1432023990993; Tue, 19 May 2015 01:26:30 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id yg6si8365312lbb.137.2015.05.19.01.26.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2015 01:26:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by lagv1 with SMTP id v1so11567888lag.3 for ; Tue, 19 May 2015 01:26:30 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr20160100lbc.41.1432023990594; Tue, 19 May 2015 01:26:30 -0700 (PDT) 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.112.108.230 with SMTP id hn6csp626216lbb; Tue, 19 May 2015 01:26:29 -0700 (PDT) X-Received: by 10.140.18.141 with SMTP id 13mr851272qgf.96.1432023986887; Tue, 19 May 2015 01:26:26 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o90si925625qgd.117.2015.05.19.01.26.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 May 2015 01:26:26 -0700 (PDT) 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]:44427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yucr3-0001eP-Sg for patch@linaro.org; Tue, 19 May 2015 04:26:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yucol-0006Fz-4K for qemu-devel@nongnu.org; Tue, 19 May 2015 04:24:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yucoi-0006HK-Ge for qemu-devel@nongnu.org; Tue, 19 May 2015 04:24:02 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yucoi-0006GF-9R for qemu-devel@nongnu.org; Tue, 19 May 2015 04:24:00 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Yucoe-0000bO-1Q; Tue, 19 May 2015 09:23:56 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 19 May 2015 09:23:49 +0100 Message-Id: <1432023835-2274-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1432023835-2274-1-git-send-email-peter.maydell@linaro.org> References: <1432023835-2274-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: =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PULL 04/10] ui/cocoa: Drop tests for CGImageCreateWithImageInRect support 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) 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 The code that tries to test at both compiletime and runtime for whether CGImageCreateWithImageInRect is supported provokes a compile warning on OSX 10.3: ui/cocoa.m:378:13: warning: comparison of function 'CGImageCreateWithImageInRect' equal to a null pointer is always false[-Wtautological-pointer-compare] if (CGImageCreateWithImageInRect == NULL) { // test if "CGImageCreateWithImageInRect" is supported on host at runtime ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ The simplest way to deal with this is just to drop this code, since we don't in practice support OSX 10.4 anyway. (10.5 was released in 2007 and is the last PPC version, so is the earliest we really need to continue to support at all.) Signed-off-by: Peter Maydell Message-id: 1431296361-16981-2-git-send-email-peter.maydell@linaro.org --- ui/cocoa.m | 50 ++++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index d1d29bc..6e69952 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -374,40 +374,30 @@ QemuCocoaView *cocoaView; 0, //interpolate kCGRenderingIntentDefault //intent ); -// test if host supports "CGImageCreateWithImageInRect" at compile time -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) - if (CGImageCreateWithImageInRect == NULL) { // test if "CGImageCreateWithImageInRect" is supported on host at runtime -#endif - // compatibility drawing code (draws everything) (OS X < 10.4) - CGContextDrawImage (viewContextRef, CGRectMake(0, 0, [self bounds].size.width, [self bounds].size.height), imageRef); -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) - } else { - // selective drawing code (draws only dirty rectangles) (OS X >= 10.4) - const NSRect *rectList; + // selective drawing code (draws only dirty rectangles) (OS X >= 10.4) + const NSRect *rectList; #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) - NSInteger rectCount; + NSInteger rectCount; #else - int rectCount; + int rectCount; #endif - int i; - CGImageRef clipImageRef; - CGRect clipRect; - - [self getRectsBeingDrawn:&rectList count:&rectCount]; - for (i = 0; i < rectCount; i++) { - clipRect.origin.x = rectList[i].origin.x / cdx; - clipRect.origin.y = (float)screen.height - (rectList[i].origin.y + rectList[i].size.height) / cdy; - clipRect.size.width = rectList[i].size.width / cdx; - clipRect.size.height = rectList[i].size.height / cdy; - clipImageRef = CGImageCreateWithImageInRect( - imageRef, - clipRect - ); - CGContextDrawImage (viewContextRef, cgrect(rectList[i]), clipImageRef); - CGImageRelease (clipImageRef); - } + int i; + CGImageRef clipImageRef; + CGRect clipRect; + + [self getRectsBeingDrawn:&rectList count:&rectCount]; + for (i = 0; i < rectCount; i++) { + clipRect.origin.x = rectList[i].origin.x / cdx; + clipRect.origin.y = (float)screen.height - (rectList[i].origin.y + rectList[i].size.height) / cdy; + clipRect.size.width = rectList[i].size.width / cdx; + clipRect.size.height = rectList[i].size.height / cdy; + clipImageRef = CGImageCreateWithImageInRect( + imageRef, + clipRect + ); + CGContextDrawImage (viewContextRef, cgrect(rectList[i]), clipImageRef); + CGImageRelease (clipImageRef); } -#endif CGImageRelease (imageRef); } }