Commit graph

4763 commits

Author SHA1 Message Date
Craig Barnes
ed0ef4bb1d log: simplify Boolean logic for setting "colorize" var in log_init() 2021-09-15 16:18:05 +01:00
Daniel Eklöf
f84320b5d6
Merge branch 'braille'
Closes #702
2021-09-14 10:27:06 +02:00
Daniel Eklöf
e426e77b1d
box-drawing: braille: prefer increasing spacing over dot width
Too large dots make them harder to distinguish, when the spacing
between them is small.

Prefer increasing the spacing, instead of increasing the dot
size. This looks better at small font sizes in particular.
2021-09-14 10:20:07 +02:00
Daniel Eklöf
37b15adcd8
term: turn ‘box-drawings’ array into three dynamically allocated arrays
The box_drawings array is now quite large, and uses up ~4K
when *empty*.

This patch splits it up into three separate, dynamically allocated
arrays; one for the traditional box+line drawing and block elements
glyphs, one for braille, and one for the legacy computing symbols.

When we need to render a glyph, the *entire* array (that it belongs
to) is allocated.

I.e this is one step closer to a dynamic glyph cache (like the one
fcft uses), but doesn’t go all the way.

This is especially nice for people with
‘box-drawings-uses-font-glyphs=yes’; for them, the custom glyphs now
uses 3*8 bytes (for the three array pointers), instead of 4K.
2021-09-14 09:50:49 +02:00
Daniel Eklöf
ac2091f107
box-drawing: NOINLINE braille 2021-09-12 19:22:14 +02:00
Daniel Eklöf
896825f50c
render: codespell: aquire -> acquire 2021-09-12 19:22:14 +02:00
Daniel Eklöf
b4c759e2de
box-drawing: add braille characters
Render braille ourselves, instead of using font glyphs. Decoding a
braille character is easy enough; there are 256 codepoints,
represented by an 8-bit integer (i.e. subtract the Unicode codepoint
offset, 0x2800, and you’re left with an integer in the range 0-255).

Each bit corresponds to a dot. The first 6 bits represent the upper 6
dots, while the two last bits represent the fourth (and last) row of
dots.

The hard part is sizing the dots and the spacing between them.

The aim is to have the spacing between the dots be the same size as
the dots themselves, and to have the margins on each side be half the
size of the dots.

In a perfectly sized cell, this means two braille characters next to
each other will be evenly spaced.

This is however almost never the case. The layout logic currently:

* Set dot size to either the width / 4, or height / 8, depending on
  which one is smallest.

* Horizontal spacing is initialized to the width / 4

* Vertical spacing is initialized to the height / 8

* Horizontal margins are initialized to the horizontal spacing / 2

* Vertical margins are initialized to the vertical spacing / 2.

Next, we calculate the number of “remaining” pixels. That is, if we
add the left margin, two dots and the spacing between, how many pixels
are left on the horizontal axis?

These pixels are distributed in the following order (we “stop” as soon
as we run out of pixels):

* If the dot size is 0 (happens for very small font sizes), increase
  it to 1.
* If the margins are 0, increase them to 1.
* If we have enough pixels (need at 2 horizontal and 4 vertical),
  increase the dot size.
* Increase spacing.
* Increase margins.

