emacs-devel
[Top][All Lists]
Advanced

[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:52:56 +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 21:59:30 +0200
>> From: address@hidden
>> Cc: address@hidden
>> 
>> > The current display engine works by screen lines, so if we want to
>> > keep it, we must use the existing framework.
>> 
>> Now imagine there's a (graphical) line going from (text) display
>> line 3 to 7. You are not implying that we have to segment that
>> into four chunks, one per text line?
>
> That's one way, but it's ugly and complicated.
>
>> 
>> >                                               When a portion of a
>> > window is exposed, we redraw all the glyphs in the exposed area(s),
>> > and we find the glyphs that need to be redrawn by comparing their
>> > coordinates with those of the exposed rectangle(s).
>> 
>> ... but rather that we intersect the exposed area(s) with each [1]
>> of the graphical objects and redraw that (be it before or after the
>> text)?
>
> Yes, but we examine what you call "objects" by screen lines.
>
>> [1] conceptually; in reality we'll need some index structure
>>    to avoid looking at most of the graphical objects. Quad-
>>    trees, whatever.
>
> We don't use them now.  A typical window is not large enough to make
> that a worthy complication.
If you used exactly same functionality as now, but would call it twice,
or N number of times, as a chain of render hooks, and then let every
callback in chain draw it's own buffer, wouldn't that solve the issue
with relatively small effort in changes?

If user had pre-render hook, and say created an image and put it in
first char in temp buffer and then add that buffer as pre-render hook,
then the render engine just need to be modified to act when any of
buffers in render chain changes, instead of just current buffer.

But when it comes to rendering functionality, it would stay same, just call
whatever you already have now for the buffer drawing, on each render
hook and it's associated buffer and let them draw over each other; like
in z-buffer. Is it too difficult to implement? It would draw over some
portions of screen twice or more times, but who cares. I don't think it
is a big issue in an application like Emacs, it is not like Emacs is
drawing millions of polygons at 120 FPS.



reply via email to

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