ladybird/Services/Compositor/WebGLObjectMap.h
Aliaksandr Kalenik 5f0e95de13 Meta+LibWeb+Compositor: Add remote canvas transports
The display list can now refer to canvas ids, but WebContent still had
no channel for creating or updating those canvas resources in the
Compositor. Both 2D and WebGL canvases would have had to grow the IPC
plumbing in the same commit that changes the rendering contexts.

This adds the Compositor-side CanvasHost, WebContent transport objects,
and the IPC/CMake pieces needed to allocate, update, read back, and
destroy remote canvas contexts. The rendering contexts are not switched
over yet, keeping this as plumbing for later commits.
2026-06-17 19:07:32 +02:00

31 lines
765 B
C++

/*
* Copyright (c) 2026, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Error.h>
#include <AK/HashMap.h>
#include <LibWeb/WebGL/GLFunctions.h>
#include <LibWeb/WebGL/Types.h>
namespace Compositor {
class WebGLObjectMap {
public:
GLuint lookup(Web::WebGL::WebGLObjectId) const;
GLuint take(Web::WebGL::WebGLObjectId);
ErrorOr<void> add(Web::WebGL::WebGLObjectId, GLuint);
GLsync lookup_sync(Web::WebGL::WebGLObjectId) const;
GLsync take_sync(Web::WebGL::WebGLObjectId);
ErrorOr<void> add_sync(Web::WebGL::WebGLObjectId, GLsync);
private:
HashMap<Web::WebGL::WebGLObjectId, GLuint> m_objects;
HashMap<Web::WebGL::WebGLObjectId, GLsync> m_syncs;
};
}