Debian Codegraph @

src/gpu/ganesh/gl/GrGLSemaphore.h

raw
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 #ifndef GrGLSemaphore_DEFINED
9 #define GrGLSemaphore_DEFINED
10
11 #include "include/gpu/ganesh/GrBackendSemaphore.h"
12 #include "include/gpu/ganesh/gl/GrGLTypes.h"
13 #include "include/private/base/SkAssert.h"
14 #include "src/gpu/ganesh/GrSemaphore.h"
15
16 #include <memory>
17
18 class GrGLGpu;
19
20 class GrGLSemaphore : public GrSemaphore {
21 public:
22 static std::unique_ptr<GrGLSemaphore> Make(GrGLGpu* gpu, bool isOwned) {
23 return std::unique_ptr<GrGLSemaphore>(new GrGLSemaphore(gpu, isOwned));
24 }
25
26 ~GrGLSemaphore() override;
27
28 GrGLsync sync() const { return fSync; }
29 void setSync(const GrGLsync& sync) { fSync = sync; }
30
31 GrBackendSemaphore backendSemaphore() const override {
32 SK_ABORT("Unsupported");
33 }
34
35 private:
36 GrGLSemaphore(GrGLGpu* gpu, bool isOwned);
37
38 void setIsOwned() override {
39 fIsOwned = true;
40 }
41
42 GrGLGpu* fGpu;
43 GrGLsync fSync;
44 bool fIsOwned;
45
46 using INHERITED = GrSemaphore;
47 };
48
49 #endif