LibWeb+WebContent+WebWorker: Add an option to skip painting the overlay

This will allow the Inspector to take a screenshot of a DOM node without
the overlay which renders the inspected node outline / box data.
This commit is contained in:
Timothy Flynn 2023-12-06 11:49:45 -05:00 committed by Andreas Kling
commit a7b98a9761
Notes: sideshowbarker 2024-07-18 08:59:31 +09:00
8 changed files with 26 additions and 8 deletions

View file

@ -140,7 +140,7 @@ Gfx::Color PageClient::background_color() const
return document->background_color();
}
void PageClient::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& target)
void PageClient::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& target, Web::PaintOptions paint_options)
{
Gfx::IntRect bitmap_rect { {}, content_rect.size().to_type<int>() };
@ -162,6 +162,7 @@ void PageClient::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& ta
return;
context.set_should_show_line_box_borders(m_should_show_line_box_borders);
context.set_should_paint_overlay(paint_options.paint_overlay == Web::PaintOptions::PaintOverlay::Yes);
context.set_device_viewport_rect(content_rect);
context.set_has_focus(m_has_focus);
document->paintable()->paint_all_phases(context);