mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibWeb: Add ability to present LibGL framebuffer and add clearing
This commit is contained in:
parent
68d9d4e247
commit
076c9772a4
Notes:
sideshowbarker
2024-07-17 10:16:03 +09:00
Author: https://github.com/Lubrsi
Commit: 076c9772a4
Pull-request: https://github.com/SerenityOS/serenity/pull/14184
Reviewed-by: https://github.com/Quaker762 ✅
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/sunverwerth
8 changed files with 131 additions and 1 deletions
|
@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue