xref: /aosp_15_r20/external/skia/src/gpu/ganesh/gl/GrGLSemaphore.cpp (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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 "src/gpu/ganesh/gl/GrGLSemaphore.h"
9 
10 #include "src/gpu/ganesh/gl/GrGLGpu.h"
11 
GrGLSemaphore(GrGLGpu * gpu,bool isOwned)12 GrGLSemaphore::GrGLSemaphore(GrGLGpu* gpu, bool isOwned)
13         : fGpu(gpu), fSync(nullptr), fIsOwned(isOwned) {
14 }
15 
~GrGLSemaphore()16 GrGLSemaphore::~GrGLSemaphore() {
17     if (fSync && fIsOwned) {
18         fGpu->deleteSync(fSync);
19     }
20 }
21