mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
LibWeb/WebGL: Don't crash when there's no skia backend context
This commit is contained in:
committed by
Alexander Kalenik
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 ✅
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user