Commit graph

3215 commits

Author SHA1 Message Date
Daniel Eklöf
e4ae5a7586
generate-alt-random: ioctl(TIOCGWINSZ) may fail in run inside a container
This _should_ only happen when we’re doing a partial PGO build, since
then the script is run in the parent terminal. In this case, the user
is expected to use --rows/--cols anyway.
2020-12-21 13:40:53 +01:00
Daniel Eklöf
aa13dfb4e8
install: remove -march=native
This simplifies the instructions. People interested in performance are
likely to know how to use it.
2020-12-21 13:01:38 +01:00
Daniel Eklöf
a83f2448bc
Merge branch 'clang-wno-profile-instr-unprofile' 2020-12-21 13:01:11 +01:00
Daniel Eklöf
4fe95e6354
install.md: mention that packagers should not use -march=native 2020-12-21 12:24:47 +01:00
Daniel Eklöf
5a1dcbb04d
install.md: add -Wno-profile-instr-unprofiled to clang flags in PGO builds 2020-12-21 12:24:29 +01:00
Daniel Eklöf
e95798e608
changelog: use -std=c11 instead of -std=c18 2020-12-21 12:20:08 +01:00
Daniel Eklöf
86c69aed05
Merge branch 'meson-c11' 2020-12-21 12:17:49 +01:00
Daniel Eklöf
288ea360cb
install: fix typo in ‘ninja’ 2020-12-21 12:15:59 +01:00
sterni
b4c9238f3f meson: default to c11
We don't need any C18 specifics, so C11 is also fine and more widely
supported (i. e. in older clang versions).
2020-12-20 16:44:41 +01:00
Daniel Eklöf
e4620071b0
Merge branch 'releases/1.6' 2020-12-20 15:51:04 +01:00
Daniel Eklöf
fbe9f54db0
changelog: update ‘contributors’ 2020-12-20 15:49:24 +01:00
Daniel Eklöf
533db90a94
changelog: remove trailing ‘5’ 2020-12-20 15:48:25 +01:00
Daniel Eklöf
e12a9347dd
generate-alt-random: override detected width/height when --cols/--rows have been used
This ensures we have a valid width and height, that matches what the
PGO helper binary expects.
2020-12-20 15:46:46 +01:00
Daniel Eklöf
983f474ec8
generate-alt-random: fix “new style” cube escape
It’s “38:5:<idx>”, not “38:2:5:<idx>”.
2020-12-20 15:46:43 +01:00
sterni
d1735ffb6d
generate-alt-random-writes: use python random, allow setting a seed
Using Python's own PRNG should make the code cleaner and allow for
reproducible stimulus files if that is desired via setting --seed (at
least for the same versions of the script, changing the kind and/or
order of the random calls will of course impact the output in the
future).

I did the following substitutions:

* rand.read(1)[0] % n and struct.unpack('@H', rand.read(2))[0] % n →
  random.randrange(n)
* rand.read(1)[0] → random.randrange(256)
* rand.read(n) → [random.randrange(256) for _ in range(n)]
  (better alternative would have been random.randbytes(n), but is only
  available for Python >= 3.9, switching to this in the future will
  impact output)
* list[rand.read(1) % len(list)] → random.choice(list)
2020-12-20 15:46:40 +01:00
Daniel Eklöf
a2ce0622c5
render: fix rounding error when calculating background color with alpha
We use pre-multiplied alpha color channels, but were having bad
rounding errors due to the alpha divider being truncated to an
integer.

The algorithm for pre-multiplying a color channel is:

  alpha_divider = 0xffff / alpha
  pre_mult_color = color / alpha_divider

In order to fix the rounding errors, we could turn ‘alpha_divider’
into a double.

That however would introduce a performance penalty since now we’d need
to do floating point math for each cell.

The algorithm can be trivially converted to:

  pre_mult_color = color * alpha / 0xffff

Since both color and alpa values are < 65536, the multiplication is
“safe”; it will not overflow an uint32_t.

