diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index 98da5256034..a4c6e2c64f5 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -787,6 +787,7 @@ set(SOURCES WebGL/WebGLRenderingContext.cpp WebGL/WebGLRenderingContextBase.cpp WebGL/WebGLShader.cpp + WebGL/WebGLTexture.cpp WebIDL/AbstractOperations.cpp WebIDL/Buffers.cpp WebIDL/CallbackType.cpp diff --git a/Libraries/LibWeb/WebGL/WebGLTexture.cpp b/Libraries/LibWeb/WebGL/WebGLTexture.cpp new file mode 100644 index 00000000000..9969d39b730 --- /dev/null +++ b/Libraries/LibWeb/WebGL/WebGLTexture.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024, Jelle Raaijmakers + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +namespace Web::WebGL { + +JS_DEFINE_ALLOCATOR(WebGLTexture); + +WebGLTexture::WebGLTexture(JS::Realm& realm) + : WebGLObject(realm) +{ +} + +WebGLTexture::~WebGLTexture() = default; + +} diff --git a/Libraries/LibWeb/WebGL/WebGLTexture.h b/Libraries/LibWeb/WebGL/WebGLTexture.h new file mode 100644 index 00000000000..cde502983d0 --- /dev/null +++ b/Libraries/LibWeb/WebGL/WebGLTexture.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024, Jelle Raaijmakers + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include + +namespace Web::WebGL { + +class WebGLTexture final : public WebGLObject { + WEB_PLATFORM_OBJECT(WebGLTexture, WebGLObject); + JS_DECLARE_ALLOCATOR(WebGLTexture); + +public: + virtual ~WebGLTexture(); + +protected: + explicit WebGLTexture(JS::Realm&); +}; + +} diff --git a/Libraries/LibWeb/WebGL/WebGLTexture.idl b/Libraries/LibWeb/WebGL/WebGLTexture.idl new file mode 100644 index 00000000000..14b41d0d23c --- /dev/null +++ b/Libraries/LibWeb/WebGL/WebGLTexture.idl @@ -0,0 +1,6 @@ +#import + +// https://registry.khronos.org/webgl/specs/latest/1.0/#5.9 +[Exposed=(Window,Worker)] +interface WebGLTexture : WebGLObject { +}; diff --git a/Libraries/LibWeb/idl_files.cmake b/Libraries/LibWeb/idl_files.cmake index f34728a5760..6d05276a4b8 100644 --- a/Libraries/LibWeb/idl_files.cmake +++ b/Libraries/LibWeb/idl_files.cmake @@ -367,6 +367,7 @@ libweb_js_bindings(WebGL/WebGLProgram) libweb_js_bindings(WebGL/WebGLRenderbuffer) libweb_js_bindings(WebGL/WebGLRenderingContext) libweb_js_bindings(WebGL/WebGLShader) +libweb_js_bindings(WebGL/WebGLTexture) libweb_js_bindings(WebIDL/DOMException) libweb_js_bindings(WebSockets/WebSocket) libweb_js_bindings(WebVTT/VTTCue) diff --git a/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni b/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni index 8c4859be47a..1c8905e42e3 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni +++ b/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni @@ -379,6 +379,7 @@ standard_idl_files = [ "//Userland/Libraries/LibWeb/WebGL/WebGLRenderbuffer.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLShader.idl", + "//Userland/Libraries/LibWeb/WebGL/WebGLTexture.idl", "//Userland/Libraries/LibWeb/WebIDL/DOMException.idl", "//Userland/Libraries/LibWeb/WebSockets/WebSocket.idl", "//Userland/Libraries/LibWeb/WebVTT/VTTCue.idl", diff --git a/Tests/LibWeb/Text/expected/all-window-properties.txt b/Tests/LibWeb/Text/expected/all-window-properties.txt index a60b0b6dabf..ca5a080275e 100644 --- a/Tests/LibWeb/Text/expected/all-window-properties.txt +++ b/Tests/LibWeb/Text/expected/all-window-properties.txt @@ -398,6 +398,7 @@ WebGLProgram WebGLRenderbuffer WebGLRenderingContext WebGLShader +WebGLTexture WebKitCSSMatrix WebSocket WheelEvent