From nobody Tue Nov 26 13:45:57 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=1707825692; cv=none; d=zohomail.com; s=zohoarc; b=d+0HmQXbp81dSBh9xf5aumtAKvoGmiTndgDpJ7ceKLbe+LTrlunTOu3dYyGrtlTD0m7g4KHwPrmxaV8JIeyLnxdjtAQTK297jobOj5o13k2fsEuqkhzx9AZXkoEAooA1kzfERuBs7J6lcJGY2U1B4nHxv9UAVCBnvtS0xYmK50c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707825692; 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=YP3Dh5Ld2aL9PG8iC/HbW7bYRrI90NMxs4r4j0qaly5HPjOewLoGiEI/vd5X2BsBcourI6e+XGsQoqpg9Y/5UZ1QPZL1modBIm7BJtvTRoKCEH/prlLvWgBPs8KUnUBfKXYKcW0bnTa6PshSiYtgXZbUs/OCh2VtbfGjcU4HTis= 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 1707825691701929.340911499967; Tue, 13 Feb 2024 04:01:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZrTT-0002ht-NF; Tue, 13 Feb 2024 07:01:19 -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 1rZrTR-0002ad-IX for qemu-devel@nongnu.org; Tue, 13 Feb 2024 07:01:17 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZrTP-0000uN-Uc for qemu-devel@nongnu.org; Tue, 13 Feb 2024 07:01:17 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1d7881b1843so38445715ad.3 for ; Tue, 13 Feb 2024 04:01:15 -0800 (PST) Received: from localhost ([157.82.207.134]) by smtp.gmail.com with UTF8SMTPSA id li15-20020a170903294f00b001d94678a76csm1963784plb.117.2024.02.13.04.01.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Feb 2024 04:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1707825674; x=1708430474; 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=S9KmQXpcmIBEeY+EII/fhc1xjEklxUTD3bEPyzVBLOBpNivIIaAgYUbry8zSECt/Z8 AfppmJ75h1mBjIQwk4RnRqKX5acIM8DJN0mvrbWCxNT816O7AWzRNvM5WYNRn642O2bx Bw2lpJDrrQsfcVEQ+Ok2aDWoBpy+qCJoGh3Tc+MgVvrHayYYiUi7mtL0dBwKIDNjLUpK OXGK5/LW2hBoc1qziq5e/Sxdgo7ZaX7ou1PNaZFvB3N2JprqF8WZ4Sjc2Er2/61cTc6o Eiw72CC6YQ/D/q8Z5U8LXNDRZRLWxkXPJm4LoXSCN0t1vuOevt22QzLYdq+jknp9gIGb bE6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707825674; x=1708430474; 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=pBLVGllBtQJh1AU2c5ZcIy99ISJw1Pry2q4j9A09BilUXa2FDSl+lAMM7cpX700tih ubzoNnHgpiRINyVwsLWlGYQZ+NhwvSH6kgWWJrJ6yfaZ3NbpjrDtotWCmYvzlOmEJiky 8entFAyI9r1+hCB+t7lWPCQZHr8pht2Y71Nx9u36ON/7lLsC6nQbc3Y83fm2Zavl+f4/ kKnY5zG/J9/ZRQTMZBqwzIHiWUzy6g/J3VCPOqzVmzdLu9O5AQbKoWtaHWdkYYCpmlzf x3OvufOpIm5+6usb0Nk3hhxk2SvqUrcLvchWrB9h3SqghzY1uMLrSJPXwT0o+sIPxUVc 4Jyw== X-Gm-Message-State: AOJu0YxX4/yGoS/I5TXi/4ZNTk0mLsN/EThu4of3vKap0A6z6gvGpCOj VdySmXwFXnk+XpQHLg6+4mtxG4/alk4/R6I77QPOUOrCF8Edtpwipm75b3g1iZP13jD2cyzs5T+ o X-Google-Smtp-Source: AGHT+IFEPEgeUbLtBoYh+ZGl7O2zr+BI/9Rwjd81YpcoHv8+gSJsZ6/tS/OhtCsTyJHC8Y+rdgk6wg== X-Received: by 2002:a17:902:680e:b0:1db:3d36:507b with SMTP id h14-20020a170902680e00b001db3d36507bmr931771plk.44.1707825674241; Tue, 13 Feb 2024 04:01:14 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWMLEE+IW2DNt92xe60UZtqFhCGVy/DFF5MEMPlcTMZrMhKfDBMRZMvCjBwYQREbQHaU2zaMhgCy3T/ReuLg+0xZefSwg+MgTHiVtjC+9fXeE/nxO+iwxvFzTxoMt1BrV6lUFXX6bvkPB3cilqOeEB9CMbr2r1Piha+gGk16Zec4CMusMjHJxVlwIthspYDt9AJTiLknIqn2BCgNXPrrkLgUhL7NYLqEDubgcbziIyNucs2IMW/hKGUnPWTKhc06mgogzzuwmg5T7tn From: Akihiko Odaki Date: Tue, 13 Feb 2024 21:00:56 +0900 Subject: [PATCH v9 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: <20240213-cocoa-v9-2-d5a5e1bf0490@daynix.com> References: <20240213-cocoa-v9-0-d5a5e1bf0490@daynix.com> In-Reply-To: <20240213-cocoa-v9-0-d5a5e1bf0490@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::630; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x630.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: 1707825694129100003 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