1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "WebGLExtensions.h"
10 #include "mozilla/dom/WebGLRenderingContextBinding.h"
11 #include "mozilla/dom/BindingUtils.h"
12 #include "mozilla/StaticPrefs_webgl.h"
13 #include "WebGLContext.h"
14 #include "WebGLQuery.h"
18 WebGLExtensionDisjointTimerQuery::WebGLExtensionDisjointTimerQuery(
20 : WebGLExtensionBase(webgl
) {
21 MOZ_ASSERT(IsSupported(webgl
), "Don't construct extension if unsupported.");
24 bool WebGLExtensionDisjointTimerQuery::IsSupported(
25 const WebGLContext
* const webgl
) {
26 if (!StaticPrefs::webgl_enable_privileged_extensions()) return false;
28 gl::GLContext
* gl
= webgl
->GL();
29 return gl
->IsSupported(gl::GLFeature::query_objects
) &&
30 gl
->IsSupported(gl::GLFeature::get_query_object_i64v
) &&
32 gl::GLFeature::query_counter
); // provides GL_TIMESTAMP
35 } // namespace mozilla