1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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/. */
9 #include "WebGLObjectModel.h"
10 #include "nsThreadUtils.h"
14 class AvailabilityRunnable
;
17 class WebGLQuery final
: public WebGLContextBoundObject
{
18 friend class webgl::AvailabilityRunnable
;
20 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(WebGLQuery
, override
)
27 RefPtr
<WebGLQuery
>* mActiveSlot
;
29 bool mCanBeAvailable
= false; // Track whether the event loop has spun
33 GLenum
Target() const { return mTarget
; }
34 bool IsActive() const { return bool(mActiveSlot
); }
38 explicit WebGLQuery(WebGLContext
* webgl
);
41 ~WebGLQuery() override
;
46 void BeginQuery(GLenum target
, RefPtr
<WebGLQuery
>& slot
);
48 Maybe
<double> GetQueryParameter(GLenum pname
) const;
52 } // namespace mozilla
54 #endif // WEBGL_QUERY_H_