blob: c26b74e9c1b764ebc6faf7f2613727155163dc2e [file] [log] [blame]
Greg Daniel6ecc9112017-06-16 16:17:03 +00001/*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "GrGLSemaphore.h"
9
10#include "GrGLGpu.h"
11
12GrGLSemaphore::GrGLSemaphore(const GrGLGpu* gpu, bool isOwned)
13 : INHERITED(gpu), fSync(0), fIsOwned(isOwned) {
14}
15
16GrGLSemaphore::~GrGLSemaphore() {
17 if (fIsOwned && fGpu) {
18 static_cast<const GrGLGpu*>(fGpu)->deleteSync(fSync);
19 }
20}