From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#73384: [PATCH] Draw coloured stipples on NS Date: Wed, 18 Dec 2024 21:55:44 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25302"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= , 73384@debbugs.gnu.org, Stefan Kangas , JD Smith , Ben Simms To: Arash Esbati Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 18 22:56:29 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tO21q-0006O1-UF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Dec 2024 22:56:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tO21V-0004qa-Eq; Wed, 18 Dec 2024 16:56:05 -0500 Original-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 1tO21T-0004q0-GV for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2024 16:56:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tO21T-0002Tu-8D for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2024 16:56:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:MIME-Version:References:From:Date:To:Subject; bh=pzQfOmZgmrsJopT04DH8kwfLOhrQOHVwIye4Cnx2C9A=; b=tRpnk+2AWtOzrNKsHdyeojIP4+WVvMIdjd8NmYqtgstqmOgvlrSmPZ8UZ3/SGkgU5FVJ6d3KHBNuce+dw7c4hH9LiGOLTPVzO4avBKTvfALn5nJcZyD05O8+0oWBOVILlS4rMGOEO8aiYBbt/Qfi6O+v/w7PP1XwCnuwmJKhkaTKGU0stGBbPOGyVgeTGuifPGiP+3D1T22MAXbI3KxRCMphP5mVnis6uTffjzgnTtaw+Xmym2BB9MUM6itaxMCav92R3kflzlU3Jqy2VEhcP+C9uXUe9F4G9S0SlysHo3jdzuoBpXluCAPPy1hX/bQBr2vRttFjn6nvynGuYKyIHg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tO21T-0003S5-13 for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2024 16:56:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Dec 2024 21:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73384 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73384-submit@debbugs.gnu.org id=B73384.173455895413243 (code B ref 73384); Wed, 18 Dec 2024 21:56:02 +0000 Original-Received: (at 73384) by debbugs.gnu.org; 18 Dec 2024 21:55:54 +0000 Original-Received: from localhost ([127.0.0.1]:36315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO21K-0003RW-58 for submit@debbugs.gnu.org; Wed, 18 Dec 2024 16:55:54 -0500 Original-Received: from dane.soverin.net ([185.233.34.36]:39357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO21I-0003RH-A8 for 73384@debbugs.gnu.org; Wed, 18 Dec 2024 16:55:53 -0500 Original-Received: from smtp.soverin.net (unknown [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4YD6tn6y4BzXyq; Wed, 18 Dec 2024 21:55:45 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.99]) by soverin.net (Postfix) with ESMTPSA id 4YD6tn1n59z5W; Wed, 18 Dec 2024 21:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1734558945; bh=gBeYWjCE49B+7gopyE9xJqCVKybRvK92Thrc0I54FJQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AeruY0fa4lskndLPFZP43xmcQam4/anUZJ12KT7j3n3tolbYBa7FvntJixTxawXjd 7MPBTRNg9hVqS1IzVVxvVrC36KKJtvDFa982QiYCSCbETaHeaBxA08JMax8aoKbJrg IuR8n4l3cK5NODniCJTzufXsUxoHovCj0QEk4FilDpQcIihm48zwupKmx561BfU8DU Jwb1Bo6HeFnI1SmqPdfjdkVvCmAC/MiousMof6xrlUG5xg0tkLDLVN3y/+0MCXgZxA +7NuQ+YAGqV/K8WjUNXCpEU4g4O78m3jwf3aLKrYjbIKDGk/n1SgIp6WM3butDVx4P ucWE5iTILFRnA== X-CMAE-Score: 0 X-CM-Analysis: v=2.4 cv=UsCZN/wB c=1 sm=1 tr=0 ts=676344e1 a=kj9zAlcOel0A:10 a=RZcAm9yDv7YA:10 a=pNIsRpHqy2CaE01BwbgA:9 a=CjuIK1q_8ugA:10 Original-Received: from localhost (faroe.holly.idiocy.org [local]) by faroe.holly.idiocy.org (OpenSMTPD) with ESMTPA id 241bebf9; Wed, 18 Dec 2024 21:55:44 +0000 (UTC) Mail-Followup-To: Alan Third , Arash Esbati , Stefan Kangas , Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= , 73384@debbugs.gnu.org, JD Smith , Ben Simms Content-Disposition: inline In-Reply-To: X-Spampanel-Class: ham X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297349 Archived-At: > +#ifdef NS_IMPL_COCOA > +/* Returns a cached CGImageMask of the stipple pattern */ > +- (CGImageRef)stippleMask > +{ > + if (stippleMask == nil) { > + CGDataProviderRef provider = CGDataProviderCreateWithData (NULL, [bmRep bitmapData], > + [self sizeInBytes], NULL); > + CGImageRef mask = CGImageMaskCreate( > + [self size].width, > + [self size].height, > + 8, 8, [self size].width, > + provider, NULL, 0); There's some weird formatting in this patch. Some of it looks like it's perhaps due to email, but other bits, like the above, just look wrong. Other things I've noticed include C++ comments, //, instead of C comments, /* */. Large blocks of code with no whitespace that is a bit hard to follow. It would be nicer if it was broken up into logical blocks. > + r = NSMakeRect (s->x, s->y + box_line_width, > + s->background_width, > + s->height - 2 * box_line_width); > + NSRectFill (r); > + s->background_filled_p = 1; > + CGImageRef mask = [dpyinfo->bitmaps[face->stipple - 1].img stippleMask]; > + CGRect bounds = CGRectMake (s->x, s->y + box_line_width, > + s->background_width, > + s->height - 2 * box_line_width); NSRect and CGRect are the same thing, so here "r" and "bounds" are identical. It might be worth just having one variable. > + else if (s->stippled_p) { Opening braces go on new lines. Really that's it, Just some polishing required and a proper commit message. Otherwise it looks OK to me. I take it this doesn't require the addition of any extra build flags to bring in CoreGraphics? -- Alan Third