]> git.eshelyaron.com Git - emacs.git/commit
Use a cache on Haiku to avoid constantly reading fonts during font lookup
authorPo Lu <luangruo@yahoo.com>
Thu, 21 Apr 2022 03:09:22 +0000 (03:09 +0000)
committerPo Lu <luangruo@yahoo.com>
Thu, 21 Apr 2022 03:09:22 +0000 (03:09 +0000)
commit8c282d68bde6d8ef348da5ca30f697f6a47e5b81
tree956add41fe468f4cc7c865550c1429a89d0fb5b7
parentab530ddeb57084993fbf5f5857f3f8f3b4ec606c
Use a cache on Haiku to avoid constantly reading fonts during font lookup

* src/haiku_font_support.cc (struct font_object_cache_bucket):
New struct.
(language_code_points): Make `int'.
(hash_string): New function.
(cache_font_object_data, lookup_font_object_data)
(font_object_has_chars): New functions.
(font_check_wanted_chars, font_check_one_of)
(font_check_language): Lookup in cached font object instead.
(be_init_font_data, be_evict_font_cache): New functions.

* src/haiku_support.h (struct haiku_font_pattern): Make
`uint32_t's ints instead.
* src/haikufont.c (haikufont_apply_registry, syms_of_haikufont):
Adjust for those changes.

* src/haikuterm.c (haiku_frame_up_to_date): Clear font lookup
cache every 50 updates.
src/haiku_font_support.cc
src/haiku_support.h
src/haikufont.c
src/haikuterm.c