<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/grid.c, branch releases/1.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2019-08-23T18:07:27Z</updated>
<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>
<entry>
<title>scroll-region: don't clear damage queue when changing scroll region</title>
<updated>2019-06-25T18:11:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-25T18:11:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a35738d96f251379074a8e79ec2c179afcfe79fa'/>
<id>urn:sha1:a35738d96f251379074a8e79ec2c179afcfe79fa</id>
<content type='text'>
Vim, for example, changes the scroll region every time you scroll a
single line. Thus, resetting the damage queue is slow.

This reworks the damage handling of scroll updates:

* Split damage queue into two: one for scroll operations and one for
  update/erase operations.
* Don't separate update/erase operations inside/outside the scroll
  region
* Store the current scroll region in the scroll damage operation. This
  allows us to stack multiple scroll operations with different scroll
  regions.
* When updating update/erase operations after a scroll operation,
  split the update/erase operations if necessary (the current scroll
  operation may have a scroll region different from before, thus
  forcing us to split existing update/erase operations.
* The renderer no longer erases after a scroll. The scroll operation
  also adds an erase operation. This also means that erase operation
  are subject to adjustments by later scroll operations.
</content>
</entry>
<entry>
<title>grid: scroll reverse: hopefully done correct now</title>
<updated>2019-06-24T18:49:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-24T18:49:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0f76f4190a951f4db224034c5ae8884893c3ba21'/>
<id>urn:sha1:0f76f4190a951f4db224034c5ae8884893c3ba21</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: scroll: fix start/end for erase region</title>
<updated>2019-06-24T18:45:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-24T18:45:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0e078f44b6e75d287b5a6491dcce4e5884efea5d'/>
<id>urn:sha1:0e078f44b6e75d287b5a6491dcce4e5884efea5d</id>
<content type='text'>
</content>
</entry>
</feed>
