mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
LibWeb/WebGL: Set INVALID_OPERATION if object does not belong to context
This commit is contained in:
committed by
Alexander Kalenik
parent
fbae24f7a9
commit
07635d4554
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user