[Top][All Lists]

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

Re: Questions on glyph matrices used for rendering frame in terminal

From: Gerd Möllmann
Subject: Re: Questions on glyph matrices used for rendering frame in terminal
Date: Tue, 5 Jul 2022 08:24:19 +0200

On 2022-07-05,, at 6:26 , Akib Azmain Turja <akib@disroot.org> wrote:

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

1. What's the purpose of the following in
build_frame_matrix_from_leaf_window? "frame_row->used[TEXT_AREA]" will
always end up being equal to "window_matrix->matrix_w" after processing
the right-most window of the row.

I don't understand. What about the /matrix_x/ + matrix_w below?

Oh sorry, I meant "it will end up being equal to

Probably.  I don't remember what I thought exactly when I wrote that code.  But, a few lines above what you mentioned there is

      /* Fill up the frame row with spaces up to the left margin of the
window row.  */
      fill_up_frame_row_with_spaces (frame_row, window_matrix->matrix_x);

In general, I prefer code that relies on what is known locally, instead of what is known more globally, so to speak.  (We have too much of that already in Emacs.)  Maybe that was the reason.

In this case, because of the fill_up..., we know locally that the frame row is filled up to matrix_x of the window, so...

In the TTY case, the glyph memory (struct glyph) for desired window matrices is sub-allocated from the glyph memory that is allocated for the frame. The glyph_row structures on the other hand are different between windows and frame. Clear_glyph_row doesn't affect the glyph memory, only the glyh_rows.

I can't understand. What does that glyph memory contain? Individual
glyphs or the glyph matrix? If the glyph memory holds the glyph matrix,
then IIUC glyph row is a row of that glyph matrix, so why clearing that
doesn't affect the glyph matrix?

It does affect a struct glyph_matrix, indirectly, because a struct glyph_row used by it is memset to zeros.  

But no struct glyph is modified by that.  Please take a look at clear_glyph_row.  Only bookkeeping information is cleared. The struct glyph_row points to struct glyphs, but the glyphs themselves are not changed.

Have you read dispextern.h?  There are some comments that might be helpful.

Attachment: signature.asc
Description: Message signed with OpenPGP

reply via email to

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