<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, branch 1.22.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.22.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.22.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2025-04-25T17:20:36Z</updated>
<entry>
<title>render: regression: alpha applied to inversed text/selections</title>
<updated>2025-04-25T17:20:36Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-25T17:20:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cb1b7ba0c5752eeb92c72a80640fbd1f09ad4b7d'/>
<id>urn:sha1:cb1b7ba0c5752eeb92c72a80640fbd1f09ad4b7d</id>
<content type='text'>
Introduced by 5f83278afd0530c323d4192e1095b3d1dea644c9

Closes #2073
</content>
</entry>
<entry>
<title>render: fix colors.alpha-mode=matching</title>
<updated>2025-04-19T11:33:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-19T05:46:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1a2e5f4932a17c9804ca6d201b7d8cf84d7f19d9'/>
<id>urn:sha1:1a2e5f4932a17c9804ca6d201b7d8cf84d7f19d9</id>
<content type='text'>
Before this patch, it only matched RGB color sources. It did not match
the default bg color, or indexed colors. That is, e.g. CSI 43m didn't
apply alpha, even if the color3 matched the default background color.
</content>
</entry>
<entry>
<title>config+render: move alpha-mode to colors.alpha-mode, fix cursor handling</title>
<updated>2025-04-14T14:58:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-14T14:58:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d2d4f538619177bc3af6c09e2465272f564ee780'/>
<id>urn:sha1:d2d4f538619177bc3af6c09e2465272f564ee780</id>
<content type='text'>
Move main.alpha-mode to colors.alpha-mode.

Fix (inverted) cursor handling, by always using the bg color without
alpha.

Do a minor optimization, where we don't even lock at colors.alpha-mode
if there's no transparency configured.
</content>
</entry>
<entry>
<title>config: add alpha_mode option</title>
<updated>2025-04-14T14:47:45Z</updated>
<author>
<name>Fazzi</name>
<email>faaris.ansari@proton.me</email>
</author>
<published>2023-10-09T17:47:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5f83278afd0530c323d4192e1095b3d1dea644c9'/>
<id>urn:sha1:5f83278afd0530c323d4192e1095b3d1dea644c9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: dim and brighten using linear rgb interpolation</title>
<updated>2025-03-23T14:24:23Z</updated>
<author>
<name>Sam McCall</name>
<email>sam.mccall@gmail.com</email>
</author>
<published>2025-03-22T19:11:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=663c9082db4dfe43bb329a09fd5b93a6ba99fdb6'/>
<id>urn:sha1:663c9082db4dfe43bb329a09fd5b93a6ba99fdb6</id>
<content type='text'>
Adds setting tweak.dim-amount, similar to bold-text-in-bright-amount.

Closes #2006
</content>
</entry>
<entry>
<title>meson: require wayland-protocols &gt;= 1.41</title>
<updated>2025-03-13T12:28:34Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-12T16:53:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d48a1c53f59e8b7c99c18f4e4a5693ca0b10bd52'/>
<id>urn:sha1:d48a1c53f59e8b7c99c18f4e4a5693ca0b10bd52</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: gamma-correct blending</title>
<updated>2025-03-05T17:45:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-21T10:01:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ccf625b9914917e131beb83379c526bab1927edc'/>
<id>urn:sha1:ccf625b9914917e131beb83379c526bab1927edc</id>
<content type='text'>
This implements gamma-correct blending, which mainly affects font
rendering.

The implementation requires compile-time availability of the new
color-management protocol (available in wayland-protocols &gt;= 1.41),
and run-time support for the same in the compositor (specifically, the
EXT_LINEAR TF function and sRGB primaries).

How it works: all colors are decoded from sRGB to linear (using a
lookup table, generated in the exact same way pixman generates it's
internal conversion tables) before being used by pixman. The resulting
image buffer is thus in decoded/linear format. We use the
color-management protocol to inform the compositor of this, by tagging
the wayland surfaces with the 'ext_linear' image attribute.

Sixes: all colors are sRGB internally, and decoded to linear before
being used in any sixels. Thus, the image buffers will contain linear
colors. This is important, since otherwise there would be a
decode/encode penalty every time a sixel is blended to the grid.

Emojis: we require fcft &gt;= 3.2, which adds support for sRGB decoding
color glyphs. Meaning, the emoji pixman surfaces can be blended
directly to the grid, just like sixels.

