emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text shadows


From: Kai Ma
Subject: Re: Text shadows
Date: Sun, 12 Mar 2023 17:55:01 +0800


On Mar 12, 2023, at 17:14, Eli Zaretskii <eliz@gnu.org> wrote:

Would you please investigate that aspect?  E.g., does Firefox support
this without Cairo, and if so, how?

From what I read, Firefox currently has two set of 2D graphics APIs, Moz2D and Thebes.

Moz2D contained their own implementations for an approximation of Gaussian blurring using the box blur [1].

Thebes defines an interface named DrawSurfaceWithShadow [2], and provides implementations in terms of Cairo [3] (based on a custom blurring function [4]), Direct2D [5], and Skia [6].

So it appears that, with Cairo, one has to implement their own blurring function.


At worst, perhaps it would be good enough not to support blurring on
some platforms, or support it by some minor modification of the color?
Or maybe we could implement the equivalent of gaussian_blur in our
code?

This is already the case: Cairo does not provide a Gaussian blurring function, so I wrote one (named gaussian_blur) in xcairo.c.  It is an approximation, not the “True Gaussian Blur”, like Moz2D’s implementation.  It only uses one CPU core, but is fast enough for me.

I don’t have objections to simply making the background slightly different on some difficult platforms.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]