Skip to content

Commit

Permalink
LibWeb: Add WebGLShaderPrecisionFormat
Browse files Browse the repository at this point in the history
(cherry picked from commit 3d8ab0e67c707062e4d889598fbd176fa0c6fce8)
  • Loading branch information
gmta authored and nico committed Nov 14, 2024
1 parent b288bfd commit b67c8d1
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,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/WebGLShaderPrecisionFormat.idl",
"//Userland/Libraries/LibWeb/WebGL/WebGLTexture.idl",
"//Userland/Libraries/LibWeb/WebGL/WebGLUniformLocation.idl",
"//Userland/Libraries/LibWeb/WebIDL/DOMException.idl",
Expand Down
1 change: 1 addition & 0 deletions Tests/LibWeb/Text/expected/all-window-properties.txt
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ WebGLProgram
WebGLRenderbuffer
WebGLRenderingContext
WebGLShader
WebGLShaderPrecisionFormat
WebGLTexture
WebGLUniformLocation
WebKitCSSMatrix
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibWeb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ set(SOURCES
WebGL/WebGLRenderingContext.cpp
WebGL/WebGLRenderingContextBase.cpp
WebGL/WebGLShader.cpp
WebGL/WebGLShaderPrecisionFormat.cpp
WebGL/WebGLTexture.cpp
WebGL/WebGLUniformLocation.cpp
WebIDL/AbstractOperations.cpp
Expand Down
21 changes: 21 additions & 0 deletions Userland/Libraries/LibWeb/WebGL/WebGLShaderPrecisionFormat.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2024, Jelle Raaijmakers <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/

#include <LibWeb/Bindings/WebGLShaderPrecisionFormatPrototype.h>
#include <LibWeb/WebGL/WebGLShaderPrecisionFormat.h>

namespace Web::WebGL {

JS_DEFINE_ALLOCATOR(WebGLShaderPrecisionFormat);

WebGLShaderPrecisionFormat::WebGLShaderPrecisionFormat(JS::Realm& realm)
: WebGLObject(realm)
{
}

WebGLShaderPrecisionFormat::~WebGLShaderPrecisionFormat() = default;

}
24 changes: 24 additions & 0 deletions Userland/Libraries/LibWeb/WebGL/WebGLShaderPrecisionFormat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024, Jelle Raaijmakers <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/

#pragma once

#include <LibWeb/WebGL/WebGLObject.h>

namespace Web::WebGL {

class WebGLShaderPrecisionFormat final : public WebGLObject {
WEB_PLATFORM_OBJECT(WebGLShaderPrecisionFormat, WebGLObject);
JS_DECLARE_ALLOCATOR(WebGLShaderPrecisionFormat);

public:
virtual ~WebGLShaderPrecisionFormat();

protected:
explicit WebGLShaderPrecisionFormat(JS::Realm&);
};

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#import <WebGL/Types.idl>

// https://registry.khronos.org/webgl/specs/latest/1.0/#5.12
[Exposed=(Window,Worker)]
interface WebGLShaderPrecisionFormat {
[FIXME] readonly attribute GLint rangeMin;
[FIXME] readonly attribute GLint rangeMax;
[FIXME] readonly attribute GLint precision;
};
1 change: 1 addition & 0 deletions Userland/Libraries/LibWeb/idl_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,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/WebGLShaderPrecisionFormat)
libweb_js_bindings(WebGL/WebGLTexture)
libweb_js_bindings(WebGL/WebGLUniformLocation)
libweb_js_bindings(WebIDL/DOMException)
Expand Down

0 comments on commit b67c8d1

Please sign in to comment.