mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Move WebGL extensions requests to WebGLRenderingContextBase
Instead of making the extension objects request the OpenGL extensions themselves, we can do it here since we already store that information to be able to compute the list of available extensions. As bonus points this makes it impossible to forget to request an OpenGL extension when implementing a new WebGL one.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
09f592a34c
commit
c2aeb9ea73
Notes:
github-actions[bot]
2026-03-11 19:21:07 +00:00
Author: https://github.com/cqundefine Commit: https://github.com/LadybirdBrowser/ladybird/commit/c2aeb9ea732 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8285 Reviewed-by: https://github.com/gmta ✅
@@ -213,6 +213,10 @@ JS::Object* WebGLRenderingContextBase::get_extension(String const& name)
|
||||
if (!extension_info.factory)
|
||||
return nullptr;
|
||||
|
||||
for (auto const& required_extension : extension_info.required_angle_extensions) {
|
||||
context().request_extension(null_terminated_string(required_extension).data());
|
||||
}
|
||||
|
||||
auto extension = MUST(extension_info.factory(realm(), *this));
|
||||
m_enabled_extensions.set(name, extension);
|
||||
return extension;
|
||||
|
||||
Reference in New Issue
Block a user