LibWeb/WebGL: Move extensions into their own folder

This commit is contained in:
Luke Wilde 2025-01-10 14:27:03 +00:00 committed by Andreas Kling
commit de77a5e3ea
Notes: github-actions[bot] 2025-01-21 20:37:44 +00:00
15 changed files with 30 additions and 26 deletions

View file

@ -7,7 +7,7 @@
#include <LibJS/Runtime/Realm.h>
#include <LibWeb/Bindings/ANGLEInstancedArraysPrototype.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/WebGL/ANGLEInstancedArrays.h>
#include <LibWeb/WebGL/Extensions/ANGLEInstancedArrays.h>
#include <LibWeb/WebGL/OpenGLContext.h>
#include <LibWeb/WebGL/WebGLRenderingContext.h>
@ -15,7 +15,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
namespace Web::WebGL {
namespace Web::WebGL::Extensions {
GC_DEFINE_ALLOCATOR(ANGLEInstancedArrays);

View file

@ -10,7 +10,7 @@
#include <LibWeb/Forward.h>
#include <LibWeb/WebGL/Types.h>
namespace Web::WebGL {
namespace Web::WebGL::Extensions {
class ANGLEInstancedArrays : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(ANGLEInstancedArrays, Bindings::PlatformObject);

View file

@ -5,9 +5,10 @@
*/
#include <LibJS/Runtime/Realm.h>
#include <LibWeb/Bindings/OESVertexArrayObjectPrototype.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/WebGL/OESVertexArrayObject.h>
#include <LibWeb/Bindings/OESVertexArrayObjectPrototype.h>
#include <LibWeb/WebGL/Extensions/OESVertexArrayObject.h>
#include <LibWeb/WebGL/Extensions/WebGLVertexArrayObjectOES.h>
#include <LibWeb/WebGL/OpenGLContext.h>
#include <LibWeb/WebGL/WebGLRenderingContext.h>
@ -15,7 +16,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
namespace Web::WebGL {
namespace Web::WebGL::Extensions {
GC_DEFINE_ALLOCATOR(OESVertexArrayObject);

View file

@ -9,9 +9,8 @@
#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/Forward.h>
#include <LibWeb/WebGL/Types.h>
#include <LibWeb/WebGL/WebGLVertexArrayObjectOES.h>
namespace Web::WebGL {
namespace Web::WebGL::Extensions {
class OESVertexArrayObject : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(OESVertexArrayObject, Bindings::PlatformObject);

View file

@ -1,5 +1,5 @@
#import <WebGL/Extensions/WebGLVertexArrayObjectOES.idl>
#import <WebGL/Types.idl>
#import <WebGL/WebGLVertexArrayObjectOES.idl>
// https://registry.khronos.org/webgl/extensions/OES_vertex_array_object/
// NOTE: Original OES_vertex_array_object name is changed to title case,

View file

@ -8,9 +8,9 @@
#include <LibJS/Runtime/Realm.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/Bindings/WebGLVertexArrayObjectOESPrototype.h>
#include <LibWeb/WebGL/WebGLVertexArrayObjectOES.h>
#include <LibWeb/WebGL/Extensions/WebGLVertexArrayObjectOES.h>
namespace Web::WebGL {
namespace Web::WebGL::Extensions {
GC_DEFINE_ALLOCATOR(WebGLVertexArrayObjectOES);

View file

@ -10,7 +10,7 @@
#include <LibWeb/WebGL/Types.h>
#include <LibWeb/WebGL/WebGLObject.h>
namespace Web::WebGL {
namespace Web::WebGL::Extensions {
class WebGLVertexArrayObjectOES : public WebGLObject {
WEB_PLATFORM_OBJECT(WebGLVertexArrayObjectOES, WebGLObject);

View file

@ -13,9 +13,9 @@
#include <LibWeb/HTML/TraversableNavigable.h>
#include <LibWeb/Infra/Strings.h>
#include <LibWeb/Painting/Paintable.h>
#include <LibWeb/WebGL/ANGLEInstancedArrays.h>
#include <LibWeb/WebGL/EventNames.h>
#include <LibWeb/WebGL/OESVertexArrayObject.h>
#include <LibWeb/WebGL/Extensions/ANGLEInstancedArrays.h>
#include <LibWeb/WebGL/Extensions/OESVertexArrayObject.h>
#include <LibWeb/WebGL/OpenGLContext.h>
#include <LibWeb/WebGL/WebGLContextEvent.h>
#include <LibWeb/WebGL/WebGLRenderingContext.h>
@ -191,7 +191,7 @@ JS::Object* WebGLRenderingContext::get_extension(String const& name)
if (Infra::is_ascii_case_insensitive_match(name, "ANGLE_instanced_arrays"sv)) {
if (!m_angle_instanced_arrays_extension) {
m_angle_instanced_arrays_extension = MUST(ANGLEInstancedArrays::create(realm(), *this));
m_angle_instanced_arrays_extension = MUST(Extensions::ANGLEInstancedArrays::create(realm(), *this));
}
VERIFY(m_angle_instanced_arrays_extension);
@ -200,7 +200,7 @@ JS::Object* WebGLRenderingContext::get_extension(String const& name)
if (Infra::is_ascii_case_insensitive_match(name, "OES_vertex_array_object"sv)) {
if (!m_oes_vertex_array_object_extension) {
m_oes_vertex_array_object_extension = MUST(OESVertexArrayObject::create(realm(), *this));
m_oes_vertex_array_object_extension = MUST(Extensions::OESVertexArrayObject::create(realm(), *this));
}
VERIFY(m_oes_vertex_array_object_extension);

View file

@ -81,8 +81,8 @@ private:
// Extensions
// "Multiple calls to getExtension with the same extension string, taking into account case-insensitive comparison, must return the same object as long as the extension is enabled."
GC::Ptr<ANGLEInstancedArrays> m_angle_instanced_arrays_extension;
GC::Ptr<OESVertexArrayObject> m_oes_vertex_array_object_extension;
GC::Ptr<Extensions::ANGLEInstancedArrays> m_angle_instanced_arrays_extension;
GC::Ptr<Extensions::OESVertexArrayObject> m_oes_vertex_array_object_extension;
virtual void set_error(GLenum error) override;
};