Closes #249
2020-12-20 15:46:32 +01:00
Daniel Eklöf
06f84b9aaf
meson: add wl_proto_headers to pgo executable
This fixes a build failure of pgo.o
2020-12-20 15:46:28 +01:00
Daniel Eklöf
3fd60d4975
changelog: mention meson dependency fix 2020-12-20 15:46:24 +01:00
Daniel Eklöf
b976d10f7d
changelog: add 1.6.1 section 2020-12-20 15:46:05 +01:00
Craig Barnes
18b027f26b
meson: add missing "wl_proto_headers" dependency for pgolib and vtlib
Dependency chains:

* pgolib -> terminal.c -> terminal.h -> wayland.h
* vtlib -> csi.c -> config.h -> wayland.h

wayland.h includes <primary-selection-unstable-v1.h>, which must be
generated by a custom_target() rule *before* any sources that require
it are built. Failure to fully specify these dependencies can otherwise
result in a race condition, where a dependent source file gets compiled
(and fails with a "header not found" error) before the header itself
has been generated.
2020-12-20 15:44:20 +01:00
Craig Barnes
9e7d108afd
changelog: fix link to "1.6.0" heading 2020-12-20 15:44:09 +01:00
Daniel Eklöf
eadc1c58a2
term: fix builds with debug logging enabled
DPI_AWARE_ON has been renamed to DPI_AWARE_YES
2020-12-20 15:43:26 +01:00
Daniel Eklöf
ede5661d50
changelog: update ‘contributors’ 2020-12-20 15:42:32 +01:00
Daniel Eklöf
e9dea5bb9d
generate-alt-random: override detected width/height when --cols/--rows have been used
This ensures we have a valid width and height, that matches what the
PGO helper binary expects.
2020-12-20 15:36:07 +01:00
Daniel Eklöf
21cb4671a4
generate-alt-random: fix “new style” cube escape
It’s “38:5:<idx>”, not “38:2:5:<idx>”.
2020-12-20 15:27:27 +01:00
Daniel Eklöf
1d7595d1db
Merge branch 'random-seed' 2020-12-20 15:27:03 +01:00
sterni
050da302b8 generate-alt-random-writes: use python random, allow setting a seed
Using Python's own PRNG should make the code cleaner and allow for
reproducible stimulus files if that is desired via setting --seed (at
least for the same versions of the script, changing the kind and/or
order of the random calls will of course impact the output in the
future).

I did the following substitutions:

* rand.read(1)[0] % n and struct.unpack('@H', rand.read(2))[0] % n →
  random.randrange(n)
* rand.read(1)[0] → random.randrange(256)
* rand.read(n) → [random.randrange(256) for _ in range(n)]
  (better alternative would have been random.randbytes(n), but is only
  available for Python >= 3.9, switching to this in the future will
  impact output)
* list[rand.read(1) % len(list)] → random.choice(list)
2020-12-20 14:52:27 +01:00
Daniel Eklöf
c60c8d93f7
Merge branch 'subproject-wrap' 2020-12-20 14:37:02 +01:00
Daniel Eklöf
339acc57cf
render: fix rounding error when calculating background color with alpha
We use pre-multiplied alpha color channels, but were having bad
rounding errors due to the alpha divider being truncated to an
integer.

The algorithm for pre-multiplying a color channel is:

  alpha_divider = 0xffff / alpha
  pre_mult_color = color / alpha_divider

In order to fix the rounding errors, we could turn ‘alpha_divider’
into a double.

That however would introduce a performance penalty since now we’d need
to do floating point math for each cell.

The algorithm can be trivially converted to:

  pre_mult_color = color * alpha / 0xffff

Since both color and alpa values are < 65536, the multiplication is
“safe”; it will not overflow an uint32_t.

