From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ben Simms Newsgroups: gmane.emacs.bugs Subject: bug#73384: [PATCH] Draw coloured stipples on NS Date: Fri, 20 Sep 2024 09:57:21 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000037ce3f0622886479" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23242"; mail-complaints-to="usenet@ciao.gmane.io" To: 73384@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 20 15:34:19 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 1srdm6-0005rj-L5 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Sep 2024 15:34:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srdla-0005yn-4U; Fri, 20 Sep 2024 09:33:46 -0400 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 1srdlY-0005yN-11 for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 09:33:44 -0400 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 1srdlX-00073o-OM for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 09:33:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:MIME-Version:To:Subject; bh=EI5Eo9QK4BopGSVygnx3JnI6mZA4l/Y4ZmhcmN+6AGA=; b=Aht5pZYLCJ2KHMEvT4KA+/qcZE5Fl8I/vZQiK8W5kc49iin5LjDfECZh6vFUDTKpOZQ6Sch+JqvVPS+N1D3H4rYhNGctTh3CXoKxdKEeTmni6H5cRhYL5UQ3Dw1MGlUUSq+MNhWj1SqFfiYtKB2O6rF8PwMXP76rEV2smQfCigXVNUPesaT2VdJgu8xFdRfDXOofhSG1B5OlJ5AcPhAhluucPLPZ9Gxl1blfW7nwi8XNZuzz72lNnxpIqd8hHwvQOF1pyUdLjB4GPrZa1kUfMoIVt/m8pPYQkrvBAX4PsrpaGEPE0bGx/i3W/+9bCsqsmLoMLxFj9ZGyMqGuKPufrw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srdlq-0002p4-C7 for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 09:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ben Simms Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Sep 2024 13:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73384 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.172683921210782 (code B ref -1); Fri, 20 Sep 2024 13:34:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Sep 2024 13:33:32 +0000 Original-Received: from localhost ([127.0.0.1]:34392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srdlK-0002nl-Fe for submit@debbugs.gnu.org; Fri, 20 Sep 2024 09:33:31 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:45000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srYWZ-0000uK-RN for submit@debbugs.gnu.org; Fri, 20 Sep 2024 03:57:58 -0400 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 1srYWH-0002wa-0S for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 03:57:37 -0400 Original-Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1srYWE-0002kg-EJ for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 03:57:36 -0400 Original-Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-7a99e8d5df1so163279285a.2 for ; Fri, 20 Sep 2024 00:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726819053; x=1727423853; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=EI5Eo9QK4BopGSVygnx3JnI6mZA4l/Y4ZmhcmN+6AGA=; b=YybUA3TrMPkgTZgsMEfeaRxgvpM94iumPMBHRA6bVfywegGDWIjORZa4MSlcjpIhLl GdYWbozN8OVL2J1GGWzQU20WzdF9AqI4KkMVOWViiDv3/H34GzEKFeTqZjXM5+X8yPOD 0P/o7ds+KrjY3rnBhAEMgwGvguGXHpP0/M/rL9B8143XHncutba56b0NlEQzOd0+HNac aZMcg9hWyB4OYWTunc6jCxM/TLGucZV2rVzwPiCZ0KmdxTrnPs6WZu9qVuHBk93vTxLb 09L15G7f45rQX3yqOsXnyWd4dnIbId27JEnYIHn4wraHE57+71/Oxyxuc+sPOriDQw2x QT7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819053; x=1727423853; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EI5Eo9QK4BopGSVygnx3JnI6mZA4l/Y4ZmhcmN+6AGA=; b=HROMabLTdnORaoyfhmrrgjkDMSsFObrIQKT86GyDg6DQULgLuT4RcF4Go+fY6x0QsX Fy+k+UbecIF9EkcsAavWNcftZtgbOsTeBQbEVjmR0Vi3PD4jt6CejrKGIpR2zw7CjhJw tC8DbjOKClO5ALKLlZdmzE5U6qB2cJCqbhnKjWpfWMMGddtKrNjWexl66aldprKYEi1d erQDlXqYGYvgIWWXxwCbwSZDLESlLwBBkmQVGD5xtfIX+liicF5UagdrWim43ybVZkTe vAaz8Hg9eULBKj2p8T5ncJdjFWQVH0MZ0cOQlPkBwoo1AY8hm2d472T9xB+zxtrpeDtO cHLQ== X-Gm-Message-State: AOJu0Yz+9OB4URZCf5FPyaCAdHf8m2bnftYAQSRmidwq3AKh9ME3GlSn Rxuudru6SvvtZwPLLu2VBP57BycsQamlBQOcQsUv6WBgTjwgGiwhzPT1RgRNtyxILJJ/9w7j6/U 0ouHYge7++oOOFBT15gupuUYiuu2q2eXb X-Google-Smtp-Source: AGHT+IEA64RG2StSW/+ygpCn+970Jg+S7UHK9u04vn1akVY2yCq/ubhPeJE0MYwjPSOL79QBeUhR/pjoC9moXM5740c= X-Received: by 2002:ac8:5792:0:b0:458:34df:1e5c with SMTP id d75a77b69052e-45b204de3a5mr39149061cf.12.1726819052536; Fri, 20 Sep 2024 00:57:32 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::735; envelope-from=bsimms.simms@gmail.com; helo=mail-qk1-x735.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 20 Sep 2024 09:33:29 -0400 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:292117 Archived-At: --00000000000037ce3f0622886479 Content-Type: text/plain; charset="UTF-8" Hello, I've been advised to submit my patch adding support for drawing coloured stipples on NS Emacs here: >From 87c143b1b77ae02a08b9e1bbe27da57859e28a8d Mon Sep 17 00:00:00 2001 From: Ben Simms Date: Fri, 20 Sep 2024 09:50:47 +0200 Subject: [PATCH] Support drawing coloured stipples This makes use of CoreGraphics, while this works fine on macos systems, I'm unsure how to test this on a GNUStep or other supported NS implementation. --- src/nsimage.m | 17 +++++++++++++--- src/nsterm.h | 4 ++-- src/nsterm.m | 56 +++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 66 insertions(+), 11 deletions(-) diff --git a/src/nsimage.m b/src/nsimage.m index ee72d6e0ea..100af5c3e9 100644 --- a/src/nsimage.m +++ b/src/nsimage.m @@ -28,6 +28,7 @@ Updated by Christian Limpach (chris@nice.ch) /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include +#include #include "lisp.h" #include "dispextern.h" @@ -510,10 +511,20 @@ - (void) setAlphaAtX: (int) x Y: (int) y to: (unsigned char) a } /* Returns a pattern color, which is cached here. */ -- (NSColor *)stippleMask +- (CGImageRef)stippleMask { - if (stippleMask == nil) - stippleMask = [[NSColor colorWithPatternImage: self] retain]; + if (stippleMask == nil) { + CGDataProviderRef provider = CGDataProviderCreateWithData (NULL, [bmRep bitmapData], + [self sizeInBytes], NULL); + id mask = (id)CGImageMaskCreate( + [self size].width, + [self size].height, + 8, 8, [self size].width, + provider, NULL, 0); + + CGDataProviderRelease(provider); + stippleMask = (CGImageRef)[mask retain]; + } return stippleMask; } diff --git a/src/nsterm.h b/src/nsterm.h index 3a713f8e8c..7ec851966f 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -670,7 +670,7 @@ #define NSTRACE_UNSILENCE() { NSBitmapImageRep *bmRep; /* used for accessing pixel data */ unsigned char *pixmapData[5]; /* shortcut to access pixel data */ - NSColor *stippleMask; + CGImageRef stippleMask; @public NSAffineTransform *transform; BOOL smoothing; @@ -687,7 +687,7 @@ #define NSTRACE_UNSILENCE() green: (unsigned char)g blue: (unsigned char)b alpha:(unsigned char)a; - (void)setAlphaAtX: (int)x Y: (int)y to: (unsigned char)a; -- (NSColor *)stippleMask; +- (CGImageRef)stippleMask; - (Lisp_Object)getMetadata; - (BOOL)setFrame: (unsigned int) index; - (void)setTransform: (double[3][3]) m; diff --git a/src/nsterm.m b/src/nsterm.m index 794630de1c..84084f12a4 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3826,9 +3826,28 @@ Function modeled after x_draw_glyph_string_box (). if (s->stippled_p) { + [[NSColor colorWithUnsignedLong:face->background] set]; + 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; struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (s->f); - [[dpyinfo->bitmaps[face->stipple-1].img stippleMask] set]; - goto fill; + 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); + NSGraphicsContext *ctx = [NSGraphicsContext currentContext]; + [ctx saveGraphicsState]; + CGContextRef context = [ctx CGContext]; + CGContextClipToRect (context, bounds); + CGContextScaleCTM (context, 1, -1); + [[NSColor colorWithUnsignedLong:face->foreground] set]; + CGRect imageSize = CGRectMake (0, 0, CGImageGetWidth (mask), + CGImageGetHeight (mask)); + CGContextDrawTiledImage (context, imageSize, mask); + [[NSGraphicsContext currentContext] restoreGraphicsState]; } else if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width /* When xdisp.c ignores FONT_HEIGHT, we cannot trust font @@ -3851,7 +3870,6 @@ Function modeled after x_draw_glyph_string_box (). else [FRAME_CURSOR_COLOR (s->f) set]; - fill: r = NSMakeRect (s->x, s->y + box_line_width, s->background_width, s->height - 2 * box_line_width); @@ -4175,10 +4193,36 @@ Function modeled after x_draw_glyph_string_box (). dpyinfo = FRAME_DISPLAY_INFO (s->f); if (s->hl == DRAW_CURSOR) [FRAME_CURSOR_COLOR (s->f) set]; - else if (s->stippled_p) - [[dpyinfo->bitmaps[s->face->stipple - 1].img stippleMask] set]; - else + else if (s->stippled_p) { + [[NSColor colorWithUnsignedLong:s->face->background] + set]; + NSRectFill ( + NSMakeRect (x, s->y, background_width, s->height)); + CGImageRef mask = + [dpyinfo->bitmaps[s->face->stipple - 1] + .img stippleMask]; + CGRect bounds + = CGRectMake (s->x, s->y, s->background_width, + s->height); + NSGraphicsContext *ctx = + [NSGraphicsContext currentContext]; + [ctx saveGraphicsState]; + CGContextRef context = [ctx CGContext]; + CGContextClipToRect(context, bounds); + CGContextScaleCTM (context, 1, -1); + [[NSColor colorWithUnsignedLong:s->face->foreground] + set]; + CGRect imageSize + = CGRectMake (0, 0, CGImageGetWidth (mask), + CGImageGetHeight (mask)); + CGContextDrawTiledImage (context, imageSize, mask); + [[NSGraphicsContext currentContext] + restoreGraphicsState]; + } + else { [[NSColor colorWithUnsignedLong: s->face->background] set]; + NSRectFill (NSMakeRect (x, s->y, background_width, s->height)); + } NSRectFill (NSMakeRect (x, s->y, background_width, s->height)); } -- 2.45.2 --00000000000037ce3f0622886479 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello, I've been advised to submit my patch adding sup= port for drawing coloured stipples on NS Emacs here:

Fro= m 87c143b1b77ae02a08b9e1bbe27da57859e28a8d Mon Sep 17 00:00:00 2001
From= : Ben Simms <ben@bensimms.moe>
Date: Fri, 20 Sep 2024 09:50:47 +02= 00
Subject: [PATCH] Support drawing coloured stipples

This makes = use of CoreGraphics, while this works fine on macos systems,
I'm uns= ure how to test this on a GNUStep or other supported NS
implementation.<= br>---
=C2=A0src/nsimage.m | 17 +++++++++++++---
=C2=A0src/nsterm.h = =C2=A0| =C2=A04 ++--
=C2=A0src/nsterm.m =C2=A0| 56 +++++++++++++++++++++= ++++++++++++++++++++++++------
=C2=A03 files changed, 66 insertions(+), = 11 deletions(-)

diff --git a/src/nsimage.m b/src/nsimage.m
index = ee72d6e0ea..100af5c3e9 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m=
@@ -28,6 +28,7 @@ Updated by Christian Limpach (chris@nice.ch)
=C2=A0/* This should be the first include, = as it may set up #defines affecting
=C2=A0 =C2=A0 interpretation of even= the system includes. =C2=A0*/
=C2=A0#include <config.h>
+#incl= ude <CoreGraphics/CoreGraphics.h>
=C2=A0
=C2=A0#include "l= isp.h"
=C2=A0#include "dispextern.h"
@@ -510,10 +511,2= 0 @@ - (void) setAlphaAtX: (int) x Y: (int) y to: (unsigned char) a
=C2= =A0}
=C2=A0
=C2=A0/* Returns a pattern color, which is cached here. = =C2=A0*/
-- (NSColor *)stippleMask
+- (CGImageRef)stippleMask
=C2= =A0{
- =C2=A0if (stippleMask =3D=3D nil)
- =C2=A0 =C2=A0 =C2=A0stippl= eMask =3D [[NSColor colorWithPatternImage: self] retain];
+ =C2=A0if (st= ippleMask =3D=3D nil) {
+ =C2=A0 =C2=A0CGDataProviderRef provider =3D CG= DataProviderCreateWithData (NULL, [bmRep bitmapData],
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [self sizeInBytes], NULL);=
+ =C2=A0 =C2=A0id mask =3D (id)CGImageMaskCreate(
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[self size].widt= h,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0[self size].height,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A08, 8, [self size].width,
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0provider, NULL, = 0);
+
+ =C2=A0 =C2=A0CGDataProviderRelease(provider);
+ =C2=A0 =C2= =A0stippleMask =3D (CGImageRef)[mask retain];
+ =C2=A0}
=C2=A0 =C2=A0= return stippleMask;
=C2=A0}
=C2=A0
diff --git a/src/nsterm.h b/src= /nsterm.h
index 3a713f8e8c..7ec851966f 100644
--- a/src/nsterm.h
+= ++ b/src/nsterm.h
@@ -670,7 +670,7 @@ #define NSTRACE_UNSILENCE()
=C2= =A0{
=C2=A0 =C2=A0NSBitmapImageRep *bmRep; /* used for accessing pixel d= ata */
=C2=A0 =C2=A0unsigned char *pixmapData[5]; /* shortcut to access = pixel data */
- =C2=A0NSColor *stippleMask;
+ =C2=A0CGImageRef stippl= eMask;
=C2=A0@public
=C2=A0 =C2=A0NSAffineTransform *transform;
= =C2=A0 =C2=A0BOOL smoothing;
@@ -687,7 +687,7 @@ #define NSTRACE_UNSILEN= CE()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 green: (uns= igned char)g blue: (unsigned char)b
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0alpha:(unsigned char)a;
=C2=A0- (void)setAlphaAtX: (= int)x Y: (int)y to: (unsigned char)a;
-- (NSColor *)stippleMask;
+- (= CGImageRef)stippleMask;
=C2=A0- (Lisp_Object)getMetadata;
=C2=A0- (BO= OL)setFrame: (unsigned int) index;
=C2=A0- (void)setTransform: (double[3= ][3]) m;
diff --git a/src/nsterm.m b/src/nsterm.m
index 794630de1c..8= 4084f12a4 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3826,9 = +3826,28 @@ Function modeled after x_draw_glyph_string_box ().
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0if (s->stippled_p)
=C2=A0 {
+ =C2=A0[= [NSColor colorWithUnsignedLong:face->background] set];
+ =C2=A0r =3D= NSMakeRect (s->x, s->y + box_line_width,
+ =C2=A0s->backgro= und_width,
+ =C2=A0s->height - 2 * box_line_width);
+ =C2=A0NS= RectFill (r);
+ =C2=A0s->background_filled_p =3D 1;
=C2=A0 =C2= =A0struct ns_display_info *dpyinfo =3D FRAME_DISPLAY_INFO (s->f);
- = =C2=A0[[dpyinfo->bitmaps[face->stipple-1].img stippleMask] set];
-= =C2=A0goto fill;
+ =C2=A0CGImageRef mask =3D
+ =C2=A0 =C2=A0[dpyi= nfo->bitmaps[face->stipple - 1].img stippleMask];
+ =C2=A0CGRect = bounds =3D CGRectMake (s->x, s->y + box_line_width,
+ =C2=A0 = =C2=A0 =C2=A0s->background_width,
+ =C2=A0 =C2=A0 =C2=A0s->hei= ght - 2 * box_line_width);
+ =C2=A0NSGraphicsContext *ctx =3D [NSGraphi= csContext currentContext];
+ =C2=A0[ctx saveGraphicsState];
+ =C2= =A0CGContextRef context =3D [ctx CGContext];
+ =C2=A0CGContextClipToRec= t (context, bounds);
+ =C2=A0CGContextScaleCTM (context, 1, -1);
+ = =C2=A0[[NSColor colorWithUnsignedLong:face->foreground] set];
+ =C2= =A0CGRect imageSize =3D CGRectMake (0, 0, CGImageGetWidth (mask),
+ = CGImageGetHeight (mask));
+ =C2=A0CGContextDrawTiledImage (context, im= ageSize, mask);
+ =C2=A0[[NSGraphicsContext currentContext] restoreGrap= hicsState];
=C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0else if (FONT_HEIGHT = (s->font) < s->height - 2 * box_line_width
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 /* When xdisp.c ignores FONT_HEIGHT, we cannot trust font
@@ = -3851,7 +3870,6 @@ Function modeled after x_draw_glyph_string_box ().
= =C2=A0 =C2=A0else
=C2=A0 =C2=A0 =C2=A0[FRAME_CURSOR_COLOR (s->f) se= t];
=C2=A0
- fill:
=C2=A0 =C2=A0r =3D NSMakeRect (s->x, s->= y + box_line_width,
=C2=A0 =C2=A0s->background_width,
=C2=A0 = =C2=A0s->height - 2 * box_line_width);
@@ -4175,10 +4193,36 @@ Funct= ion modeled after x_draw_glyph_string_box ().
=C2=A0 =C2=A0dpyinfo =3D = FRAME_DISPLAY_INFO (s->f);
=C2=A0 =C2=A0if (s->hl =3D=3D DRAW_CUR= SOR)
=C2=A0 =C2=A0 =C2=A0[FRAME_CURSOR_COLOR (s->f) set];
- =C2= =A0else if (s->stippled_p)
- =C2=A0 =C2=A0[[dpyinfo->bitmaps[s-&g= t;face->stipple - 1].img stippleMask] set];
- =C2=A0else
+ =C2= =A0else if (s->stippled_p) {
+ =C2=A0 =C2=A0 =C2=A0[[NSColor colorWi= thUnsignedLong:s->face->background]
+ set];
+ =C2=A0 =C2=A0 = =C2=A0NSRectFill (
+ NSMakeRect (x, s->y, background_width, s->he= ight));
+ =C2=A0 =C2=A0 =C2=A0CGImageRef mask =3D
+ [dpyinfo->bi= tmaps[s->face->stipple - 1]
+ =C2=A0 =C2=A0.img stippleMask];+ =C2=A0 =C2=A0 =C2=A0CGRect bounds
+ =3D CGRectMake (s->x, s->= y, s->background_width,
+ =C2=A0 =C2=A0 =C2=A0s->height);
+ = =C2=A0 =C2=A0 =C2=A0NSGraphicsContext *ctx =3D
+ [NSGraphicsContext cu= rrentContext];
+ =C2=A0 =C2=A0 =C2=A0[ctx saveGraphicsState];
+ =C2= =A0 =C2=A0 =C2=A0CGContextRef context =3D [ctx CGContext];
+ =C2=A0 =C2= =A0 =C2=A0CGContextClipToRect(context, bounds);
+ =C2=A0 =C2=A0 =C2=A0C= GContextScaleCTM (context, 1, -1);
+ =C2=A0 =C2=A0 =C2=A0[[NSColor colo= rWithUnsignedLong:s->face->foreground]
+ set];
+ =C2=A0 =C2= =A0 =C2=A0CGRect imageSize
+ =3D CGRectMake (0, 0, CGImageGetWidth (mas= k),
+ =C2=A0 =C2=A0 =C2=A0CGImageGetHeight (mask));
+ =C2=A0 =C2= =A0 =C2=A0CGContextDrawTiledImage (context, imageSize, mask);
+ =C2=A0 = =C2=A0 =C2=A0[[NSGraphicsContext currentContext]
+ restoreGraphicsState= ];
+ =C2=A0 =C2=A0}
+ =C2=A0else {
=C2=A0 =C2=A0 =C2=A0[[NSColo= r colorWithUnsignedLong: s->face->background] set];
+ =C2=A0 =C2= =A0NSRectFill (NSMakeRect (x, s->y, background_width, s->height));+ =C2=A0}
=C2=A0
=C2=A0 =C2=A0NSRectFill (NSMakeRect (x, s->y, = background_width, s->height));
=C2=A0 }
--
2.45.2

--00000000000037ce3f0622886479--