Closes #702
2021-09-12 19:22:12 +02:00
Daniel Eklöf
f9d968b4c7
Merge branch 'pgo-script'
Closes #701
2021-09-12 19:11:44 +02:00
Daniel Eklöf
32900207f9
changelog: pgo build scripts 2021-09-12 16:59:23 +02:00
Daniel Eklöf
aa0f2a71cc
install.md: document pgo/*.sh scripts 2021-09-12 16:57:07 +02:00
Daniel Eklöf
b6df5f6456
pgo.sh: set -x *after* verifying input 2021-09-12 16:11:42 +02:00
Daniel Eklöf
7e53de263b
pkgbuild: add back --prefix --wrap-mode=nofallback 2021-09-12 10:39:45 +02:00
Daniel Eklöf
e77c3b3e4f
pkgbuild: add ‘auto’ to the list of possible PGO values 2021-09-12 10:39:45 +02:00
Daniel Eklöf
5493267bf7
pgo: pgo.sh: remove both gcc and clang generated profile stats 2021-09-12 10:39:45 +02:00
Daniel Eklöf
2181af0552
pkgbuild: the pgo script erases the old profdata files 2021-09-12 10:39:45 +02:00
Daniel Eklöf
a941253ba7
pgo: pgo.sh: add meson bld/src dir arguments last 2021-09-12 10:39:45 +02:00
Daniel Eklöf
6d67c2b4ab
pgo: pgo.sh: run ‘find’ in the build-directory, not cwd 2021-09-12 10:39:45 +02:00
Daniel Eklöf
e907ec209c
pgo: pgo.sh: allow a pre-existing build directory 2021-09-12 10:39:45 +02:00
Daniel Eklöf
579e1f80b4
pkgbuild: build using pgo/pgo.sh 2021-09-12 10:39:44 +02:00
Daniel Eklöf
cf7c5050f6
pgo: pgo.sh: auto: don’t use full-headless-sway
This requires Sway >= 1.6.2, which hasn’t been released yet. Thus,
don’t auto-use it.

Users can still request it explicitly.
2021-09-12 10:39:44 +02:00
Daniel Eklöf
99c4e51e19
pgo: add set -x to all PGO scripts
Without this, debugging error reports from users is going to be _very_
difficult...
2021-09-12 10:39:44 +02:00
Daniel Eklöf
f25055f101
pgo: full-headless-cage: remove references to Sway 2021-09-12 10:39:44 +02:00
Daniel Eklöf
801bce335b
pgo: full-headless-cage: new headless variant
Appears to work, but cage spams a lot of

 00:00:08.026 [types/wlr_output.c:720] Basic output test failed for HEADLESS-1
 00:00:08.036 [types/wlr_output.c:720] Basic output test failed for HEADLESS-1
2021-09-12 10:39:44 +02:00
Daniel Eklöf
3a34b94f2e
pgo: full-inner: quote path in trap’s “rm” command 2021-09-12 10:39:44 +02:00
Daniel Eklöf
aeb510182b
pgo: full-inner: remove -o tweak.render-timer=log 2021-09-12 10:39:44 +02:00
Daniel Eklöf
a43ae0d098
pgo: replace meson-pgo.sh with several script primitives
All scripts are in the ‘pgo’ directory:

* options: command line options for generate-alt-random-writes.py,
  sourced by other scripts.

* pgo.sh: top-level script, generates a meson build directory, selects
  a PGO method, generates the profiling data, re-configures the meson
  build directory and does the final build.

  This script is intended to be used by end-users, and shows _how_ to
  integrate the script primitives.

  Build servers will most likely *not* want to use this script as-is.

* partial.sh: generates alt-random-write data and runs “foot{,client}
  --version”, and then feeds the alt-random data to the PGO helper
  binary. Does not require a running Wayland session. Touches
  $blddir/pgo-ok on success.

* full-inner.sh: runs “footclient --version”, and then a complex
  “foot” command that first generates alt-random-write data, and then
  “cat’s” it. Requires a running Wayland session, *but*, this script
  is usually not called directly (see below). Touches $blddir/pgo-ok
  onsucces..

* full-current-session.sh: runs full-inner.sh. That is, it runs foot
  in the currently running Wayland session. Note that this will pop up a
  foot window.

* full-headless-sway.sh: generates a custom Sway configuration that
  exec’s foot-headless-sway-inner.sh (see below), and then executes a
  headless Sway. In other words, this script does a *full* PGO build,
  but *without* requiring a running Wayland session. Requires Sway >=
  1.6.2.

* full-headless-sway.sh: runs full-inner.sh + “swaymsg exit”.

To do a custom PGO build, without using pgo.sh, you’d need to:

CFLAGS=”$CFLAGS -O3” meson --buildtype=release -Db_lto=true
meson configure -Db_pgo=generate
ninja
ninja test (only needed if tllist+fcft are built as subprojects)

Run *one* of:
  - partial.sh
  - full-current-session.sh
  - full-headless-sway.sh

meson configure -D b_pgo=use
ninja
2021-09-12 10:39:43 +02:00
Daniel Eklöf
540310924b
meson-pgo: document limitations/requirements 2021-09-12 10:39:43 +02:00
Daniel Eklöf
87b68f23cb
meson-pgo: headless-sway: export XDG_RUNTIME_DIR 2021-09-12 10:39:43 +02:00
Daniel Eklöf
098f2c0c88
meson-pgo: use as little path quoting as possible 2021-09-12 10:39:43 +02:00
Daniel Eklöf
575f9135ae
meson-pgo: do mode validation and mode evaluation at the same time 2021-09-12 10:39:43 +02:00
Daniel Eklöf
ac9b3025d8
meson-pgo: improved argument validation 2021-09-12 10:39:43 +02:00
Daniel Eklöf
a3b6ecf3b2
meson-pgo: add mode=none 2021-09-12 10:39:43 +02:00
Daniel Eklöf
8ea6c93515
meson-pgo: ‘auto’ now prefers full-headless-sway 2021-09-12 10:39:43 +02:00
Daniel Eklöf
5ab1cd3d64
meson-pgo: initial support for full PGO through headless Sway 2021-09-12 10:39:42 +02:00
Daniel Eklöf
ecf1b30d53
meson-pgo: remove debug output 2021-09-12 10:39:42 +02:00
Daniel Eklöf
ffc6fd7e03
meson-pgo: realpath() on build dir too 2021-09-12 10:39:42 +02:00
Daniel Eklöf
996356983b
meson-pgo: initial version of a meson wrapper script for PGO builds
Usage: meson-pgo.sh auto|partial|full <source-dir> <build-dir> <meson-options>

Note: build-dir must *not* exist before the script is run (but if it
does, the script will tell you so, and exit).

Supported compilers: gcc and clang

The script does *not* add _any_ custom meson options, except configure
-Db_pgo. Thus, you probably want to call it like this:

  meson-pgo.sh auto . /tmp/foot-pgo-build --buildtype=release -Db_lto=true
2021-09-12 10:39:42 +02:00
Daniel Eklöf
729cbc3ffd
Merge branch 'gnome-pointer-button-workaround'
Closes #709
2021-09-12 10:33:04 +02:00
Daniel Eklöf
e553e1076c
input: workaround GNOME issue with pointer button events
Under certain circumstances, GNOME will send multiple pointer button
press events, without any release or leave events in between.

This trips up our button tracking.

Workaround, by replacing the existing state for the pressed button
with the new state.

Previously, debug builds would assert (and thus crash), while release
builds would have multiple states for the same button,
causing (probably) issues like the title bar not being usable (as in,
cannot be dragged, buttons not working etc).

Hopefully closes #709
2021-09-12 10:32:22 +02:00
Daniel Eklöf
4853bcd139
Merge branch 'default-section-is-main' 2021-09-09 21:50:04 +02:00
Arnavion
b26fda7ef0 doc: Document that the default section can be reopened as [main] 2021-09-08 22:42:58 -07:00
Daniel Eklöf
d126662560
term: reduce scope of variable 2021-09-05 12:39:25 +02:00
Daniel Eklöf
b1a4d43845
sixel: call decsixel() directly, instead of going through sixel_put() 2021-09-05 11:09:45 +02:00
Daniel Eklöf
47c32d5913
sixel: avoid looking up color from palette for each sixel
Instead, do the palette lookup when we receive the DECGCI (i.e. when
the palette entry is selected), and store the actual color value in
our sixel struct.
2021-09-05 11:08:13 +02:00
Daniel Eklöf
f9642e9597
sixel: calculate default bg once, in init
We have all information we need to calculate the default background
color in sixel_init():

* Whether the image have transparency or not
* The current ANSI background color
2021-09-05 10:27:13 +02:00
Daniel Eklöf
f39a62fa5e
server: no need to clone the config to handle -N,--no-wait 2021-09-05 09:28:19 +02:00
Daniel Eklöf
26859a5168
render: unref clip region 2021-09-04 20:08:23 +02:00
Daniel Eklöf
32bceaa786
Merge branch 'check-font-is-monospace'
Closes #704
2021-09-03 20:52:44 +02:00
Daniel Eklöf
73b488a2b2
config: codespell: setting has only two ‘t’ 2021-08-31 20:01:35 +02:00
Daniel Eklöf
e51e085d7a
changelog: check if primary font is monospaced 2021-08-31 19:58:35 +02:00