mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
LibWeb/WebGL: Don't crash when there's no skia backend context
This commit is contained in:
parent
f2ac4f3f2e
commit
d8ccd6b87c
Notes:
github-actions[bot]
2024-12-06 14:37:31 +00:00
Author: https://github.com/ADKaster Commit: https://github.com/LadybirdBrowser/ladybird/commit/d8ccd6b87ce Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2809 Reviewed-by: https://github.com/kalenikaliaksandr ✅
1 changed files with 4 additions and 0 deletions
|
@ -50,6 +50,10 @@ JS::ThrowCompletionOr<GC::Ptr<WebGLRenderingContext>> WebGLRenderingContext::cre
|
|||
auto context_attributes = TRY(convert_value_to_context_attributes_dictionary(canvas_element.vm(), options));
|
||||
|
||||
auto skia_backend_context = canvas_element.navigable()->traversable_navigable()->skia_backend_context();
|
||||
if (!skia_backend_context) {
|
||||
fire_webgl_context_creation_error(canvas_element);
|
||||
return GC::Ptr<WebGLRenderingContext> { nullptr };
|
||||
}
|
||||
auto context = OpenGLContext::create(*skia_backend_context);
|
||||
if (!context) {
|
||||
fire_webgl_context_creation_error(canvas_element);
|
||||
|
|
Loading…
Add table
Reference in a new issue