unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Felix <felix.dick@web.de>
Cc: 65042@debbugs.gnu.org
Subject: bug#65042: 30.0.50; alpha-background doesn't effect background of stipple in emacs 30.0.50 pgtk
Date: Fri, 04 Aug 2023 09:52:41 +0800	[thread overview]
Message-ID: <87tttfa80m.fsf@yahoo.com> (raw)
In-Reply-To: <87tttfh9iv.fsf@web.de> (Felix's message of "Fri, 04 Aug 2023 03:32:27 +0200")

Felix <felix.dick@web.de> writes:

> Po Lu <luangruo@yahoo.com> writes:
>
>> Felix <felix.dick@web.de> writes:
>>
>>> The background of stipple stays opaque with alpha-background parameter
>>> set for transparency.
>>> This came up in the use of the new package 'indent-bars'.
>>> The github issue: https://github.com/jdtsmith/indent-bars/issues/8
>>> I tested this with 'emacs -Q' only enabling the needed packages (compat
>>> and indent-bars).
>>
>> Thanks.  Do stipples start displaying adequately with this change?
>>
> No it doesn't.
> But it gives weird artifacts (doubling the character one
> line above or something like that)

How about this?

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 9c1fc7bef4e..a7c687d811d 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -1328,14 +1328,17 @@ fill_background_by_face (struct frame *f, struct face *face, int x, int y,
 			 int width, int height)
 {
   cairo_t *cr = pgtk_begin_cr_clip (f);
+  double r, g, b, a;
 
+  cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
   cairo_rectangle (cr, x, y, width, height);
   cairo_clip (cr);
 
-  double r = ((face->background >> 16) & 0xff) / 255.0;
-  double g = ((face->background >> 8) & 0xff) / 255.0;
-  double b = ((face->background >> 0) & 0xff) / 255.0;
-  cairo_set_source_rgb (cr, r, g, b);
+  r = ((face->background >> 16) & 0xff) / 255.0;
+  g = ((face->background >> 8) & 0xff) / 255.0;
+  b = ((face->background >> 0) & 0xff) / 255.0;
+  a = f->alpha_background;
+  cairo_set_source_rgba (cr, r, g, b, a);
   cairo_paint (cr);
 
   if (face->stipple != 0)
@@ -1343,10 +1346,10 @@ fill_background_by_face (struct frame *f, struct face *face, int x, int y,
       cairo_pattern_t *mask
 	= FRAME_DISPLAY_INFO (f)->bitmaps[face->stipple - 1].pattern;
 
-      double r = ((face->foreground >> 16) & 0xff) / 255.0;
-      double g = ((face->foreground >> 8) & 0xff) / 255.0;
-      double b = ((face->foreground >> 0) & 0xff) / 255.0;
-      cairo_set_source_rgb (cr, r, g, b);
+      r = ((face->foreground >> 16) & 0xff) / 255.0;
+      g = ((face->foreground >> 8) & 0xff) / 255.0;
+      b = ((face->foreground >> 0) & 0xff) / 255.0;
+      cairo_set_source_rgba (cr, r, g, b, a);
       cairo_mask (cr, mask);
     }
 





  reply	other threads:[~2023-08-04  1:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 16:07 bug#65042: 30.0.50; alpha-background doesn't effect background of stipple in emacs 30.0.50 pgtk Felix
2023-08-03 17:20 ` bug#65042: Simple example to reproduce Felix
2023-08-04  0:37 ` bug#65042: 30.0.50; alpha-background doesn't effect background of stipple in emacs 30.0.50 pgtk Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-04  1:32   ` Felix
2023-08-04  1:52     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-08-04 12:43       ` Felix
2023-08-04 13:28         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-04 14:05           ` Eli Zaretskii
2023-08-07 18:00             ` Felix
2023-08-08  1:00               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 11:05                 ` Stefan Kangas
2023-09-03 12:07                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 12:39                     ` Felix
2023-09-03 12:51                       ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tttfa80m.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=65042@debbugs.gnu.org \
    --cc=felix.dick@web.de \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).