LibGUI: Rework window rendering

Abstract drawing surface to Texture. All windows now contain a texture
matching its size.
This commit is contained in:
2025-05-05 23:08:01 +03:00
parent f78c7e7926
commit f959905adf
6 changed files with 40 additions and 214 deletions

View File

@@ -7,10 +7,11 @@
void randomize_color(BAN::UniqPtr<LibGUI::Window>& window)
{
auto& texture = window->texture();
uint32_t color = ((rand() % 255) << 16) | ((rand() % 255) << 8) | ((rand() % 255) << 0);
for (uint32_t y = 0; y < window->height(); y++)
for (uint32_t x = 0; x < window->width(); x++)
window->set_pixel(x, y, 0xFF000000 | color);
texture.set_pixel(x, y, 0xFF000000 | color);
window->invalidate();
}