mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibGL: Make GL::create_context fallible
Propagate errors in places that are already set up to handle them, like WebGLRenderingContext and the Tubes demo, and convert other callers to using MUST.
This commit is contained in:
parent
7e5080ea53
commit
8ed5ed3ec0
Notes:
sideshowbarker
2024-07-18 00:54:03 +09:00
Author: https://github.com/ADKaster
Commit: 8ed5ed3ec0
Pull-request: https://github.com/SerenityOS/serenity/pull/15260
7 changed files with 14 additions and 20 deletions
|
@ -921,11 +921,11 @@ void GLContext::build_extension_string()
|
|||
m_extensions = String::join(' ', extensions);
|
||||
}
|
||||
|
||||
NonnullOwnPtr<GLContext> create_context(Gfx::Bitmap& bitmap)
|
||||
ErrorOr<NonnullOwnPtr<GLContext>> create_context(Gfx::Bitmap& bitmap)
|
||||
{
|
||||
// FIXME: Make driver selectable. This is currently hardcoded to LibSoftGPU
|
||||
auto driver = MUST(GPU::Driver::try_create("softgpu"sv));
|
||||
auto device = MUST(driver->try_create_device(bitmap.size()));
|
||||
auto driver = TRY(GPU::Driver::try_create("softgpu"sv));
|
||||
auto device = TRY(driver->try_create_device(bitmap.size()));
|
||||
auto context = make<GLContext>(driver, move(device), bitmap);
|
||||
dbgln_if(GL_DEBUG, "GL::create_context({}) -> {:p}", bitmap.size(), context.ptr());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue