/* * Copyright (c) 2024, Andrew Kaster * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::WebGL { class WebGLSync : public WebGLObject { WEB_PLATFORM_OBJECT(WebGLSync, WebGLObject); GC_DECLARE_ALLOCATOR(WebGLSync); public: static GC::Ref create(JS::Realm& realm, WebGLRenderingContextBase&, GLsyncInternal handle); virtual ~WebGLSync() override; ErrorOr sync_handle(WebGLRenderingContextBase const* context) const; protected: explicit WebGLSync(JS::Realm&, WebGLRenderingContextBase&, GLsyncInternal handle); virtual void initialize(JS::Realm&) override; GLsyncInternal m_sync_handle { nullptr }; }; }