<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, branch 0.9.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=0.9.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=0.9.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2019-09-27T17:33:45Z</updated>
<entry>
<title>render: handle compositors that does buffer swapping</title>
<updated>2019-09-27T17:33:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-09-27T17:33:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=67905c600050df4e1c8a46053038a011accd9de6'/>
<id>urn:sha1:67905c600050df4e1c8a46053038a011accd9de6</id>
<content type='text'>
Not all compositors support buffer re-use. I.e. they will call the
frame callback *before* the previous buffer has been
released. Effectively causing us to swap between two buffers.

Previously, this made us enter an infinite re-render loop, since we
considered the window 'dirty' (and in need of re-draw) when the buffer
is different from last redraw.

Now, we detect the buffer swapping case; size must match, and we must
not have any other condition that require a full repaint.

In this case, we can memcpy() the old buffer to the new one, without
dirtying the entire grid. We then update only the dirty cells (and
scroll damage).

Note that there was a bug here, where we erased the old
cursor *before* checking for a new buffer. This worked when the buffer
had *not* changed.

Now that we need to handle the case where it *has* changed, we must do
the memcpy() *before* we erase the cursor, or the re-painted cell is
lost.

This makes foot work on Plasma, without burning CPU. The memcpy() does
incur a performance penalty, but we're still (much) faster than
e.g. konsole. In fact, we're still mostly on par with Alacritty.
</content>
</entry>
<entry>
<title>render: attach buffer *before* generating damage</title>
<updated>2019-09-27T17:33:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-09-27T17:33:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b87bf0dd9d0144a4aee0543a7090b1565888fda9'/>
<id>urn:sha1:b87bf0dd9d0144a4aee0543a7090b1565888fda9</id>
<content type='text'>
Fixes 'invisible window' on Plasma
</content>
</entry>
<entry>
<title>main: initialize scale to '1'</title>
<updated>2019-09-26T16:39:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-09-26T16:39:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2d6369482e231e8d2cdfbf567e4b651a4c71f763'/>
<id>urn:sha1:2d6369482e231e8d2cdfbf567e4b651a4c71f763</id>
<content type='text'>
This ensures we always have a valid (but possibly incorrect) scaling
value. This allows us to simplify code that uses the scale - it
doesn't have to verify the scale if valid.

Furthermore, since render_resize() is the function that actually
updates term-&gt;scale, make sure to call it *before* updating the
cursor (otherwise, the cursor will use the old scaling value).
</content>
</entry>
<entry>
<title>render: remove assertion that isn't always true</title>
<updated>2019-09-20T22:45:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-09-20T22:45:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=55968413b63abe5b5628091f7e9aa534472f3ab2'/>
<id>urn:sha1:55968413b63abe5b5628091f7e9aa534472f3ab2</id>
<content type='text'>
It's not true for e.g. Cascadia code.
</content>
</entry>
<entry>
<title>render: search box: use colors from the color table</title>
<updated>2019-08-30T19:01:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-30T19:01:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7c4c41fbae9a561eec877399601d44567c22e947'/>
<id>urn:sha1:7c4c41fbae9a561eec877399601d44567c22e947</id>
<content type='text'>
Use the 'yellow' color from the 'regular' range of colors (SGR 33) for
background when we have a match, or 'red' from the 'regular' range of
colors (SGR 31) when we don't have a match.

