WebGLObject.cpp 879 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
  3. * Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
  4. * Copyright (c) 2024, Luke Wilde <luke@ladybird.org>
  5. *
  6. * SPDX-License-Identifier: BSD-2-Clause
  7. */
  8. #include <LibWeb/Bindings/Intrinsics.h>
  9. #include <LibWeb/Bindings/WebGLObjectPrototype.h>
  10. #include <LibWeb/WebGL/WebGLObject.h>
  11. namespace Web::WebGL {
  12. WebGLObject::WebGLObject(JS::Realm& realm, WebGLRenderingContextBase& context, GLuint handle)
  13. : Bindings::PlatformObject(realm)
  14. , m_context(&context)
  15. , m_handle(handle)
  16. {
  17. }
  18. WebGLObject::~WebGLObject() = default;
  19. void WebGLObject::initialize(JS::Realm& realm)
  20. {
  21. Base::initialize(realm);
  22. WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLObject);
  23. }
  24. void WebGLObject::visit_edges(Visitor& visitor)
  25. {
  26. Base::visit_edges(visitor);
  27. visitor.visit(m_context->gc_cell());
  28. }
  29. }