Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / dom / canvas / WebGLQuery.h
blob419f819dba95d532972283c7f601376e3ad12c76
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/. */
6 #ifndef WEBGLQUERY_H_
7 #define WEBGLQUERY_H_
9 #include "WebGLObjectModel.h"
11 #include "nsWrapperCache.h"
13 #include "mozilla/LinkedList.h"
15 namespace mozilla {
17 class WebGLQuery MOZ_FINAL
18 : public nsWrapperCache
19 , public WebGLRefCountedObject<WebGLQuery>
20 , public LinkedListElement<WebGLQuery>
21 , public WebGLContextBoundObject
23 // -----------------------------------------------------------------------------
24 // PUBLIC
25 public:
27 // -------------------------------------------------------------------------
28 // CONSTRUCTOR
30 WebGLQuery(WebGLContext *context);
32 // -------------------------------------------------------------------------
33 // MEMBER FUNCTIONS
35 bool IsActive() const;
37 bool HasEverBeenActive()
39 return mType != 0;
43 // -------------------------------------------------------------------------
44 // IMPLEMENT WebGLRefCountedObject and WebGLContextBoundObject
46 void Delete();
48 WebGLContext* GetParentObject() const
50 return Context();
54 // -------------------------------------------------------------------------
55 // IMPLEMENT NS
56 virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
58 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLQuery)
59 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLQuery)
62 // -----------------------------------------------------------------------------
63 // PRIVATE
64 private:
65 ~WebGLQuery() {
66 DeleteOnce();
69 // -------------------------------------------------------------------------
70 // MEMBERS
71 GLuint mGLName;
72 GLenum mType;
74 // -------------------------------------------------------------------------
75 // FRIENDSHIPS
76 friend class WebGLContext;
79 } // namespace mozilla
81 #endif