xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/gl/egl/DeviceEGL.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2022 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 // DeviceEGL.h:
7 //    Defines the class interface for DeviceEGL, implementing DeviceImpl.
8 //
9 
10 #ifndef LIBANGLE_RENDERER_GL_EGL__DEVICEEGL_H_
11 #define LIBANGLE_RENDERER_GL_EGL__DEVICEEGL_H_
12 
13 #include "libANGLE/renderer/DeviceImpl.h"
14 
15 namespace rx
16 {
17 
18 class DisplayEGL;
19 
20 class DeviceEGL : public DeviceImpl
21 {
22   public:
23     DeviceEGL(DisplayEGL *display);
24     ~DeviceEGL() override;
25 
26     egl::Error initialize() override;
27     egl::Error getAttribute(const egl::Display *display,
28                             EGLint attribute,
29                             void **outValue) override;
30     void generateExtensions(egl::DeviceExtensions *outExtensions) const override;
31     const std::string getDeviceString(EGLint name) override;
32 
33   private:
34     bool hasExtension(const char *extension) const;
35 
36     DisplayEGL *mDisplay;
37     EGLDeviceEXT mDevice;
38     std::vector<std::string> mExtensions;
39 };
40 
41 }  // namespace rx
42 
43 #endif  // LIBANGLE_RENDERER_GL_EGL__DEVICEEGL_H_
44