mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 23:59:53 +00:00
LibWeb/WebGL: Implement getShaderPrecisionFormat
This commit is contained in:
parent
a14cd5dab8
commit
bf2b8c5f2b
Notes:
github-actions[bot]
2024-12-05 20:42:25 +00:00
Author: https://github.com/Lubrsi
Commit: bf2b8c5f2b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2791
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/shannonbooth
8 changed files with 59 additions and 11 deletions
|
@ -1,9 +1,12 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
* Copyright (c) 2024, Luke Wilde <luke@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibJS/Runtime/Realm.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/WebGLShaderPrecisionFormatPrototype.h>
|
||||
#include <LibWeb/WebGL/WebGLShaderPrecisionFormat.h>
|
||||
|
||||
|
@ -11,11 +14,25 @@ namespace Web::WebGL {
|
|||
|
||||
GC_DEFINE_ALLOCATOR(WebGLShaderPrecisionFormat);
|
||||
|
||||
WebGLShaderPrecisionFormat::WebGLShaderPrecisionFormat(JS::Realm& realm)
|
||||
: WebGLObject(realm, 0)
|
||||
GC::Ref<WebGLShaderPrecisionFormat> WebGLShaderPrecisionFormat::create(JS::Realm& realm, GLint range_min, GLint range_max, GLint precision)
|
||||
{
|
||||
return realm.create<WebGLShaderPrecisionFormat>(realm, range_min, range_max, precision);
|
||||
}
|
||||
|
||||
WebGLShaderPrecisionFormat::WebGLShaderPrecisionFormat(JS::Realm& realm, GLint range_min, GLint range_max, GLint precision)
|
||||
: Bindings::PlatformObject(realm)
|
||||
, m_range_min(range_min)
|
||||
, m_range_max(range_max)
|
||||
, m_precision(precision)
|
||||
{
|
||||
}
|
||||
|
||||
WebGLShaderPrecisionFormat::~WebGLShaderPrecisionFormat() = default;
|
||||
|
||||
void WebGLShaderPrecisionFormat::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLShaderPrecisionFormat);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue