unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kai Ma <justksqsf@gmail.com>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Text shadows
Date: Sun, 12 Mar 2023 17:23:40 +0800	[thread overview]
Message-ID: <795E6DF6-EC17-4E68-B8A7-A99E81B072C7@gmail.com> (raw)
In-Reply-To: <87356acq6a.fsf@yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 1498 bytes --]


> On Mar 12, 2023, at 16:46, Po Lu <luangruo@yahoo.com> wrote:
>> Theoretically, nothing.  I targeted Cairo because (I think) it is the most popular option on GNU/Linux.
>> 
>> Speaking of this specific implementation, gaussian_blur() relies on a specific Cairo image format ARGB32, (this assumption could be easily removed), and then it is used by ftcrfont_draw() to generate shadows.
>> 
>> I don’t know whether non-Cairo builds (non-cairo X, win32) can/should use gaussian_blur() though, since I’m not familiar with them.
> 
> Non-Cairo builds and Cairo builds alike should use the X Rendering
> Extension, where an arbitrary blur kernel is a standard picture filter.
> Cairo builds on X should as well.


I agree XRender should be used for non-Cairo X builds (when XRender is available).

But it’s probably not a good idea to use XRender on X+Cairo.  In this setting, cairo_show_glyphs is used to draw glyphs, but Cairo does not expose any interface to the underlying Picture object.  So it would require additional memory copies between X and Cairo just for blurring.  I guess it would be slower as the image to blur is usually small.  I will do the benchmarks once I get XRender blurring working.

> P.S: the GNU project rejects the Unix convention that `foo()' refers to
> the function `foo': `foo()' is a function declarator that returns int
> and takes any number of arguments, or alternatively a function call to
> `foo' with no arguments.


Point taken.


[-- Attachment #2: Type: text/html, Size: 6878 bytes --]

  reply	other threads:[~2023-03-12  9:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12  4:06 Text shadows Kai Ma
2023-03-12  4:18 ` Kai Ma
2023-03-12  7:12 ` Eli Zaretskii
2023-03-12  8:24   ` Kai Ma
2023-03-12  8:46     ` Po Lu
2023-03-12  9:23       ` Kai Ma [this message]
2023-03-12 10:33         ` Po Lu
2023-03-12  9:14     ` Eli Zaretskii
2023-03-12  9:55       ` Kai Ma
2023-03-12 11:33         ` Eli Zaretskii
2023-03-12 11:49           ` Kai Ma
2023-03-12 12:36             ` Eli Zaretskii

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=795E6DF6-EC17-4E68-B8A7-A99E81B072C7@gmail.com \
    --to=justksqsf@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --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).