2013-08-07 01:23:46 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef WEBGLQUERY_H_
|
|
|
|
#define WEBGLQUERY_H_
|
|
|
|
|
|
|
|
#include "WebGLObjectModel.h"
|
|
|
|
|
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
|
|
|
|
#include "mozilla/LinkedList.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class WebGLQuery MOZ_FINAL
|
2013-09-04 16:14:48 +04:00
|
|
|
: public nsWrapperCache
|
2013-08-07 01:23:46 +04:00
|
|
|
, public WebGLRefCountedObject<WebGLQuery>
|
|
|
|
, public LinkedListElement<WebGLQuery>
|
|
|
|
, public WebGLContextBoundObject
|
|
|
|
{
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// PUBLIC
|
|
|
|
public:
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
2014-06-26 17:30:49 +04:00
|
|
|
// CONSTRUCTOR
|
2013-08-07 01:23:46 +04:00
|
|
|
|
2014-09-02 02:26:43 +04:00
|
|
|
explicit WebGLQuery(WebGLContext* aContext);
|
2013-08-07 01:23:46 +04:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// MEMBER FUNCTIONS
|
|
|
|
|
2013-09-04 16:14:52 +04:00
|
|
|
bool IsActive() const;
|
2013-08-07 01:23:46 +04:00
|
|
|
|
|
|
|
bool HasEverBeenActive()
|
|
|
|
{
|
|
|
|
return mType != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// IMPLEMENT WebGLRefCountedObject and WebGLContextBoundObject
|
|
|
|
|
|
|
|
void Delete();
|
|
|
|
|
|
|
|
WebGLContext* GetParentObject() const
|
|
|
|
{
|
|
|
|
return Context();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// IMPLEMENT NS
|
2014-04-09 02:27:18 +04:00
|
|
|
virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
|
2013-08-07 01:23:46 +04:00
|
|
|
|
2013-09-04 16:14:48 +04:00
|
|
|
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLQuery)
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLQuery)
|
2013-08-07 01:23:46 +04:00
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// PRIVATE
|
|
|
|
private:
|
2014-06-26 17:30:49 +04:00
|
|
|
~WebGLQuery() {
|
|
|
|
DeleteOnce();
|
|
|
|
};
|
2013-08-07 01:23:46 +04:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// MEMBERS
|
2013-09-04 16:14:43 +04:00
|
|
|
GLuint mGLName;
|
|
|
|
GLenum mType;
|
2013-08-07 01:23:46 +04:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// FRIENDSHIPS
|
2014-11-03 08:35:04 +03:00
|
|
|
friend class WebGL2Context;
|
2013-08-07 01:23:46 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|