mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb/WebGL: Implement WEBGL_draw_buffers extension
This commit is contained in:
parent
de77a5e3ea
commit
55f7cb4f10
Notes:
github-actions[bot]
2025-01-21 20:37:38 +00:00
Author: https://github.com/Lubrsi
Commit: 55f7cb4f10
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3239
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/kalenikaliaksandr
8 changed files with 150 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <LibWeb/WebGL/EventNames.h>
|
||||
#include <LibWeb/WebGL/Extensions/ANGLEInstancedArrays.h>
|
||||
#include <LibWeb/WebGL/Extensions/OESVertexArrayObject.h>
|
||||
#include <LibWeb/WebGL/Extensions/WebGLDrawBuffers.h>
|
||||
#include <LibWeb/WebGL/OpenGLContext.h>
|
||||
#include <LibWeb/WebGL/WebGLContextEvent.h>
|
||||
#include <LibWeb/WebGL/WebGLRenderingContext.h>
|
||||
|
@ -92,6 +93,7 @@ void WebGLRenderingContext::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_canvas_element);
|
||||
visitor.visit(m_angle_instanced_arrays_extension);
|
||||
visitor.visit(m_oes_vertex_array_object_extension);
|
||||
visitor.visit(m_webgl_draw_buffers_extension);
|
||||
}
|
||||
|
||||
void WebGLRenderingContext::present()
|
||||
|
@ -207,6 +209,15 @@ JS::Object* WebGLRenderingContext::get_extension(String const& name)
|
|||
return m_oes_vertex_array_object_extension;
|
||||
}
|
||||
|
||||
if (Infra::is_ascii_case_insensitive_match(name, "WEBGL_draw_buffers"sv)) {
|
||||
if (!m_webgl_draw_buffers_extension) {
|
||||
m_webgl_draw_buffers_extension = MUST(Extensions::WebGLDrawBuffers::create(realm(), *this));
|
||||
}
|
||||
|
||||
VERIFY(m_webgl_draw_buffers_extension);
|
||||
return m_webgl_draw_buffers_extension;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue