[Top][All Lists]

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

Re: Emacs canvas support

From: Arthur Miller
Subject: Re: Emacs canvas support
Date: Thu, 30 Apr 2020 15:11:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> Date: Wed, 29 Apr 2020 20:27:53 +0300
>> From: Eli Zaretskii <address@hidden>
>> Cc: address@hidden
>> That's not how Emacs controls what's on display.  It basically
>> represents each window as a 2D array of glyphs, each one of which has
>> a certain graphical representation.  The representation itself is of
>> no concern to the display engine (well, almost); the only thing it
>> cares about is the metrics of each glyph, because that's what it needs
>> to do layout calculations.
> Oh, and one more important aspect: everything that winds up on display
> must come from some buffer or some Lisp string.  It could be a special
> text property or somesuch, but it must be found by walking some buffer
> or some known-in-advance Lisp string, because that's what top-level
> display functions do: they iterate over these objects, and produce the
> glyphs based on what they find there.

I have a question here about display: when lisp engine decides to draw
the display, how difficult would it be to add a callback for pre- and
post render?

Prerender callback could be any user lisp function called
that do anything it wants, say draw something on the screen as it owned
window itself. Than render engine would it's ordinary rendering drawing
just as it does now, pretending that there was nothing already drawn, so
it would mean no change at all to current c code for rendering.
Similarly one call a post-render callback and draw over the already
rendered text so user could draw whatever on top of already draw
onverlas and what not.

It is just how z-buffer works and it would mean z order from pre-render,
normal render (as it is now) and post render as implicit z-depths.

Finally one could expose ordinary X11, GDI, Cairo drawing funcions so
thet draw to an image (or why not directly to the gui window?) that
could be displayed say in prerender hook, which would get drawn as
background below the buffer text, and woulnd't collide with overlays and
other stuff. 

reply via email to

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