Closes #249
2020-12-20 12:25:12 +01:00
Daniel Eklöf
35e28fc503
meson: add wl_proto_headers to pgo executable
This fixes a build failure of pgo.o
2020-12-20 12:15:40 +01:00
Daniel Eklöf
9a0a642a5e
changelog: mention meson dependency fix 2020-12-20 11:56:18 +01:00
Daniel Eklöf
d85d9fafcb
Merge branch 'meson-dep-fixes' 2020-12-20 11:53:26 +01:00
Daniel Eklöf
f56695cfff
Merge branch 'changelog-link-fix' 2020-12-20 11:52:08 +01:00
Craig Barnes
da47deee10 changelog: fix link to "1.6.0" heading 2020-12-19 22:50:18 +00:00
Craig Barnes
013cca646d meson: use wrap files for fcft/tllist subprojects
See: https://mesonbuild.com/Wrap-dependency-system-manual.html
2020-12-19 22:43:09 +00:00
Craig Barnes
7dc6036ca9 meson: add missing "wl_proto_headers" dependency for pgolib and vtlib
Dependency chains:

* pgolib -> terminal.c -> terminal.h -> wayland.h
* vtlib -> csi.c -> config.h -> wayland.h

wayland.h includes <primary-selection-unstable-v1.h>, which must be
generated by a custom_target() rule *before* any sources that require
it are built. Failure to fully specify these dependencies can otherwise
result in a race condition, where a dependent source file gets compiled
(and fails with a "header not found" error) before the header itself
has been generated.
2020-12-19 22:09:03 +00:00
Daniel Eklöf
2a82096749
term: fix builds with debug logging enabled
DPI_AWARE_ON has been renamed to DPI_AWARE_YES
2020-12-18 17:32:54 +01:00
Daniel Eklöf
9dff817d31
changelog: add new ‘unreleased’ section 2020-12-18 15:02:08 +01:00
Daniel Eklöf
c86df29a98
Merge branch 'releases/1.6' 2020-12-18 15:01:27 +01:00
Daniel Eklöf
098a7e42cb
meson/pkgbuild: bump version to 1.6.0 2020-12-18 14:52:10 +01:00
Daniel Eklöf
8cc179cc53
changelog: prepare for 1.6.0 2020-12-18 14:51:34 +01:00
Daniel Eklöf
59e4243f2a
changelog: move entry for dpi-aware up, to make it more visible 2020-12-18 14:46:56 +01:00
Daniel Eklöf
c1dc38e813
changelog: use code/monospace highlighting for foot.ini config options 2020-12-18 14:46:16 +01:00
Daniel Eklöf
5c59e38cf4
Merge branch 'dpi-aware-when-scaling-factor-is-one' 2020-12-18 14:42:48 +01:00
Daniel Eklöf
397154bd4e
Merge branch 'statusline-terminfo-caps'
Closes #242
2020-12-18 14:41:31 +01:00
Daniel Eklöf
fa93a97a08
terminfo: add status line capabilities: hs, dsl, fsl and tsl
* hs  - boolean, signals status line availability
* tsl - to_status_line: begin an OSC 2 sequence (set window title)
* fsl - from_status_line: OSC terminator
* dsl - disable status line: \E]2;\E\\ - clears the window title

Closes #242
2020-12-18 13:46:57 +01:00
Daniel Eklöf
34fe1e3f81
Merge branch 'gruvbox-light' 2020-12-17 12:37:23 +01:00
Daniel Eklöf
57e535908d
readme: describe the new font sizing behavior 2020-12-17 12:19:13 +01:00
Daniel Eklöf
0a821f2ed4
fonts: size fonts using the scaling factor when output scaling is enabled
This extends the new ‘dpi-aware’ option with a new default value,
‘auto’.

When set to ‘auto’, fonts are sized using monitors’ DPI when output
scaling is disabled. When output scaling is enabled, fonts are instead
sized using the scaling factor.

The reasoning here is that a user that has enabled output scaling is
obviously *not* relying on DPI scaling.

Output scaling can also be a way to compensate for different viewing
distances, in which case we do *not* want to break that by using DPI
scaling.

Users can still force DPI-only font sizing by setting ‘dpi-aware=yes’,
or disable it completely by setting ‘dpi-aware=no’.
2020-12-17 12:05:22 +01:00
AdrienLeGuillou
24131a896f Add a gruvebox-light theme 2020-12-17 09:25:53 +01:00