1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:07:35 +00:00

Refactor GUI rendering model to be two-phased.

Instead of clients painting whenever they feel like it, we now ask that they
paint in response to a paint message.

After finishing painting, clients notify the WindowServer about the rect(s)
they painted into and then flush eventually happens, etc.

This stuff leaves us with a lot of badly named things. Need to fix that.
This commit is contained in:
Andreas Kling 2019-01-26 05:20:32 +01:00
parent 3a401d5249
commit 7cf3c7461c
16 changed files with 117 additions and 40 deletions

View file

@ -8,7 +8,7 @@
#include <Kernel/Syscall.h>
#include <SharedGraphics/GraphicsBitmap.h>
#include <SharedGraphics/Painter.h>
#include "gui.h"
#include <LibC/gui.h>
static void paint(GraphicsBitmap& bitmap, int width, int height);
@ -68,8 +68,12 @@ int main(int argc, char** argv)
case GUI_Event::Type::WindowDeactivated: dbgprintf("WID=%x WindowDeactivated\n", event.window_id); break;
}
if (event.type == GUI_Event::Type::MouseDown) {
if (event.type == GUI_Event::Type::Paint) {
paint(*bitmap, backing.size.width, backing.size.height);
gui_notify_paint_finished(window_id, nullptr);
}
if (event.type == GUI_Event::Type::MouseDown) {
gui_invalidate_window(window_id, nullptr);
}