1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:47:35 +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

@ -30,12 +30,14 @@
namespace WebContent {
class ClientConnection;
class PageHost : public Web::PageClient {
AK_MAKE_NONCOPYABLE(PageHost);
AK_MAKE_NONMOVABLE(PageHost);
public:
static NonnullOwnPtr<PageHost> create() { return adopt_own(*new PageHost); }
static NonnullOwnPtr<PageHost> create(ClientConnection& client) { return adopt_own(*new PageHost(client)); }
virtual ~PageHost();
Web::Page& page() { return *m_page; }
@ -47,11 +49,15 @@ public:
void set_viewport_rect(const Gfx::IntRect&);
private:
PageHost();
// ^PageHost
virtual void page_did_invalidate(const Gfx::IntRect&) override;
explicit PageHost(ClientConnection&);
Gfx::Palette palette() const;
void setup_palette();
ClientConnection& m_client;
NonnullOwnPtr<Web::Page> m_page;
RefPtr<Gfx::PaletteImpl> m_palette_impl;
};