1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:07:43 +00:00

LibWeb: Add ability to present LibGL framebuffer and add clearing

This commit is contained in:
Luke Wilde 2022-06-04 04:27:48 +01:00 committed by Linus Groh
parent 68d9d4e247
commit 076c9772a4
8 changed files with 131 additions and 1 deletions

View file

@ -35,8 +35,11 @@ void CanvasPaintable::paint(PaintContext& context, PaintPhase phase) const
if (!context.viewport_rect().intersects(enclosing_int_rect(absolute_rect())))
return;
if (layout_box().dom_node().bitmap())
if (layout_box().dom_node().bitmap()) {
// FIXME: Remove this const_cast.
const_cast<HTML::HTMLCanvasElement&>(layout_box().dom_node()).present();
context.painter().draw_scaled_bitmap(absolute_rect().to_rounded<int>(), *layout_box().dom_node().bitmap(), layout_box().dom_node().bitmap()->rect(), 1.0f, to_gfx_scaling_mode(computed_values().image_rendering()));
}
}
}