1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 23:48:11 +00:00

LibAccelGfx+WebContent: Use the same Painter across page repaints

In the upcoming changes, Painter will be used to store the state of
OpenGL context. For example, if Painter is aware of the shader that
have already been loaded, it will be possible to reuse them across
repaints. Also, it would be possible to manage state of loaded textures
and add/remove them depending on which ones are present in the next
sequence of painting commands.
This commit is contained in:
Aliaksandr Kalenik 2023-11-02 00:01:16 +01:00 committed by Andreas Kling
parent e73a1803ac
commit 1e85bf221d
7 changed files with 54 additions and 27 deletions

View file

@ -8,16 +8,14 @@
namespace Web::Painting {
PaintingCommandExecutorGPU::PaintingCommandExecutorGPU(Gfx::Bitmap& bitmap)
: m_target_bitmap(bitmap)
, m_canvas(AccelGfx::Canvas::create(AccelGfx::Context::the(), bitmap))
, m_painter(m_canvas)
PaintingCommandExecutorGPU::PaintingCommandExecutorGPU(AccelGfx::Painter& painter)
: m_painter(painter)
{
}
PaintingCommandExecutorGPU::~PaintingCommandExecutorGPU()
{
m_canvas.flush();
m_painter.flush();
}
CommandResult PaintingCommandExecutorGPU::draw_text_run(Color const&, Gfx::IntPoint const&, String const&, Gfx::Font const&)