mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibWeb/WebGL: Implement drawingBufferWidth and drawingBufferHeight
This commit is contained in:
parent
4dc65c57a0
commit
c199be061a
Notes:
github-actions[bot]
2024-12-13 08:21:09 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/c199be061a1 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2878 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/gmta
5 changed files with 32 additions and 2 deletions
|
@ -155,4 +155,16 @@ JS::Object* WebGL2RenderingContext::get_extension(String const&)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
WebIDL::Long WebGL2RenderingContext::drawing_buffer_width() const
|
||||
{
|
||||
auto size = canvas_for_binding()->bitmap_size_for_canvas();
|
||||
return size.width();
|
||||
}
|
||||
|
||||
WebIDL::Long WebGL2RenderingContext::drawing_buffer_height() const
|
||||
{
|
||||
auto size = canvas_for_binding()->bitmap_size_for_canvas();
|
||||
return size.height();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,6 +44,9 @@ public:
|
|||
Optional<Vector<String>> get_supported_extensions() const;
|
||||
JS::Object* get_extension(String const& name);
|
||||
|
||||
WebIDL::Long drawing_buffer_width() const;
|
||||
WebIDL::Long drawing_buffer_height() const;
|
||||
|
||||
private:
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
|
|
|
@ -171,4 +171,16 @@ JS::Object* WebGLRenderingContext::get_extension(String const&)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
WebIDL::Long WebGLRenderingContext::drawing_buffer_width() const
|
||||
{
|
||||
auto size = canvas_for_binding()->bitmap_size_for_canvas();
|
||||
return size.width();
|
||||
}
|
||||
|
||||
WebIDL::Long WebGLRenderingContext::drawing_buffer_height() const
|
||||
{
|
||||
auto size = canvas_for_binding()->bitmap_size_for_canvas();
|
||||
return size.height();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,6 +43,9 @@ public:
|
|||
Optional<Vector<String>> get_supported_extensions() const;
|
||||
JS::Object* get_extension(String const& name);
|
||||
|
||||
WebIDL::Long drawing_buffer_width() const;
|
||||
WebIDL::Long drawing_buffer_height() const;
|
||||
|
||||
private:
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ interface mixin WebGLRenderingContextBase {
|
|||
|
||||
// FIXME: The type should be (HTMLCanvasElement or OffscreenCanvas).
|
||||
[ImplementedAs=canvas_for_binding] readonly attribute HTMLCanvasElement canvas;
|
||||
[FIXME] readonly attribute GLsizei drawingBufferWidth;
|
||||
[FIXME] readonly attribute GLsizei drawingBufferHeight;
|
||||
readonly attribute GLsizei drawingBufferWidth;
|
||||
readonly attribute GLsizei drawingBufferHeight;
|
||||
[FIXME] readonly attribute GLenum drawingBufferFormat;
|
||||
|
||||
[FIXME] attribute PredefinedColorSpace drawingBufferColorSpace;
|
||||
|
|
Loading…
Add table
Reference in a new issue