mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/WebGL2: Check if WebGLSync object belongs to the current context
This commit is contained in:
parent
3d2874bc4e
commit
3005cc30b4
Notes:
github-actions[bot]
2025-10-21 21:33:59 +00:00
Author: https://github.com/Lubrsi
Commit: 3005cc30b4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6538
Reviewed-by: https://github.com/gmta ✅
4 changed files with 47 additions and 5 deletions
|
|
@ -9,6 +9,8 @@
|
|||
#include <LibWeb/Bindings/WebGLSyncPrototype.h>
|
||||
#include <LibWeb/WebGL/WebGLSync.h>
|
||||
|
||||
#include <GLES2/gl2.h>
|
||||
|
||||
namespace Web::WebGL {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(WebGLSync);
|
||||
|
|
@ -32,4 +34,11 @@ void WebGLSync::initialize(JS::Realm& realm)
|
|||
Base::initialize(realm);
|
||||
}
|
||||
|
||||
ErrorOr<GLsyncInternal> WebGLSync::sync_handle(WebGLRenderingContextBase const* context) const
|
||||
{
|
||||
if (context == m_context)
|
||||
return m_sync_handle;
|
||||
return Error::from_errno(GL_INVALID_OPERATION);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue