From 9de8ee143c24ef8ade01670fb8ce7c216dbd2c13 Mon Sep 17 00:00:00 2001 From: boreddevnl Date: Wed, 1 Apr 2026 22:18:57 +0200 Subject: [PATCH] OPT: Reduce render calls when zooming --- src/sys/syscall.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sys/syscall.c b/src/sys/syscall.c index 31a00bb..132bd3a 100644 --- a/src/sys/syscall.c +++ b/src/sys/syscall.c @@ -119,15 +119,18 @@ static void user_window_resize(Window *win, int w, int h) { extern void kfree(void* ptr); extern void serial_write(const char *str); - if (win->pixels) kfree(win->pixels); if (win->comp_pixels) kfree(win->comp_pixels); win->pixels = (uint32_t *)kmalloc(w * h * sizeof(uint32_t)); win->comp_pixels = (uint32_t *)kmalloc(w * h * sizeof(uint32_t)); + win->w = w; + win->h = h; + if (win->pixels) { - for (int i = 0; i < w * h; i++) win->pixels[i] = 0; + extern void mem_memset(void *dest, int val, size_t len); + mem_memset(win->pixels, 0, w * h * sizeof(uint32_t)); } }