From d63a979bde54ad93422c2fadb5cf24cbc3339e07 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Wed, 13 Nov 2024 10:15:42 +0100 Subject: [PATCH] LibWeb: Add WebGLActiveInfo --- Libraries/LibWeb/CMakeLists.txt | 1 + Libraries/LibWeb/WebGL/WebGLActiveInfo.cpp | 20 ++++++++++++++++ Libraries/LibWeb/WebGL/WebGLActiveInfo.h | 24 +++++++++++++++++++ Libraries/LibWeb/WebGL/WebGLActiveInfo.idl | 9 +++++++ Libraries/LibWeb/idl_files.cmake | 1 + .../Userland/Libraries/LibWeb/idl_files.gni | 1 + .../Text/expected/all-window-properties.txt | 1 + 7 files changed, 57 insertions(+) create mode 100644 Libraries/LibWeb/WebGL/WebGLActiveInfo.cpp create mode 100644 Libraries/LibWeb/WebGL/WebGLActiveInfo.h create mode 100644 Libraries/LibWeb/WebGL/WebGLActiveInfo.idl diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index 3d1a39f508b..0fbe9306456 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -777,6 +777,7 @@ set(SOURCES WebDriver/TimeoutsConfiguration.cpp WebGL/EventNames.cpp WebGL/OpenGLContext.cpp + WebGL/WebGLActiveInfo.cpp WebGL/WebGLBuffer.cpp WebGL/WebGLContextAttributes.cpp WebGL/WebGLContextEvent.cpp diff --git a/Libraries/LibWeb/WebGL/WebGLActiveInfo.cpp b/Libraries/LibWeb/WebGL/WebGLActiveInfo.cpp new file mode 100644 index 00000000000..03492e8f223 --- /dev/null +++ b/Libraries/LibWeb/WebGL/WebGLActiveInfo.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024, Jelle Raaijmakers + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include + +namespace Web::WebGL { + +JS_DEFINE_ALLOCATOR(WebGLActiveInfo); + +WebGLActiveInfo::WebGLActiveInfo(JS::Realm& realm) + : Bindings::PlatformObject(realm) +{ +} + +WebGLActiveInfo::~WebGLActiveInfo() = default; + +} diff --git a/Libraries/LibWeb/WebGL/WebGLActiveInfo.h b/Libraries/LibWeb/WebGL/WebGLActiveInfo.h new file mode 100644 index 00000000000..3e27070ddec --- /dev/null +++ b/Libraries/LibWeb/WebGL/WebGLActiveInfo.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024, Jelle Raaijmakers + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include + +namespace Web::WebGL { + +class WebGLActiveInfo : public Bindings::PlatformObject { + WEB_PLATFORM_OBJECT(WebGLActiveInfo, Bindings::PlatformObject); + JS_DECLARE_ALLOCATOR(WebGLActiveInfo); + +public: + virtual ~WebGLActiveInfo(); + +protected: + explicit WebGLActiveInfo(JS::Realm&); +}; + +} diff --git a/Libraries/LibWeb/WebGL/WebGLActiveInfo.idl b/Libraries/LibWeb/WebGL/WebGLActiveInfo.idl new file mode 100644 index 00000000000..978cdb12d77 --- /dev/null +++ b/Libraries/LibWeb/WebGL/WebGLActiveInfo.idl @@ -0,0 +1,9 @@ +#import + +// https://registry.khronos.org/webgl/specs/latest/1.0/#5.11 +[Exposed=(Window,Worker)] +interface WebGLActiveInfo { + [FIXME] readonly attribute GLint size; + [FIXME] readonly attribute GLenum type; + [FIXME] readonly attribute DOMString name; +}; diff --git a/Libraries/LibWeb/idl_files.cmake b/Libraries/LibWeb/idl_files.cmake index 9dcb284e837..3e247e65edb 100644 --- a/Libraries/LibWeb/idl_files.cmake +++ b/Libraries/LibWeb/idl_files.cmake @@ -359,6 +359,7 @@ libweb_js_bindings(WebAudio/GainNode) libweb_js_bindings(WebAudio/OfflineAudioContext) libweb_js_bindings(WebAudio/OscillatorNode) libweb_js_bindings(WebAudio/PeriodicWave) +libweb_js_bindings(WebGL/WebGLActiveInfo) libweb_js_bindings(WebGL/WebGLBuffer) libweb_js_bindings(WebGL/WebGLContextEvent) libweb_js_bindings(WebGL/WebGLFramebuffer) diff --git a/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni b/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni index 01a460872bc..5032f37d3e8 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni +++ b/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni @@ -371,6 +371,7 @@ standard_idl_files = [ "//Userland/Libraries/LibWeb/WebAudio/OfflineAudioContext.idl", "//Userland/Libraries/LibWeb/WebAudio/OscillatorNode.idl", "//Userland/Libraries/LibWeb/WebAudio/PeriodicWave.idl", + "//Userland/Libraries/LibWeb/WebGL/WebGLActiveInfo.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLBuffer.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.idl", diff --git a/Tests/LibWeb/Text/expected/all-window-properties.txt b/Tests/LibWeb/Text/expected/all-window-properties.txt index ebd5084b54d..fcb4476cea0 100644 --- a/Tests/LibWeb/Text/expected/all-window-properties.txt +++ b/Tests/LibWeb/Text/expected/all-window-properties.txt @@ -390,6 +390,7 @@ VisualViewport WeakMap WeakRef WeakSet +WebGLActiveInfo WebGLBuffer WebGLContextEvent WebGLFramebuffer