Greg Daniel | 6ecc911 | 2017-06-16 16:17:03 +0000 | [diff] [blame] | 1 | /* |
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 | |||||
12 | GrGLSemaphore::GrGLSemaphore(const GrGLGpu* gpu, bool isOwned) | ||||
13 | : INHERITED(gpu), fSync(0), fIsOwned(isOwned) { | ||||
14 | } | ||||
15 | |||||
16 | GrGLSemaphore::~GrGLSemaphore() { | ||||
17 | if (fIsOwned && fGpu) { | ||||
18 | static_cast<const GrGLGpu*>(fGpu)->deleteSync(fSync); | ||||
19 | } | ||||
20 | } |