<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/grid.c, branch 1.2.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.2.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.2.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2020-02-25T19:33:27Z</updated>
<entry>
<title>grid: grid_reflow(): may be called with old_rows/cols == new_rows/cols</title>
<updated>2020-02-25T19:33:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-02-25T19:33:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=45ba9f9c8f3b38e20092d97ee6a34f7bc27e0198'/>
<id>urn:sha1:45ba9f9c8f3b38e20092d97ee6a34f7bc27e0198</id>
<content type='text'>
TODO: avoid calling grid_reflow() in this case.
</content>
</entry>
<entry>
<title>render/grid: move grid reflow code to grid.c</title>
<updated>2020-02-15T21:19:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-02-15T21:19:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=38a682f0d0114e118e71482ee1cfb89bc846f20d'/>
<id>urn:sha1:38a682f0d0114e118e71482ee1cfb89bc846f20d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: convert cell 'linefeed' attribute to a row 'linebreak' property</title>
<updated>2020-02-14T21:39:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-02-14T21:39:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ce8005545d5bc94775f616d0caacd55e691e400f'/>
<id>urn:sha1:ce8005545d5bc94775f616d0caacd55e691e400f</id>
<content type='text'>
To do text reflow, we only need to know if a line has been explicitly
linebreaked or not. If not, that means it wrapped, and that we
should *not* insert a linebreak when reflowing text.

When reflowing text, when reaching the end of a row in the old grid,
only insert a linebreak in the new grid if the old row had been
explicitly linebreaked.

Furthermore, when reflowing text and wrapping a row in the new grid,
mark the previous row as linebreaked if either the last cell was
(the last column in the last row) empty, or the current cell (the
first column in the new row) is empty. If both are non-empty, then we
assume a linewrap.
</content>
</entry>
<entry>
<title>grid: remove commented out code</title>
<updated>2019-08-23T18:07:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-23T18:07:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0c907172495b3bd77e8ba1502044429aaf794bba'/>
<id>urn:sha1:0c907172495b3bd77e8ba1502044429aaf794bba</id>
<content type='text'>
</content>
</entry>
<entry>
<title>scrolling: optimize row access by assuming number of rows is a power of 2</title>
<updated>2019-08-22T15:33:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-22T15:33:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7c7720a3ab314e471499194f114797ca7a40afde'/>
<id>urn:sha1:7c7720a3ab314e471499194f114797ca7a40afde</id>
<content type='text'>
With this assumption, we can replace 'a % b' with 'a &amp; (b - 1)'. In
terms of instructions, this means a fast 'and' instead of a slow
'div'.

Further optimize scrolling by:

* not double-initializing empty rows. Previously, grid_row_alloc()
  called calloc(), which was then followed by a memset() when
  scrolling. This is of course unnecessary.

* Don't loop the entire set of visible rows (this was done to ensure
  all visible rows had been allocated, and to prefetch the cell
  contents).

  This isn't necessary; only newly pulled in rows can be NULL. For
  now, don't prefetch at all.
</content>
</entry>
<entry>
<title>render: add a 'clean' bit to each cell; only render cells that aren't clean</title>
<updated>2019-07-30T16:03:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-30T16:03:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=85ef9df586dfca22d16d04c9777dc38ff896223a'/>
<id>urn:sha1:85ef9df586dfca22d16d04c9777dc38ff896223a</id>
<content type='text'>
This patch takes a bit from the foreground color value in a
cell (todo: split up foreground/background into bitfields with a
separate field for 'foreground/background' has been set), and only
re-renders cells that aren't marked as clean.

Note: we use a 'clean' bit rather than a 'dirty' bit to make it easy
to erase cells - we can (keep doing) do that by simply memsetting a
cell range to 0.
</content>
</entry>
<entry>
<title>grid: swap rows doesn't mark rows as dirty</title>
<updated>2019-07-23T15:56:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-23T15:56:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f7519b572596fb2dbc72f4ae06c36bc77e1881f1'/>
<id>urn:sha1:f7519b572596fb2dbc72f4ae06c36bc77e1881f1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: swap_row: drop requirement that row indices be positive</title>
<updated>2019-07-10T17:17:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-10T17:17:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=379f7cf646c9543868ae1262fd3cf9e79f537c9a'/>
<id>urn:sha1:379f7cf646c9543868ae1262fd3cf9e79f537c9a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: don't pre-allocate the entire grid (with all scrollback lines)</title>
<updated>2019-07-10T14:27:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-10T14:27:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1ff1b3a71e8edcad62c98a3c80b6e1d8a77bc26f'/>
<id>urn:sha1:1ff1b3a71e8edcad62c98a3c80b6e1d8a77bc26f</id>
<content type='text'>
The row array may now contain NULL pointers. This means the
corresponding row hasn't yet been allocated and initialized.

