WebGLSync.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef WEBGL_SYNC_H_
  6. #define WEBGL_SYNC_H_
  7. #include "mozilla/LinkedList.h"
  8. #include "nsWrapperCache.h"
  9. #include "WebGLObjectModel.h"
  10. namespace mozilla {
  11. class WebGLSync final
  12. : public nsWrapperCache
  13. , public WebGLRefCountedObject<WebGLSync>
  14. , public LinkedListElement<WebGLSync>
  15. {
  16. friend class WebGL2Context;
  17. public:
  18. WebGLSync(WebGLContext* webgl, GLenum condition, GLbitfield flags);
  19. void Delete();
  20. WebGLContext* GetParentObject() const;
  21. virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto) override;
  22. NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSync)
  23. NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLSync)
  24. private:
  25. ~WebGLSync();
  26. GLsync mGLName;
  27. };
  28. } // namespace mozilla
  29. #endif // WEBGL_SYNC_H_