Foreground uses the 'black' color from the regular range of
colors (SGR 30).
</content>
</entry>
<entry>
<title>render: draw (cursor) bar using the same thickness as underlines</title>
<updated>2019-08-30T17:42:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-30T17:42:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e8d187e4f3068f9a35d4b9752f913cc0efe90a23'/>
<id>urn:sha1:e8d187e4f3068f9a35d4b9752f913cc0efe90a23</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: search box: fix glyph spacing</title>
<updated>2019-08-30T17:35:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-30T17:35:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fcb0e050094f9d864afd958537e11cedb13e40dc'/>
<id>urn:sha1:fcb0e050094f9d864afd958537e11cedb13e40dc</id>
<content type='text'>
We're using the same font as in the terminal, so use the same glyph
spacing.
</content>
</entry>
<entry>
<title>render: render_search_box: draw cursor as a bar</title>
<updated>2019-08-29T19:03:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-29T19:03:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2ca7400cc6ed922582adcd6a2455b6608a5a5f20'/>
<id>urn:sha1:2ca7400cc6ed922582adcd6a2455b6608a5a5f20</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: draw_strikeout: use font_baseline() for baseline calculation</title>
<updated>2019-08-29T18:42:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-29T18:42:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bffa1f05ac0a5234ee21e1a46a363af19ddee367'/>
<id>urn:sha1:bffa1f05ac0a5234ee21e1a46a363af19ddee367</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: draw_underline: use font_baseline() for baseline calculation</title>
<updated>2019-08-29T18:42:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-29T18:42:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1f98c8f7879a4066aa089b520084f77568a247d2'/>
<id>urn:sha1:1f98c8f7879a4066aa089b520084f77568a247d2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: draw_bar: don't assume height == ascent+descent</title>
<updated>2019-08-29T18:41:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-29T18:41:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6e5688d7da131acf025c9a51a0466a9fbf5c7b56'/>
<id>urn:sha1:6e5688d7da131acf025c9a51a0466a9fbf5c7b56</id>
<content type='text'>
Instead, draw a bar that is ascent+descent tall, positioned around the
baseline such that it starts at the ascent and ends at the descent.
</content>
</entry>
<entry>
<title>render: add font_baseline() - calculates the y-coordinate for the baseline</title>
<updated>2019-08-29T18:39:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-29T18:39:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=013cf61ffbd58f5f706ae6688aea56a14fce6622'/>
<id>urn:sha1:013cf61ffbd58f5f706ae6688aea56a14fce6622</id>
<content type='text'>
The old baseline calculation was copy-pasted to a couple of places,
and also assumed that the font's height was equal to ascent+descent.

While this is typically true, it isn't necessarily so.

Now, we assume that height &gt;= ascent+descent, and then position the
baseline in "center" (but adjusted for the descent).
</content>
</entry>
<entry>
<title>render: remove INFO log (that really was a debug log)</title>
<updated>2019-08-29T18:23:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-29T18:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3ec7fbf0a320f2c7a07a4d03d3c5cbe65c2aeb18'/>
<id>urn:sha1:3ec7fbf0a320f2c7a07a4d03d3c5cbe65c2aeb18</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: move render() function to the 'render' module</title>
<updated>2019-08-29T18:18:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-29T18:18:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2c3ab701e7fc95f30b573b20873dc4dfb5c2fa66'/>
<id>urn:sha1:2c3ab701e7fc95f30b573b20873dc4dfb5c2fa66</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: reduce amount of dim while searching scrollback history</title>
<updated>2019-08-29T17:33:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-29T17:33:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2a31c2fbbc2f38abef54090767f842a9e8016c29'/>
<id>urn:sha1:2a31c2fbbc2f38abef54090767f842a9e8016c29</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: double-dim fg+bg when searching the scrollback buffer</title>
<updated>2019-08-28T19:53:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-28T19:53:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=242ab66c97771259d0f6d750b6407e8de1bb9ce0'/>
<id>urn:sha1:242ab66c97771259d0f6d750b6407e8de1bb9ce0</id>
<content type='text'>
By toning down the screen content more, the selection (i.e. the search
match) pops out much more.
</content>
</entry>
<entry>
<title>render: don't dim selection while searching</title>
<updated>2019-08-27T17:40:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-27T17:40:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bb4fd58223612330f150fe590de3673d36995c05'/>
<id>urn:sha1:bb4fd58223612330f150fe590de3673d36995c05</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search: wip: re-direct input while searching, and build a search buffer</title>
<updated>2019-08-27T15:23:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-27T15:23:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=61cabdac13986e6cb2ba69e81d5934f55d92a1a9'/>
<id>urn:sha1:61cabdac13986e6cb2ba69e81d5934f55d92a1a9</id>
<content type='text'>
This adds a new state, 'is_searching'. While active, input is
re-directed, and stored in a search buffer. In the future, we'll use
this buffer and search for its content in the scrollback buffer, and
move the view and create a selection on matches.

When rendering in 'is_searching', everything is dimmed. In the future,
we'll render the current search buffer on-top of the dimmed "regular"
terminal output.
</content>
</entry>
<entry>
<title>render: center grid in window</title>
<updated>2019-08-27T13:25:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-27T13:25:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2d7ca416f052d0b8ffa37eaf02e3ac636dc5f811'/>
<id>urn:sha1:2d7ca416f052d0b8ffa37eaf02e3ac636dc5f811</id>
<content type='text'>
Instead of placing the upper left corner of the grid at 0,0 in the
window, center it.
</content>
</entry>
<entry>
<title>render: log frame rendering time with microseconds instead of milliseconds</title>
<updated>2019-08-24T09:32:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-24T09:32:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dcf6d1887261ddd3cf64f1b6dda84678d7b446ca'/>
<id>urn:sha1:dcf6d1887261ddd3cf64f1b6dda84678d7b446ca</id>
<content type='text'>
</content>
</entry>
</feed>
