mirror of
https://github.com/BoredDevNL/BoredOS.git
synced 2026-05-15 18:58:40 +00:00
OPT: Reduce render calls when zooming
This commit is contained in:
parent
8d5fa53d3e
commit
9de8ee143c
1 changed files with 5 additions and 2 deletions
|
|
@ -119,15 +119,18 @@ static void user_window_resize(Window *win, int w, int h) {
|
||||||
extern void kfree(void* ptr);
|
extern void kfree(void* ptr);
|
||||||
extern void serial_write(const char *str);
|
extern void serial_write(const char *str);
|
||||||
|
|
||||||
|
|
||||||
if (win->pixels) kfree(win->pixels);
|
if (win->pixels) kfree(win->pixels);
|
||||||
if (win->comp_pixels) kfree(win->comp_pixels);
|
if (win->comp_pixels) kfree(win->comp_pixels);
|
||||||
|
|
||||||
win->pixels = (uint32_t *)kmalloc(w * h * sizeof(uint32_t));
|
win->pixels = (uint32_t *)kmalloc(w * h * sizeof(uint32_t));
|
||||||
win->comp_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) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue