mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
LibWeb/WebGL: Set INVALID_OPERATION if object does not belong to context
This commit is contained in:
parent
fbae24f7a9
commit
07635d4554
Notes:
github-actions[bot]
2024-12-19 12:39:36 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 07635d4554
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2965
3 changed files with 79 additions and 20 deletions
|
@ -10,6 +10,8 @@
|
|||
#include <LibWeb/Bindings/WebGLObjectPrototype.h>
|
||||
#include <LibWeb/WebGL/WebGLObject.h>
|
||||
|
||||
#include <GLES2/gl2.h>
|
||||
|
||||
namespace Web::WebGL {
|
||||
|
||||
WebGLObject::WebGLObject(JS::Realm& realm, WebGLRenderingContextBase& context, GLuint handle)
|
||||
|
@ -33,4 +35,11 @@ void WebGLObject::visit_edges(Visitor& visitor)
|
|||
visitor.visit(m_context->gc_cell());
|
||||
}
|
||||
|
||||
ErrorOr<GLuint> WebGLObject::handle(WebGLRenderingContextBase const* context) const
|
||||
{
|
||||
if (context == m_context)
|
||||
return m_handle;
|
||||
return Error::from_errno(GL_INVALID_OPERATION);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue