mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Introduce a WebGL extension_enabled helper
Since we moved to using a hash map in the previous commits we get a quite easy way to check if a certain extension is enabled without having to create a seperate method for each one.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
d7bdc5b6c8
commit
09f592a34c
Notes:
github-actions[bot]
2026-03-11 19:21:16 +00:00
Author: https://github.com/cqundefine Commit: https://github.com/LadybirdBrowser/ladybird/commit/09f592a34c6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8285 Reviewed-by: https://github.com/gmta ✅
@@ -229,24 +229,9 @@ void WebGLRenderingContextBase::visit_edges(Cell::Visitor& visitor)
|
||||
visitor.visit(m_enabled_extensions);
|
||||
}
|
||||
|
||||
bool WebGLRenderingContextBase::ext_texture_filter_anisotropic_extension_enabled() const
|
||||
bool WebGLRenderingContextBase::extension_enabled(StringView extension) const
|
||||
{
|
||||
return m_enabled_extensions.contains("EXT_texture_filter_anisotropic"_string);
|
||||
}
|
||||
|
||||
bool WebGLRenderingContextBase::angle_instanced_arrays_extension_enabled() const
|
||||
{
|
||||
return m_enabled_extensions.contains("ANGLE_instanced_arrays"_string);
|
||||
}
|
||||
|
||||
bool WebGLRenderingContextBase::oes_standard_derivatives_extension_enabled() const
|
||||
{
|
||||
return m_enabled_extensions.contains("OES_standard_derivatives"_string);
|
||||
}
|
||||
|
||||
bool WebGLRenderingContextBase::webgl_draw_buffers_extension_enabled() const
|
||||
{
|
||||
return m_enabled_extensions.contains("WEBGL_draw_buffers"_string);
|
||||
return m_enabled_extensions.contains(MUST(String::from_utf8(extension)));
|
||||
}
|
||||
|
||||
ReadonlySpan<WebIDL::UnsignedLong> WebGLRenderingContextBase::enabled_compressed_texture_formats() const
|
||||
|
||||
Reference in New Issue
Block a user