On a resize, we explicitly allocate the visible rows.

Uninitialized rows are then allocated the first time they are
referenced.
</content>
</entry>
<entry>
<title>grid: don't implement grid_swap_row() in the header file</title>
<updated>2019-07-10T14:08:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-10T14:08:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8f0d574dcb0dc0f94a3e5da13331b8913ec9cd93'/>
<id>urn:sha1:8f0d574dcb0dc0f94a3e5da13331b8913ec9cd93</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wip: grid is now represented as a grid, not a linear array</title>
<updated>2019-07-08T11:57:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-08T11:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4e25019ba6bd1bd07925ccafc2936416ef3f7cbe'/>
<id>urn:sha1:4e25019ba6bd1bd07925ccafc2936416ef3f7cbe</id>
<content type='text'>
The grid is now represented with an array of row *pointers*. Each row
contains an array of cells (the row's columns).

The main point of having row pointers is we can now move rows around
almost for free.

This is useful when scrolling with scroll margins for example, where
we previously had to copy the lines in the margins. Now it's just a
matter of swapping two pointers.
</content>
</entry>
<entry>
<title>grid: add a fast path to grid_memmove()</title>
<updated>2019-07-07T15:10:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-07T15:10:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f2363c23915aeab1900842f815ccfcf5f67f8210'/>
<id>urn:sha1:f2363c23915aeab1900842f815ccfcf5f67f8210</id>
<content type='text'>
Recognize the case where both the destination and source can be fully
accessed, and to a plain memmove() in this case.
</content>
</entry>
<entry>
<title>grid: grid_memset() -&gt; grid_memclear()</title>
<updated>2019-07-07T15:10:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-07T15:10:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=48528419c4660c6ca40a276c4854d946334c0b9b'/>
<id>urn:sha1:48528419c4660c6ca40a276c4854d946334c0b9b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>logging: disable debug logging by default</title>
<updated>2019-07-03T18:21:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-03T18:21:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1373d18dbc7b04141347a20a58867c1c79cf6daf'/>
<id>urn:sha1:1373d18dbc7b04141347a20a58867c1c79cf6daf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>scrolling: initial reverse scrolling support - no scroll regions</title>
<updated>2019-07-03T08:45:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-03T08:45:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a7a28ff5816c0f80a439c4ad828c6f0028493b1f'/>
<id>urn:sha1:a7a28ff5816c0f80a439c4ad828c6f0028493b1f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: implement a memmove-sort-of function</title>
<updated>2019-07-01T17:18:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-01T17:18:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=482f56b4a2f9a30a57b78188cd3faa5e21bbb588'/>
<id>urn:sha1:482f56b4a2f9a30a57b78188cd3faa5e21bbb588</id>
<content type='text'>
grid_memmove() moves cell data from one index to another, taking the
grid offset into account.
</content>
</entry>
<entry>
<title>wip: use a sliding window instead of memmove() to scroll</title>
<updated>2019-07-01T10:23:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-01T10:23:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d70956da08c987af639fd8e03e669ca59c4c542b'/>
<id>urn:sha1:d70956da08c987af639fd8e03e669ca59c4c542b</id>
<content type='text'>
Instead of memmoving a large amount of data on every scroll, use a
sliding window. That is, each time we scroll, we offset origin.
</content>
</entry>
<entry>
<title>Rename grid_* functions to term_*</title>
<updated>2019-06-29T19:03:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-29T19:03:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1ecd4a6ae14d951090b88a18972d55d81232eabf'/>
<id>urn:sha1:1ecd4a6ae14d951090b88a18972d55d81232eabf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: attributes now track whether we've set a foreground/background color</title>
<updated>2019-06-26T17:44:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-26T17:44:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3a97fce6d06dea35211191237a6ad3c2d41e5d31'/>
<id>urn:sha1:3a97fce6d06dea35211191237a6ad3c2d41e5d31</id>
<content type='text'>
This means we don't have to explicitly set the foreground/background
to the grid's default colors whenever we reset/clear a cell, and we
can instead simply memset() the entire cell to 0.

This also means the renderer has to get the default color when
rendering a cell without a foreground/background color set.
</content>
</entry>
<entry>
<title>scroll: let the render erase the scrolled up region</title>
<updated>2019-06-26T17:33:39Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-26T17:33:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=97420f13d896ef0dc4c956fcc89d5818769ced88'/>
<id>urn:sha1:97420f13d896ef0dc4c956fcc89d5818769ced88</id>
<content type='text'>
The grid scroll operation no longer inserts a DAMAGE_ERASE operation,
but instead manually clears the region. The render does the
corresponding thing.
</content>
</entry>
</feed>
