mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Implement WebGL extension OES_standard_derivatives
This commit is contained in:
parent
2bf35881f9
commit
d4ac9fc5c6
Notes:
github-actions[bot]
2025-11-06 18:04:25 +00:00
Author: https://github.com/cqundefine
Commit: d4ac9fc5c6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6711
Reviewed-by: https://github.com/awesomekling
12 changed files with 115 additions and 2 deletions
42
Libraries/LibWeb/WebGL/Extensions/OESStandardDerivatives.cpp
Normal file
42
Libraries/LibWeb/WebGL/Extensions/OESStandardDerivatives.cpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Undefine <undefine@undefine.pl>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibJS/Runtime/Realm.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/OESStandardDerivativesPrototype.h>
|
||||
#include <LibWeb/WebGL/Extensions/OESStandardDerivatives.h>
|
||||
#include <LibWeb/WebGL/OpenGLContext.h>
|
||||
#include <LibWeb/WebGL/WebGLRenderingContext.h>
|
||||
|
||||
namespace Web::WebGL::Extensions {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(OESStandardDerivatives);
|
||||
|
||||
JS::ThrowCompletionOr<GC::Ptr<OESStandardDerivatives>> OESStandardDerivatives::create(JS::Realm& realm, GC::Ref<WebGLRenderingContext> context)
|
||||
{
|
||||
return realm.create<OESStandardDerivatives>(realm, context);
|
||||
}
|
||||
|
||||
OESStandardDerivatives::OESStandardDerivatives(JS::Realm& realm, GC::Ref<WebGLRenderingContext> context)
|
||||
: PlatformObject(realm)
|
||||
, m_context(context)
|
||||
{
|
||||
m_context->context().request_extension("GL_OES_standard_derivatives");
|
||||
}
|
||||
|
||||
void OESStandardDerivatives::initialize(JS::Realm& realm)
|
||||
{
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(OESStandardDerivatives);
|
||||
Base::initialize(realm);
|
||||
}
|
||||
|
||||
void OESStandardDerivatives::visit_edges(Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_context);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue