particle/string: use fcft_text_run_rasterize() when available

This enables support for text shaping, and is required to render
e.g. 👩‍👩‍👧‍👧 correctly.

Since text-shaping is a fairly expensive operation, and since many
times the text is unchanged, we cache the last *rendered* string.

That is, we hash the instantiated string, and cache it along with the
text-run from fcft in the *particle* object (i.e. not the exposable).

This means two things:

* we only need to call fcft_text_run_rasterize() once per string
* if the string is the same as last time, we don’t have to call it at
  all.
This commit is contained in:
Daniel Eklöf 2021-05-24 17:38:43 +02:00
parent 18a0920ed9
commit a5bbf0b769
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 75 additions and 14 deletions

View file

@ -65,7 +65,7 @@ backend_wayland = wayland_client.found() and wayland_cursor.found()
# "My" dependencies, fallback to subproject
tllist = dependency('tllist', version: '>=1.0.1', fallback: 'tllist')
fcft = dependency('fcft', version: ['>=2.3.90', '<3.0.0'], fallback: 'fcft')
fcft = dependency('fcft', version: ['>=2.4.0', '<3.0.0'], fallback: 'fcft')
add_project_arguments(
['-D_GNU_SOURCE'] +