xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/EGLSyncImpl.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
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 
7 // EGLSyncImpl.h: Defines the rx::EGLSyncImpl class.
8 
9 #ifndef LIBANGLE_RENDERER_EGLSYNCIMPL_H_
10 #define LIBANGLE_RENDERER_EGLSYNCIMPL_H_
11 
12 #include "libANGLE/Error.h"
13 
14 #include "common/angleutils.h"
15 
16 #include "angle_gl.h"
17 
18 namespace egl
19 {
20 class AttributeMap;
21 class Display;
22 }  // namespace egl
23 
24 namespace gl
25 {
26 class Context;
27 }  // namespace gl
28 
29 namespace rx
30 {
31 class EGLSyncImpl : angle::NonCopyable
32 {
33   public:
EGLSyncImpl()34     EGLSyncImpl() {}
~EGLSyncImpl()35     virtual ~EGLSyncImpl() {}
36 
onDestroy(const egl::Display * display)37     virtual void onDestroy(const egl::Display *display) {}
38 
39     virtual egl::Error initialize(const egl::Display *display,
40                                   const gl::Context *context,
41                                   EGLenum type,
42                                   const egl::AttributeMap &attribs) = 0;
43     virtual egl::Error clientWait(const egl::Display *display,
44                                   const gl::Context *context,
45                                   EGLint flags,
46                                   EGLTime timeout,
47                                   EGLint *outResult)                = 0;
48     virtual egl::Error serverWait(const egl::Display *display,
49                                   const gl::Context *context,
50                                   EGLint flags)                     = 0;
51     virtual egl::Error signal(const egl::Display *display, const gl::Context *context, EGLint mode);
52     virtual egl::Error getStatus(const egl::Display *display, EGLint *outStatus) = 0;
53     virtual egl::Error copyMetalSharedEventANGLE(const egl::Display *display,
54                                                  void **outEvent) const;
55     virtual egl::Error dupNativeFenceFD(const egl::Display *display, EGLint *fdOut) const;
56 };
57 }  // namespace rx
58 
59 #endif  // LIBANGLE_RENDERER_EGLSYNCIMPL_H_
60