emacs-devel
[Top][All Lists]
Advanced

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

Re: Unifying code for drawing on a cairo context


From: Po Lu
Subject: Re: Unifying code for drawing on a cairo context
Date: Sat, 23 Apr 2022 19:58:04 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> In general, I don't think we'd object to having such Cairo-specific
> code in one place.  However, having GUI code common to all the GUI
> backends in one place is more important, so if this Cairo-specific
> module will make that common code less so, it would be a step
> backward, IMO.  IOW, as long as the effort to have Cairo-specific code
> in one place doesn't "invade" on the common code, it is welcome, I
> think.

I think that we won't be able to get the Cairo code all in one place,
without a large amount of code specific to each window system, which
defeats the point of such refactoring.

The platforms where Cairo drawing is currently used already have subtle
differences in their Cairo-related code to take care of
platform-specific quirks regarding fringes, image transforms, scaling,
etc.  There will probably be more of these quirks in the future, as we
support more and more window systems and display features (such as
device scaling) that have to behave differently depending on the window
system being used.  Moving all the Cairo code in one place would impose
a severe limitation on the ability to change the Cairo code for a single
window system, at least without the preprocessor definition mess that
this refactoring will hopefully avoid.

Further, the amount of drawing code is quite minimal, and the currently
existing duplication does not impede maintenance at all, so this is most
likely a case of premature optimization.


reply via email to

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