mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
Ladybird+LibWebView: Move APIs which only repaint to LibWebView
We can easily add hooks to notify the browsers of these events if any implementation-specific handling is needed in the future, but for now, these only repaint the client, which we can do in ViewImplementation.
This commit is contained in:
parent
ea7e1b5f53
commit
682a5f9b70
10 changed files with 14 additions and 42 deletions
|
@ -179,16 +179,6 @@ void OutOfProcessWebView::screen_rects_change_event(GUI::ScreenRectsChangeEvent&
|
|||
client().async_update_screen_rects(event.rects(), event.main_screen_index());
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_invalidate_content_rect(Badge<WebContentClient>, [[maybe_unused]] Gfx::IntRect const& content_rect)
|
||||
{
|
||||
request_repaint();
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_change_selection(Badge<WebContentClient>)
|
||||
{
|
||||
request_repaint();
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_request_cursor_change(Badge<WebContentClient>, Gfx::StandardCursor cursor)
|
||||
{
|
||||
set_override_cursor(cursor);
|
||||
|
|
|
@ -83,8 +83,6 @@ private:
|
|||
virtual void create_client(EnableCallgrindProfiling = EnableCallgrindProfiling::No) override;
|
||||
virtual void update_zoom() override;
|
||||
virtual void notify_server_did_layout(Badge<WebContentClient>, Gfx::IntSize content_size) override;
|
||||
virtual void notify_server_did_invalidate_content_rect(Badge<WebContentClient>, Gfx::IntRect const&) override;
|
||||
virtual void notify_server_did_change_selection(Badge<WebContentClient>) override;
|
||||
virtual void notify_server_did_request_cursor_change(Badge<WebContentClient>, Gfx::StandardCursor cursor) override;
|
||||
virtual void notify_server_did_request_scroll(Badge<WebContentClient>, i32, i32) override;
|
||||
virtual void notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint) override;
|
||||
|
|
|
@ -70,6 +70,16 @@ void ViewImplementation::server_did_paint(Badge<WebContentClient>, i32 bitmap_id
|
|||
}
|
||||
}
|
||||
|
||||
void ViewImplementation::server_did_invalidate_content_rect(Badge<WebContentClient>, Gfx::IntRect)
|
||||
{
|
||||
request_repaint();
|
||||
}
|
||||
|
||||
void ViewImplementation::server_did_change_selection(Badge<WebContentClient>)
|
||||
{
|
||||
request_repaint();
|
||||
}
|
||||
|
||||
void ViewImplementation::load(AK::URL const& url)
|
||||
{
|
||||
m_url = url;
|
||||
|
|
|
@ -48,6 +48,8 @@ public:
|
|||
String const& handle() const { return m_client_state.client_handle; }
|
||||
|
||||
void server_did_paint(Badge<WebContentClient>, i32 bitmap_id, Gfx::IntSize size);
|
||||
void server_did_invalidate_content_rect(Badge<WebContentClient>, Gfx::IntRect rect);
|
||||
void server_did_change_selection(Badge<WebContentClient>);
|
||||
|
||||
void load(AK::URL const&);
|
||||
void load_html(StringView, AK::URL const&);
|
||||
|
@ -138,8 +140,6 @@ public:
|
|||
Function<Gfx::IntRect()> on_fullscreen_window;
|
||||
|
||||
virtual void notify_server_did_layout(Badge<WebContentClient>, Gfx::IntSize content_size) = 0;
|
||||
virtual void notify_server_did_invalidate_content_rect(Badge<WebContentClient>, Gfx::IntRect const&) = 0;
|
||||
virtual void notify_server_did_change_selection(Badge<WebContentClient>) = 0;
|
||||
virtual void notify_server_did_request_cursor_change(Badge<WebContentClient>, Gfx::StandardCursor cursor) = 0;
|
||||
virtual void notify_server_did_request_scroll(Badge<WebContentClient>, i32, i32) = 0;
|
||||
virtual void notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint) = 0;
|
||||
|
|
|
@ -67,13 +67,13 @@ void WebContentClient::did_invalidate_content_rect(Gfx::IntRect const& content_r
|
|||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidInvalidateContentRect! content_rect={}", content_rect);
|
||||
|
||||
// FIXME: Figure out a way to coalesce these messages to reduce unnecessary painting
|
||||
m_view.notify_server_did_invalidate_content_rect({}, content_rect);
|
||||
m_view.server_did_invalidate_content_rect({}, content_rect);
|
||||
}
|
||||
|
||||
void WebContentClient::did_change_selection()
|
||||
{
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidChangeSelection!");
|
||||
m_view.notify_server_did_change_selection({});
|
||||
m_view.server_did_change_selection({});
|
||||
}
|
||||
|
||||
void WebContentClient::did_request_cursor_change(i32 cursor_type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue