Bug 1850713: remove duplicated setting of early hint preloader id in `ScriptLoader...
[gecko.git] / dom / canvas / WebGLSync.cpp
blobe4b196ab0400635a6842680d27b67494b42015b5
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/. */
6 #include "WebGLSync.h"
8 #include "GLContext.h"
9 #include "mozilla/dom/WebGL2RenderingContextBinding.h"
10 #include "WebGLContext.h"
12 namespace mozilla {
14 WebGLSync::WebGLSync(WebGLContext* webgl, GLenum condition, GLbitfield flags)
15 : WebGLContextBoundObject(webgl),
16 mGLName(mContext->gl->fFenceSync(condition, flags)),
17 mFenceId(mContext->mNextFenceId) {
18 mContext->mNextFenceId += 1;
21 WebGLSync::~WebGLSync() {
22 if (!mContext) return;
23 mContext->gl->fDeleteSync(mGLName);
26 void WebGLSync::MarkSignaled() const {
27 if (mContext->mCompletedFenceId < mFenceId) {
28 mContext->mCompletedFenceId = mFenceId;
32 } // namespace mozilla