mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibWebView: Add OOPWV "content scales to viewport" hint
By setting this hint, you indicate to OOPWV that the content inside will scale itself to the viewport size. In such situations, it's fine for OOPWV to reuse a scaled version of an outdated backing store while the view is being resized.
This commit is contained in:
parent
c55739bbc0
commit
ed3c2cbdf6
Notes:
sideshowbarker
2024-07-17 07:20:57 +09:00
Author: https://github.com/awesomekling
Commit: ed3c2cbdf6
Pull-request: https://github.com/SerenityOS/serenity/pull/16935
Reviewed-by: https://github.com/lanmonster
Reviewed-by: https://github.com/linusg
2 changed files with 15 additions and 1 deletions
|
@ -106,7 +106,10 @@ void OutOfProcessWebView::paint_event(GUI::PaintEvent& event)
|
|||
if (auto* bitmap = m_client_state.has_usable_bitmap ? m_client_state.front_bitmap.bitmap.ptr() : m_backup_bitmap.ptr()) {
|
||||
painter.add_clip_rect(frame_inner_rect());
|
||||
painter.translate(frame_thickness(), frame_thickness());
|
||||
painter.blit({ 0, 0 }, *bitmap, bitmap->rect());
|
||||
if (m_content_scales_to_viewport)
|
||||
painter.draw_scaled_bitmap(rect(), *bitmap, bitmap->rect());
|
||||
else
|
||||
painter.blit({ 0, 0 }, *bitmap, bitmap->rect());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -841,4 +844,9 @@ void OutOfProcessWebView::notify_server_did_get_accessibility_tree(DeprecatedStr
|
|||
on_get_accessibility_tree(accessibility_tree);
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::set_content_scales_to_viewport(bool b)
|
||||
{
|
||||
m_content_scales_to_viewport = b;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue