diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index db13fa950f4..f766933dffb 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -782,6 +782,7 @@ set(SOURCES WebGL/WebGLContextEvent.cpp WebGL/WebGLFramebuffer.cpp WebGL/WebGLObject.cpp + WebGL/WebGLProgram.cpp WebGL/WebGLRenderingContext.cpp WebGL/WebGLRenderingContextBase.cpp WebIDL/AbstractOperations.cpp diff --git a/Libraries/LibWeb/WebGL/WebGLProgram.cpp b/Libraries/LibWeb/WebGL/WebGLProgram.cpp new file mode 100644 index 00000000000..629dc22d7f1 --- /dev/null +++ b/Libraries/LibWeb/WebGL/WebGLProgram.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024, Jelle Raaijmakers + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +namespace Web::WebGL { + +JS_DEFINE_ALLOCATOR(WebGLProgram); + +WebGLProgram::WebGLProgram(JS::Realm& realm) + : WebGLObject(realm) +{ +} + +WebGLProgram::~WebGLProgram() = default; + +} diff --git a/Libraries/LibWeb/WebGL/WebGLProgram.h b/Libraries/LibWeb/WebGL/WebGLProgram.h new file mode 100644 index 00000000000..fde138bac81 --- /dev/null +++ b/Libraries/LibWeb/WebGL/WebGLProgram.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024, Jelle Raaijmakers + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include + +namespace Web::WebGL { + +class WebGLProgram final : public WebGLObject { + WEB_PLATFORM_OBJECT(WebGLProgram, WebGLObject); + JS_DECLARE_ALLOCATOR(WebGLProgram); + +public: + virtual ~WebGLProgram(); + +protected: + explicit WebGLProgram(JS::Realm&); +}; + +} diff --git a/Libraries/LibWeb/WebGL/WebGLProgram.idl b/Libraries/LibWeb/WebGL/WebGLProgram.idl new file mode 100644 index 00000000000..642a3980906 --- /dev/null +++ b/Libraries/LibWeb/WebGL/WebGLProgram.idl @@ -0,0 +1,6 @@ +#import + +// https://registry.khronos.org/webgl/specs/latest/1.0/#5.6 +[Exposed=(Window,Worker)] +interface WebGLProgram : WebGLObject { +}; diff --git a/Libraries/LibWeb/idl_files.cmake b/Libraries/LibWeb/idl_files.cmake index b059ef1e2ab..669c66a31dc 100644 --- a/Libraries/LibWeb/idl_files.cmake +++ b/Libraries/LibWeb/idl_files.cmake @@ -363,6 +363,7 @@ libweb_js_bindings(WebGL/WebGLBuffer) libweb_js_bindings(WebGL/WebGLContextEvent) libweb_js_bindings(WebGL/WebGLFramebuffer) libweb_js_bindings(WebGL/WebGLObject) +libweb_js_bindings(WebGL/WebGLProgram) libweb_js_bindings(WebGL/WebGLRenderingContext) libweb_js_bindings(WebIDL/DOMException) libweb_js_bindings(WebSockets/WebSocket) diff --git a/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni b/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni index affcfde2237..59d76d858ab 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni +++ b/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni @@ -375,6 +375,7 @@ standard_idl_files = [ "//Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLObject.idl", + "//Userland/Libraries/LibWeb/WebGL/WebGLProgram.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.idl", "//Userland/Libraries/LibWeb/WebIDL/DOMException.idl", "//Userland/Libraries/LibWeb/WebSockets/WebSocket.idl", diff --git a/Tests/LibWeb/Text/expected/all-window-properties.txt b/Tests/LibWeb/Text/expected/all-window-properties.txt index 306dfc73838..c5018319eed 100644 --- a/Tests/LibWeb/Text/expected/all-window-properties.txt +++ b/Tests/LibWeb/Text/expected/all-window-properties.txt @@ -394,6 +394,7 @@ WebGLBuffer WebGLContextEvent WebGLFramebuffer WebGLObject +WebGLProgram WebGLRenderingContext WebKitCSSMatrix WebSocket