1 //
2 // Copyright 2019 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // SemaphoreImpl.h: Implements the rx::SemaphoreImpl class [EXT_external_objects]
7 
8 #ifndef LIBANGLE_RENDERER_SEMAPHOREIMPL_H_
9 #define LIBANGLE_RENDERER_SEMAPHOREIMPL_H_
10 
11 #include "angle_gl.h"
12 #include "common/PackedEnums.h"
13 #include "common/angleutils.h"
14 #include "libANGLE/Error.h"
15 #include "libANGLE/angletypes.h"
16 
17 namespace gl
18 {
19 class Context;
20 class Semaphore;
21 }  // namespace gl
22 
23 namespace rx
24 {
25 
26 class SemaphoreImpl : angle::NonCopyable
27 {
28   public:
~SemaphoreImpl()29     virtual ~SemaphoreImpl() {}
30 
31     virtual void onDestroy(const gl::Context *context) = 0;
32 
33     virtual angle::Result importFd(gl::Context *context, gl::HandleType handleType, GLint fd) = 0;
34 
35     virtual angle::Result importZirconHandle(gl::Context *context,
36                                              gl::HandleType handleType,
37                                              GLuint handle) = 0;
38 
39     virtual angle::Result wait(gl::Context *context,
40                                const gl::BufferBarrierVector &bufferBarriers,
41                                const gl::TextureBarrierVector &textureBarriers) = 0;
42 
43     virtual angle::Result signal(gl::Context *context,
44                                  const gl::BufferBarrierVector &bufferBarriers,
45                                  const gl::TextureBarrierVector &textureBarriers) = 0;
46 };
47 
48 }  // namespace rx
49 
50 #endif  // LIBANGLE_RENDERER_SEMAPHOREIMPL_H_
51