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

WebContent: Allow the WebContent process to trigger repaints

After layout, we may want to repaint the page, so we now listen for the
PageClient::page_did_invalidate() notification and use it to drive a
client-side repaint.

Note that an invalidation request from LibWeb makes a full roundtrip
to the WebContent client and back since the client drives painting.
This commit is contained in:
Andreas Kling 2020-06-17 18:00:18 +02:00
parent c45c5ded34
commit 0bac2ad3b3
8 changed files with 36 additions and 6 deletions

View file

@ -25,16 +25,19 @@
*/
#include "PageHost.h"
#include "ClientConnection.h"
#include <AK/SharedBuffer.h>
#include <LibGfx/Painter.h>
#include <LibGfx/SystemTheme.h>
#include <LibWeb/Frame/Frame.h>
#include <LibWeb/Layout/LayoutDocument.h>
#include <WebContent/WebContentClientEndpoint.h>
namespace WebContent {
PageHost::PageHost()
: m_page(make<Web::Page>(*this))
PageHost::PageHost(ClientConnection& client)
: m_client(client)
, m_page(make<Web::Page>(*this))
{
setup_palette();
}
@ -96,4 +99,9 @@ void PageHost::set_viewport_rect(const Gfx::IntRect& rect)
page().main_frame().set_viewport_rect(rect);
}
void PageHost::page_did_invalidate(const Gfx::IntRect& content_rect)
{
m_client.post_message(Messages::WebContentClient::DidInvalidateContentRect(content_rect));
}
}