Gamma-correct blending is enabled by default *when the compositor
supports it*. There's a new option to explicitly enable/disable it:
gamma-correct-blending=no|yes. If set to 'yes', and the compositor
does not implement the required color-management features, warning
logs are emitted.

There's a loss of precision when storing linear pixels in 8-bit
channels. For this reason, this patch also adds supports for 10-bit
surfaces. For now, this is disabled by default since such surfaces
only have 2 bits for alpha. It can be enabled with
tweak.surface-bit-depth=10-bit.

Perhaps, in the future, we can enable it by default if:

* gamma-correct blending is enabled
* the user has not enabled a transparent background
</content>
</entry>
<entry>
<title>config+render: allow cursor.style=hollow</title>
<updated>2025-02-19T10:50:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-19T10:44:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c41008da31aba42e3d0e25966af9eab27cfd3fac'/>
<id>urn:sha1:c41008da31aba42e3d0e25966af9eab27cfd3fac</id>
<content type='text'>
Closes #1965
</content>
</entry>
<entry>
<title>render: minimum window size: 2 cols -&gt; 1 col</title>
<updated>2025-02-10T12:19:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-10T11:42:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8b63869f5707a771e60ae745d1069860c9056cc5'/>
<id>urn:sha1:8b63869f5707a771e60ae745d1069860c9056cc5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: refactor reflow</title>
<updated>2025-02-10T12:19:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-10T07:57:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3d66db63ccb1baab2d78e6d104a9c15d3f6684d1'/>
<id>urn:sha1:3d66db63ccb1baab2d78e6d104a9c15d3f6684d1</id>
<content type='text'>
We've been trying to performance optimize reflow by "chunking" cells;
try to gather as many as possible, and memcpy a chunk at once.

The problem is that a) this quickly becomes very complex, and b) is
very hard to get right for multi-column characters, especially when we
need to truncate long ones due to the window being too small.

Refactor, and once again walk and copy all cells one by one. This is
slower, but at least it's correct.
</content>
</entry>
<entry>
<title>render: resize: note why min_cols=7</title>
<updated>2025-02-06T13:02:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-05T10:38:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a3a404a2570b72636da0583492d9cf87b700ef6b'/>
<id>urn:sha1:a3a404a2570b72636da0583492d9cf87b700ef6b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc: wip: kitty text size protocol</title>
<updated>2025-02-06T06:42:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-25T13:09:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7a8d2b5e012636def9545075e01cdf9a6f309355'/>
<id>urn:sha1:7a8d2b5e012636def9545075e01cdf9a6f309355</id>
<content type='text'>
This brings initial support for the new kitty text-sizing
protocol. Note hat only the width-parameter ('w') is supported. That
is, no font scaling, and no multi-line cells.

For now, only explicit widths are supported. That is, w=0 does not yet
work.

There are a couple of changes to the renderer, to handle e.g.

    OSC 66 ; w=6 ; foobar ST

There are two ways this can get rendered, depending on whether
grapheme shaping has been enabled. We either shape it, and get an
array of glyphs back that we render. Or, we rasterize each codepoint
ourselves, and render each resulting glyph.

The two cases ends up in two different renderer loops, that worked
somewhat different. In particular, the first case has probably never
been tested/used at all...

With this patch, both are changed, and now uses some heuristic to
differentiate between multi-cell text strings (like in the example
above), or single-cell combining characters. The difference is mainly
in which offset to use for the secondary glyphs.

In a multi-cell string, each glyph is mapped to its own cell, while in
the combining case, we try to map all glyphs to the same cell.
</content>
</entry>
<entry>
<title>render: resize: configure with only one dimension being zero</title>
<updated>2025-01-26T08:28:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-26T08:28:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=846271e8d3056ef3ecd3d2f4b7df6151e17c3c70'/>
<id>urn:sha1:846271e8d3056ef3ecd3d2f4b7df6151e17c3c70</id>
<content type='text'>
The protocol states:

    If the width or height arguments are zero, it means the client
    should decide its own window dimension. This may happen when the
    compositor needs to configure the state of the surface but doesn't
    have any information about any previous or expected dimension.

The wording is a bit ambiguous; does it mean we should set *both*
width and height to values we choose, even if only one dimension is
zero in the configure event? Or does it mean that we should choose the
value for the dimension that is zero in the configure event?

Regardless, it's pretty clear that it does *not* mean we should *only*
choose width and height if *both* dimensions are zero in the configure
event. This is foot's behavior before this patch, meaning if only one
of them is zero, foot assumed the compositor wanted us to set the
width (or height) to zero...

Change this, so that we now choose value for the "missing" dimension,
but do use the compositor provided value for the other dimension.

Closes #1925

Relevant issues:

* https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/155
* https://github.com/YaLTeR/niri/issues/1050
</content>
</entry>
<entry>
<title>Revert "config: don't allow colors.flash-alpha to be 1.0"</title>
<updated>2025-01-09T06:53:50Z</updated>
<author>
<name>Alexander Orzechowski</name>
<email>alex@ozal.ski</email>
</author>
<published>2025-01-05T02:36:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=301101e7d9d9675b48b874128a36ecf3005b727e'/>
<id>urn:sha1:301101e7d9d9675b48b874128a36ecf3005b727e</id>
<content type='text'>
This reverts commit 56d2c3e990509d18de31e6009e0d0c6254f99b67.
</content>
</entry>
<entry>
<title>render: Expose render_overlay</title>
<updated>2025-01-09T06:53:50Z</updated>
<author>
<name>Alexander Orzechowski</name>
<email>alex@ozal.ski</email>
</author>
<published>2025-01-05T03:26:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f0253633d3cdde994b48c25692707e1df2f1e1e7'/>
<id>urn:sha1:f0253633d3cdde994b48c25692707e1df2f1e1e7</id>
<content type='text'>
This function updates the overlay that foot uses. It will be used to
update the overlay when the flash effect ends.
</content>
</entry>
<entry>
<title>render: fix order we're checking custom codepoints</title>
<updated>2025-01-03T06:33:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-03T06:33:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f5c10a245229fe173d58ecdc71e4a917524eaf7b'/>
<id>urn:sha1:f5c10a245229fe173d58ecdc71e4a917524eaf7b</id>
<content type='text'>
Fixes a crash when trying to print a "Legacy Computing"
symbol (U+1FB00-U+1FB9B).

Closes #1901
</content>
</entry>
<entry>
<title>config: don't allow colors.flash-alpha to be 1.0</title>
<updated>2025-01-02T08:10:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-02T08:08:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=56d2c3e990509d18de31e6009e0d0c6254f99b67'/>
<id>urn:sha1:56d2c3e990509d18de31e6009e0d0c6254f99b67</id>
<content type='text'>
A compositor will not send a frame callback for our main window if it
is fully occluded (for example, by a fully opaque overlay...). This
causes the overlay to stuck.

For regular buffers, it _should_ be enough to *not* hint the
compositor it's opaque. But at least some compositor special cases
single-pixel buffers, and actually look at their pixel value.

Thus, we have two options: implement frame callback handling for the
overlay sub-surface, or ensure we don't use a fully opaque
surface. Since no overlays are fully opaque by default, and the flash
surface is the only one that can be configured to be
opaque (colors.flash-alpha), and since adding frame callback handling
adds a lot of boilerplate code... let's go with the simpler solution
of
</content>
</entry>
<entry>
<title>box-drawings: implement octants</title>
<updated>2024-12-08T11:55:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-12-08T08:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9a1b59adaec22434473789953884c9b6db58e9a5'/>
<id>urn:sha1:9a1b59adaec22434473789953884c9b6db58e9a5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: remove unnecessary call to wl_surface_damage_buffer()</title>
<updated>2024-10-06T09:26:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-10-06T09:26:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e891abdd6a6652bd46b28c1988700a7f30931210'/>
<id>urn:sha1:e891abdd6a6652bd46b28c1988700a7f30931210</id>
<content type='text'>
The damage region(s) are translated to wl_surface_damage_buffer()
calls after the entire frame has been rendered.
</content>
</entry>
<entry>
<title>render: sixels: update damage region when rendering sixels</title>
<updated>2024-10-05T06:55:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-10-05T06:53:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ce38f5b41395963bd17f9f998802945db4987a2b'/>
<id>urn:sha1:ce38f5b41395963bd17f9f998802945db4987a2b</id>
<content type='text'>
This fixes flickering when foot is forced to double-buffer (e.g when
running under KDE, or smithay based compositors).

Since the damage region isn't updated, the sixel images aren't
included in the memcpy that is done to transfer the last frame's
updated regions to the next frame.

As a result, every other frame will have the sixels, while the others
don't.

Closes #1851
</content>
</entry>
</feed>
