1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

LibAccelGfx+LibWeb+WebContent: Handle OpenGL Context init errors

Now, if OpenGL context fails, an error will be returned and a message
printed, instead of crashing.
This commit is contained in:
Aliaksandr Kalenik 2024-01-24 15:27:03 +01:00 committed by Andreas Kling
parent 315c95a1ce
commit 980b61470c
4 changed files with 65 additions and 15 deletions

View file

@ -72,7 +72,12 @@ PageClient::PageClient(PageHost& owner, u64 id)
#ifdef HAS_ACCELERATED_GRAPHICS
if (s_use_gpu_painter) {
m_accelerated_graphics_context = AccelGfx::Context::create();
auto context = AccelGfx::Context::create();
if (context.is_error()) {
dbgln("Failed to create AccelGfx context: {}", context.error());
VERIFY_NOT_REACHED();
}
m_accelerated_graphics_context = AccelGfx::Context::create().release_value();
}
#endif
}