WebGLSync.cpp 838 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2024, Andrew Kaster <andrew@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibJS/Runtime/Realm.h>
  7. #include <LibWeb/Bindings/Intrinsics.h>
  8. #include <LibWeb/Bindings/WebGLSyncPrototype.h>
  9. #include <LibWeb/WebGL/WebGLSync.h>
  10. namespace Web::WebGL {
  11. GC_DEFINE_ALLOCATOR(WebGLSync);
  12. GC::Ref<WebGLSync> WebGLSync::create(JS::Realm& realm, WebGLRenderingContextBase& context, GLsyncInternal handle)
  13. {
  14. return realm.create<WebGLSync>(realm, context, handle);
  15. }
  16. WebGLSync::WebGLSync(JS::Realm& realm, WebGLRenderingContextBase& context, GLsyncInternal handle)
  17. : WebGLObject(realm, context, 0)
  18. , m_sync_handle(handle)
  19. {
  20. }
  21. WebGLSync::~WebGLSync() = default;
  22. void WebGLSync::initialize(JS::Realm& realm)
  23. {
  24. Base::initialize(realm);
  25. WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLSync);
  26. }
  27. }