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 "mozilla/dom/WebGL2RenderingContextBinding.h"
10 #include "WebGLContext.h"
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