From nobody Tue Nov 26 12:18:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1707885192; cv=none; d=zohomail.com; s=zohoarc; b=BwNbUg/mO0etOFHJ/s38G8tvh9Sw3d/GTzPtWJaZpnd1Qy62HlIob9YyOyuDs69M4alBPH8WPeM9hWAYpOwXSUnbr6YbJ4PruQ3b4/4W1jk5NYeKfiJhL5yF+BB9PMReKMFEVW8nWI55Sz5D0urmKgyHis9XkooDQ4aYt/6vQL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707885192; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LY24CVC1YBoU/Hz2w0W3aUzItIgVLNe8my76vH7E4TA=; b=hSnJMHu1v8ufr5BPhCbCn51shVVvjUDBsIdcDy50PMNseAeMBbTCmF+TNTdz/Ap+KxOjeb2eR3vtoeSeMlHd41ywKmQ2bAaXapwafDLc5VRR7WT5rU5J+oPJaQ+IzA1jahV+evkR8blb5D2ZECfNKkV3KgYGHKG9tr8rhceMdAE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17078851928361012.010702921688; Tue, 13 Feb 2024 20:33:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ra6wh-0001ux-Si; Tue, 13 Feb 2024 23:32:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ra6wg-0001ub-OB for qemu-devel@nongnu.org; Tue, 13 Feb 2024 23:32:30 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ra6we-00067w-9e for qemu-devel@nongnu.org; Tue, 13 Feb 2024 23:32:30 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1d94b222a3aso42148685ad.2 for ; Tue, 13 Feb 2024 20:32:27 -0800 (PST) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id o9-20020a170902d4c900b001d739667fc3sm2741586plg.207.2024.02.13.20.32.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Feb 2024 20:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1707885147; x=1708489947; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LY24CVC1YBoU/Hz2w0W3aUzItIgVLNe8my76vH7E4TA=; b=RvYkqn6ffce8RQmTCku5gN8j1fgW0RpmIyurWtnggvEguONO5qJfWt0W8mMlWza7vB iWK7sfa59uwoIr0CMWWbtLeUcYsPD/Bj1xK7aaUP5lviEfsILZBcXGnHB1YXEWdkEpPo ycSDd5KBBR5qEuWSQIqpLtesSfbXmOJ6hi7dHyIAiH8f/a4z4ogLdfSYitVrGXW0RQFY VIJnvUbmbZdpUep/IsZwduAwa3qBEOB8IPkPcXce/IDR2mulgxGQ76qABFGQZGjKU41W ttpehy4mj5dIygbTEv2BvUPX1/3x9rN+jsZylXKYU7rNp+OgF0rT2iBwtf+F6toJTzeE tybQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707885147; x=1708489947; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LY24CVC1YBoU/Hz2w0W3aUzItIgVLNe8my76vH7E4TA=; b=Bz39tF5RCLaoJXIQ49LEv3+YnInHzAuVx+5ctW8tHEB9Cfxy6AsyMEcUPi9Nz7abi7 vbPSZ968BqI+9aK1aiB3PXfjAqFJ1RfHMpOFPNhDLy4s8pNgtdihtvw2IMIcIpnYkXFt 7nSnGJcLGCrsuFcgxx4FOzQmw65BbX8jS+miKL4cUbrr0Sqdj3K8QB9qCM2jIVUQMaVm uJBDXuvPoR6nEs6bvQOQuYfpGUQP98AiXoAwlBBW8V4wTzPclBAP+wMXc4qLgCKOrvk6 j6W/zq8D5fnxfd8yk3yTeD+iD4HAjTpZmwDeH8ApO+2bqqMTrFG+ml4GU66aveZvfzV9 pXVg== X-Gm-Message-State: AOJu0Yx+z6bYdHuiVJRMMPOiE+KVU1/3hWY5NC2VFZdpW3jo4Hal9EEf ZC/cbIM9kOjtXlgt0m70+AB7t5ZDAIHzKOX0yQOyqQwZngY1UhUdQCQdWNoxftZgyQfyvjwXLZ7 2 X-Google-Smtp-Source: AGHT+IE2hxlKwiImhrUDdBOKl1qIgd/bV4e80gm8+cE8WDP+W4ZEUrT8A/gOXJZDzuJBNvPhsZNT2g== X-Received: by 2002:a17:902:ecc1:b0:1d8:e7a4:3474 with SMTP id a1-20020a170902ecc100b001d8e7a43474mr1815886plh.68.1707885146889; Tue, 13 Feb 2024 20:32:26 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXGw50+XzAc3K2+zOJ1/dAT1sTy+8PZqWcL4MrKjEv9dmlcuf4T1S++xKXCMvCOkEa/OL6cOkgJIHCm5KXeo+EfyK4uaTxsOUwiaoMZOPURmcNFAZW/JwvzWN/4to1Nw5G+dwJmhLHn62qQOyHKEX6EVvpv7SoyfdLpelE5+/CEWXOT9EpZL6K7NfRj79mM/ytIKgNEgs2hz1Wx/2VL8d1Ir7WtXNyimWgGjNff+ZexsGbtBYo01KMYhS9U20MKh03tIzJVJP90NVyg From: Akihiko Odaki Date: Wed, 14 Feb 2024 13:32:02 +0900 Subject: [PATCH v10 2/6] ui/cocoa: Scale with NSView instead of Core Graphics MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240214-cocoa-v10-2-c7ffe5d9f08a@daynix.com> References: <20240214-cocoa-v10-0-c7ffe5d9f08a@daynix.com> In-Reply-To: <20240214-cocoa-v10-0-c7ffe5d9f08a@daynix.com> To: Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Marek Glogowski , BALATON Zoltan , Rene Engel Cc: qemu-devel@nongnu.org, Akihiko Odaki X-Mailer: b4 0.12.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::62d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1707885193908100005 Core Graphics is not accelerated and slow. Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index fe0eb74b0743..cb6090905999 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -496,10 +496,8 @@ - (void) drawRect:(NSRect) rect =20 [self getRectsBeingDrawn:&rectList count:&rectCount]; for (i =3D 0; i < rectCount; i++) { - clipRect.origin.x =3D rectList[i].origin.x / cdx; - clipRect.origin.y =3D (float)h - (rectList[i].origin.y + rectL= ist[i].size.height) / cdy; - clipRect.size.width =3D rectList[i].size.width / cdx; - clipRect.size.height =3D rectList[i].size.height / cdy; + clipRect =3D rectList[i]; + clipRect.origin.y =3D (float)h - (clipRect.origin.y + clipRect= .size.height); clipImageRef =3D CGImageCreateWithImageInRect( imageRef, clipRect @@ -545,6 +543,11 @@ - (void) setContentDimensions } } =20 +- (void) updateBounds +{ + [self setBoundsSize:NSMakeSize(screen.width, screen.height)]; +} + - (void) updateUIInfoLocked { /* Must be called with the BQL, i.e. via updateUIInfo */ @@ -1292,6 +1295,7 @@ - (void)windowDidChangeScreen:(NSNotification *)notif= ication =20 - (void)windowDidResize:(NSNotification *)notification { + [cocoaView updateBounds]; [cocoaView updateUIInfo]; } =20 @@ -1940,16 +1944,7 @@ static void cocoa_update(DisplayChangeListener *dcl, COCOA_DEBUG("qemu_cocoa: cocoa_update\n"); =20 dispatch_async(dispatch_get_main_queue(), ^{ - NSRect rect; - if ([cocoaView cdx] =3D=3D 1.0) { - rect =3D NSMakeRect(x, [cocoaView gscreen].height - y - h, w, = h); - } else { - rect =3D NSMakeRect( - x * [cocoaView cdx], - ([cocoaView gscreen].height - y - h) * [cocoaView cdy], - w * [cocoaView cdx], - h * [cocoaView cdy]); - } + NSRect rect =3D NSMakeRect(x, [cocoaView gscreen].height - y - h, = w, h); [cocoaView setNeedsDisplayInRect:rect]; }); } --=20 2.43.0