LibWeb: Add WebGLTexture

This commit is contained in:
Jelle Raaijmakers 2024-11-13 10:08:30 +01:00 committed by Andreas Kling
parent 2b09afb971
commit f2a1643650
Notes: github-actions[bot] 2024-11-13 10:43:06 +00:00
7 changed files with 55 additions and 0 deletions

View file

@ -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

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/WebGLTexturePrototype.h>
#include <LibWeb/WebGL/WebGLTexture.h>
namespace Web::WebGL {
JS_DEFINE_ALLOCATOR(WebGLTexture);
WebGLTexture::WebGLTexture(JS::Realm& realm)
: WebGLObject(realm)
{
}
WebGLTexture::~WebGLTexture() = default;
}

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/WebGL/WebGLObject.h>
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&);
};
}

View file

@ -0,0 +1,6 @@
#import <WebGL/WebGLObject.idl>
// https://registry.khronos.org/webgl/specs/latest/1.0/#5.9
[Exposed=(Window,Worker)]
interface WebGLTexture : WebGLObject {
};

View file

@ -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)

View file

@ -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",

View file

@ -398,6 +398,7 @@ WebGLProgram
WebGLRenderbuffer
WebGLRenderingContext
WebGLShader
WebGLTexture
WebKitCSSMatrix
WebSocket
WheelEvent