ladybird/Libraries/LibWebView/CompositorClient.cpp
Aliaksandr Kalenik 17f5865d36 Compositor+WebContent+LibWebView: Implement service-side compositor IPC
With CompositorState in place, Browser and WebContent need an actual
wire protocol to drive it: which calls are sync, who validates that a
WebContent is allowed to touch a given context, how compositor loss
propagates back to the renderer. This commit fills in the four endpoints
around CompositorState and the matching WebContent-side helpers so the
future remote host can forward CompositorHost calls directly. The
service still has no clients, so default rendering is unchanged.
2026-05-22 19:50:42 +01:00

35 lines
829 B
C++

/*
* Copyright (c) 2026, the Ladybird developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWebView/CompositorClient.h>
#include <LibCore/EventLoop.h>
namespace WebView {
CompositorClient::CompositorClient(NonnullOwnPtr<IPC::Transport> transport)
: IPC::ConnectionToServer<CompositorControlClientEndpoint, CompositorControlServerEndpoint>(*this, move(transport))
{
}
void CompositorClient::die()
{
if (auto callback = move(on_death)) {
Core::deferred_invoke([callback = move(callback)]() mutable {
callback();
});
}
}
void CompositorClient::did_allocate_backing_stores(Web::Compositor::CompositorContextId, i32, Gfx::SharedImage, i32, Gfx::SharedImage)
{
}
void CompositorClient::did_present_frame(Web::Compositor::CompositorContextId, Gfx::IntRect, i32)
{
}
}