mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Pass some WebGL context attribute flags to OpenGLContext
This allows us to conditionally enable depth and stencil. The antialias option is currently unused.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
e84dc71291
commit
682662d44c
Notes:
github-actions[bot]
2026-03-06 22:01:52 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/682662d44c3 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8265 Reviewed-by: https://github.com/gmta ✅
@@ -45,7 +45,12 @@ JS::ThrowCompletionOr<GC::Ptr<WebGL2RenderingContext>> WebGL2RenderingContext::c
|
||||
fire_webgl_context_creation_error(canvas_element);
|
||||
return GC::Ptr<WebGL2RenderingContext> { nullptr };
|
||||
}
|
||||
auto context = OpenGLContext::create(*skia_backend_context, OpenGLContext::WebGLVersion::WebGL2);
|
||||
OpenGLContext::DrawingBufferOptions context_options {
|
||||
.depth = context_attributes.depth,
|
||||
.stencil = context_attributes.stencil,
|
||||
.antialias = context_attributes.antialias,
|
||||
};
|
||||
auto context = OpenGLContext::create(*skia_backend_context, OpenGLContext::WebGLVersion::WebGL2, context_options);
|
||||
if (!context) {
|
||||
fire_webgl_context_creation_error(canvas_element);
|
||||
return GC::Ptr<WebGL2RenderingContext> { nullptr };
|
||||
|
||||
Reference in New Issue
Block a user