summaryrefslogtreecommitdiff
path: root/include/yasl
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-11 23:35:00 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-11 23:35:00 +0300
commit5bbcd2c036dd19d3293d9abc4d44014a5108a5ed (patch)
tree2ca0c8f4df7527a9596ef6fb011a6d2c0f742b9e /include/yasl
parent5530c662bb53837d64a154e3b580d41adb6cc8b9 (diff)
opt: shrink input event to 48B, pack mouse event to 32B, and shave 2KB off yasl_surface
- Compact yasl_mouse_event from 36B to 32B (half a cacheline, 0 holes) - Compact yasl_input_event from 56B to 48B (0 holes) - Reduce yasl_surface by 2,048 bytes (shaving 32 full cachelines per surface) - Optimize UTF-8 sanitize with vectorized validation fast-path - Fast-path MIME prefix match in clipboard transfers
Diffstat (limited to 'include/yasl')
-rw-r--r--include/yasl/yasl.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/yasl/yasl.h b/include/yasl/yasl.h
index 081e1f0..c211a0b 100644
--- a/include/yasl/yasl.h
+++ b/include/yasl/yasl.h
@@ -208,12 +208,12 @@ struct yasl_key_event {
struct yasl_mouse_event {
struct yasl_vector2i pos;
- int button;
+ int16_t button;
+ int16_t scroll_lines;
enum yasl_pointer_kind kind;
+ enum yasl_pointer_device device;
uint32_t mods;
- int scroll_lines;
float scroll_delta;
- enum yasl_pointer_device device;
struct yasl_pointer_pen pen;
};
@@ -227,8 +227,9 @@ enum yasl_input_kind {
};
struct yasl_input_event {
- enum yasl_input_kind kind;
struct yasl_surface *surface;
+ enum yasl_input_kind kind;
+ uint32_t reserved;
union {
struct yasl_key_event key;
struct yasl_mouse_event mouse;