unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Cursor drawing
Date: Thu, 20 Dec 2018 21:35:46 +0200	[thread overview]
Message-ID: <83zht0at4d.fsf@gnu.org> (raw)
In-Reply-To: <jwvh8f810ad.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Thu, 20 Dec 2018 14:18:22 -0500)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> Date: Thu, 20 Dec 2018 14:18:22 -0500
> 
> > So maybe you should say more about how you imagine this works, and how
> > under that mental model you envision this part:
> >> - redraw of a clipping region is done by "rendering" the corresponding
> >>   part of a glyph matrix combined with the corresponding part of the
> >>   overlay layer into pixels.
> 
> I imagine this as being done possibly as;
> 
> 1- draw the relevant glyphs from the glyph matrix
> 2- draw the relevant part of the overlay on top of it (with some form of
>    transparency so as not to completely overwrite what was drawn in step 1).
> 
> > The crucial part here, for me, is how this "combination" would be
> > different from "shoehorning crosshairs into the glyph matrix".  Can
> > you elaborate on what you had in mind?
> 
> The crosshairs don't need to be represented/mentioned in the glyph matrix.
> 
> You can just keep in the overlay layer an entry that says "draw vertical
> line at pixel column X" and "draw horizontal line at pixel line Y".

Then this can be done today, without any changes in the architecture
of the display engine.  Any code can draw whatever it wants on top of
what the "normal" window/frame-update code did.  The transparency
issue aside, you will just overwrite portions of the displayed text
according to the pixels you splat on the glass.

IOW, if we take the "fake cursors" as an example, the code which
implements them should just be moved outside of the functions called
from redisplay_window, and into a separate function which will be
called, say, by the frame_up_to_date_hook.

The disadvantage of this is, of course, that the code that draw the
face cursors will be needed to be implemented 4 times, one each for
every terminal-specific backend we support.

> >> The advantage would be mostly that the overlay data structure could be
> >> designed completely differently from glyph-matrices
> > Like what, for example?
> 
> Maybe more like an SVG canvas?

You got me here: I have no idea how that works.



  reply	other threads:[~2018-12-20 19:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20  4:11 Process: Determining the origin of a command loop Keith David Bershatsky
2018-12-20 14:11 ` Eli Zaretskii
2018-12-20 15:39   ` Cursor drawing (was: Process: Determining the origin of a command loop) Stefan Monnier
2018-12-20 19:07     ` Cursor drawing Eli Zaretskii
2018-12-20 19:18       ` Stefan Monnier
2018-12-20 19:35         ` Eli Zaretskii [this message]
2018-12-20 19:58           ` Stefan Monnier
2018-12-21  4:03             ` Elias Mårtenson
2018-12-21  7:09               ` Eli Zaretskii
2018-12-21 16:36                 ` Elias Mårtenson
2018-12-21 20:05                   ` Eli Zaretskii
2018-12-21 20:27                     ` Clément Pit-Claudel
2018-12-21 20:37                       ` Eli Zaretskii
2018-12-21 20:41                         ` Eli Zaretskii
2018-12-22 16:43                         ` Stefan Monnier
2018-12-22 17:03                           ` 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=83zht0at4d.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).