Bug 1610775 [wpt PR 21336] - Update urllib3 to 1.25.8, a=testonly
[gecko.git] / dom / canvas / WebGLExtensionDisjointTimerQuery.cpp
blob666ca4f6d68f55913008f4dfcb16f50811b9e833
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"
9 #include "GLContext.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"
16 namespace mozilla {
18 WebGLExtensionDisjointTimerQuery::WebGLExtensionDisjointTimerQuery(
19 WebGLContext* webgl)
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) &&
31 gl->IsSupported(
32 gl::GLFeature::query_counter); // provides GL_TIMESTAMP
35 } // namespace mozilla