mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 08:52:54 +00:00
Everywhere: Use IOSurface as backing store on macOS
Using mmap-allocated memory for backing stores does not allow us to benefit from using GPU-accelerated painting, because all the performance increase we get is mostly negated by reading the GPU-allocated texture back into RAM, so it can be shared with the browser process. With IOSurface, we get a framebuffer that is both shareable between processes and can be used as underlying memory for an OpenGL/Metal texture. This change does not yet benefit from using IOSurface and merely wraps them into Gfx::Bitmap to be used by the CPU painter.
This commit is contained in:
parent
e37071ae05
commit
c92f8ab1ea
Notes:
sideshowbarker
2024-07-16 20:51:53 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: c92f8ab1ea
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/233
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/bugaevc
15 changed files with 266 additions and 56 deletions
|
@ -11,12 +11,29 @@
|
|||
|
||||
namespace WebView {
|
||||
|
||||
static HashTable<WebContentClient*> s_clients;
|
||||
|
||||
Optional<ViewImplementation&> WebContentClient::view_for_pid_and_page_id(pid_t pid, u64 page_id)
|
||||
{
|
||||
for (auto* client : s_clients) {
|
||||
if (client->m_process_handle.pid == pid)
|
||||
return client->view_for_page_id(page_id);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
WebContentClient::WebContentClient(NonnullOwnPtr<Core::LocalSocket> socket, ViewImplementation& view)
|
||||
: IPC::ConnectionToServer<WebContentClientEndpoint, WebContentServerEndpoint>(*this, move(socket))
|
||||
{
|
||||
s_clients.set(this);
|
||||
m_views.set(0, &view);
|
||||
}
|
||||
|
||||
WebContentClient::~WebContentClient()
|
||||
{
|
||||
s_clients.remove(this);
|
||||
}
|
||||
|
||||
void WebContentClient::die()
|
||||
{
|
||||
VERIFY(on_web_content_process_crash);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue