2
// Copyright 2020 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.
7
// DisplayEAGL.h: EAGL implementation of egl::Display
9
#ifndef LIBANGLE_RENDERER_GL_EAGL_DISPLAYEAGL_H_
10
#define LIBANGLE_RENDERER_GL_EAGL_DISPLAYEAGL_H_
12
#include "libANGLE/renderer/gl/DisplayGL.h"
16
typedef EAGLContext *EAGLContextObj;
18
typedef void *EAGLContextObj;
26
class DisplayEAGL : public DisplayGL
29
DisplayEAGL(const egl::DisplayState &state);
30
~DisplayEAGL() override;
32
egl::Error initialize(egl::Display *display) override;
33
void terminate() override;
35
SurfaceImpl *createWindowSurface(const egl::SurfaceState &state,
36
EGLNativeWindowType window,
37
const egl::AttributeMap &attribs) override;
38
SurfaceImpl *createPbufferSurface(const egl::SurfaceState &state,
39
const egl::AttributeMap &attribs) override;
40
SurfaceImpl *createPbufferFromClientBuffer(const egl::SurfaceState &state,
42
EGLClientBuffer clientBuffer,
43
const egl::AttributeMap &attribs) override;
44
SurfaceImpl *createPixmapSurface(const egl::SurfaceState &state,
45
NativePixmapType nativePixmap,
46
const egl::AttributeMap &attribs) override;
48
ContextImpl *createContext(const gl::State &state,
49
gl::ErrorSet *errorSet,
50
const egl::Config *configuration,
51
const gl::Context *shareContext,
52
const egl::AttributeMap &attribs) override;
54
egl::ConfigSet generateConfigs() override;
56
bool testDeviceLost() override;
57
egl::Error restoreLostDevice(const egl::Display *display) override;
59
bool isValidNativeWindow(EGLNativeWindowType window) const override;
60
egl::Error validateClientBuffer(const egl::Config *configuration,
62
EGLClientBuffer clientBuffer,
63
const egl::AttributeMap &attribs) const override;
65
DeviceImpl *createDevice() override;
67
std::string getVendorString() const override;
69
egl::Error waitClient(const gl::Context *context) override;
70
egl::Error waitNative(const gl::Context *context, EGLint engine) override;
72
gl::Version getMaxSupportedESVersion() const override;
74
EAGLContextObj getEAGLContext() const;
76
WorkerContext *createWorkerContext(std::string *infoLog);
78
void initializeFrontendFeatures(angle::FrontendFeatures *features) const override;
80
void populateFeatureList(angle::FeatureList *features) override;
83
egl::Error makeCurrentSurfaceless(gl::Context *context) override;
85
void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
86
void generateCaps(egl::Caps *outCaps) const override;
88
std::shared_ptr<RendererGL> mRenderer;
90
egl::Display *mEGLDisplay;
91
EAGLContextObj mContext;
96
#endif // LIBANGLE_RENDERER_GL_EAGL_DISPLAYEAGL_H_