emacs-devel
[Top][All Lists]
Advanced

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

Cursor drawing (was: Process: Determining the origin of a command loop)


From: Stefan Monnier
Subject: Cursor drawing (was: Process: Determining the origin of a command loop)
Date: Thu, 20 Dec 2018 10:39:53 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

I was wondering whether it would make sense to introduce a clear notion
of layers.  IIUC the current situation is:

- redisplay renders buffers into glyph matrix.
- redraw of a clipping region is done by "rendering" the corresponding
  part of a glyph matrix into pixels.

and I'm not completely sure where the cursor and the mouse-face
highlight fit into this picture, but IIUC they're handled in a somewhat
ad-hoc way.

The layering could look like:

- redisplay renders buffers into glyph matrix.
- cursors and crosshairs are rendered into a separate data-structure
  (let's call it "overlay").
- 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.

Here we'd have 2 layers (the glyph matrix and the overlay), tho I guess
the idea could be generalized to more layers if there's a need for it.
The advantage would be mostly that the overlay data structure could be
designed completely differently from glyph-matrices, so you don't have
to shoehorn crosshairs into the glyph matrix.

There's a good chance what I'm suggesting makes no sense or wouldn't
help with the actually hard part of the code, because I'm not familiar
enough with it.  If so, please ignore me,


        Stefan




reply via email to

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