Bumping gaia.json for 3 gaia-central revision(s) a=gaia-bump
[gecko.git] / content / canvas / src / WebGLQuery.h
blob1e565ff22c38be3fedb0a74dfd1fb42895dccc6d
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 & DESTRUCTOR
30 WebGLQuery(WebGLContext *context);
32 ~WebGLQuery() {
33 DeleteOnce();
37 // -------------------------------------------------------------------------
38 // MEMBER FUNCTIONS
40 bool IsActive() const;
42 bool HasEverBeenActive()
44 return mType != 0;
48 // -------------------------------------------------------------------------
49 // IMPLEMENT WebGLRefCountedObject and WebGLContextBoundObject
51 void Delete();
53 WebGLContext* GetParentObject() const
55 return Context();
59 // -------------------------------------------------------------------------
60 // IMPLEMENT NS
61 virtual JSObject* WrapObject(JSContext *cx,
62 JS::Handle<JSObject*> scope) MOZ_OVERRIDE;
64 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLQuery)
65 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLQuery)
68 // -----------------------------------------------------------------------------
69 // PRIVATE
70 private:
72 // -------------------------------------------------------------------------
73 // MEMBERS
74 GLuint mGLName;
75 GLenum mType;
77 // -------------------------------------------------------------------------
78 // FRIENDSHIPS
79 friend class WebGLContext;
82 } // namespace mozilla
84 #endif