2015-05-27 14:12:00 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* 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 WEBGL_TIMER_QUERY_H_
|
|
|
|
#define WEBGL_TIMER_QUERY_H_
|
|
|
|
|
2015-06-05 06:26:34 +03:00
|
|
|
#include "GLConsts.h"
|
2015-05-27 14:12:00 +03:00
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
#include "WebGLObjectModel.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class WebGLTimerQuery final
|
|
|
|
: public nsWrapperCache
|
|
|
|
, public WebGLRefCountedObject<WebGLTimerQuery>
|
|
|
|
, public WebGLContextBoundObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static WebGLTimerQuery* Create(WebGLContext* webgl);
|
|
|
|
|
|
|
|
void Delete();
|
|
|
|
|
2015-06-03 05:51:13 +03:00
|
|
|
bool HasEverBeenBound() const { return mTarget != LOCAL_GL_NONE; }
|
|
|
|
GLenum Target() const { return mTarget; }
|
|
|
|
|
|
|
|
WebGLContext* GetParentObject() const;
|
2015-05-27 14:12:00 +03:00
|
|
|
|
|
|
|
// NS
|
|
|
|
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
|
|
|
|
|
2015-06-03 05:51:13 +03:00
|
|
|
const GLenum mGLName;
|
|
|
|
|
2015-05-27 14:12:00 +03:00
|
|
|
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTimerQuery)
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTimerQuery)
|
|
|
|
|
|
|
|
private:
|
|
|
|
explicit WebGLTimerQuery(WebGLContext* webgl, GLuint aName);
|
2015-06-03 05:51:13 +03:00
|
|
|
~WebGLTimerQuery();
|
|
|
|
|
|
|
|
GLenum mTarget;
|
2015-05-27 14:12:00 +03:00
|
|
|
|
|
|
|
friend class WebGLExtensionDisjointTimerQuery;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // WEBGL_TIMER_QUERY_H_
|