Commit a889d30f by Julien Isorce Committed by Commit Bot

Reland "Provide default implementation of rx::DisplayEGL"

This is a reland of 123fd970 Original change's description: > Provide default implementation of rx::DisplayEGL > > Will allow to use EGL instead of GLX on X11. > > Meant to be used on modern EGL so it requires the extensions > EGL_KHR_no_config_context and EGL_KHR_surfaceless_context. > This keeps the default implementation simple (no pBuffer > fallback) > > Also provide simple WorkerContextEGL. > > Bug: angleproject:4328 > Change-Id: I92a1ded9e09e65de8bb83710274e0a73ecdff0a4 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2061168 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:4328 Change-Id: I02046613324e9283ba8f2ed02dd9c7ce703e0fde Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2063045Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent c7f63a01
......@@ -14,12 +14,12 @@
#include <vector>
#include "libANGLE/renderer/gl/DisplayGL.h"
#include "libANGLE/renderer/gl/egl/FunctionsEGL.h"
#include "libANGLE/renderer/gl/egl/egl_utils.h"
namespace rx
{
class FunctionsEGLDL;
class RendererEGL;
class WorkerContext;
......@@ -44,7 +44,10 @@ class DisplayEGL : public DisplayGL
virtual WorkerContext *createWorkerContext(std::string *infoLog,
EGLContext sharedContext,
const native_egl::AttributeVector workerAttribs) = 0;
const native_egl::AttributeVector workerAttribs);
egl::Error initialize(egl::Display *display) override;
void terminate() override;
SurfaceImpl *createWindowSurface(const egl::SurfaceState &state,
EGLNativeWindowType window,
......@@ -59,6 +62,12 @@ class DisplayEGL : public DisplayGL
NativePixmapType nativePixmap,
const egl::AttributeMap &attribs) override;
ContextImpl *createContext(const gl::State &state,
gl::ErrorSet *errorSet,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
egl::ConfigSet generateConfigs() override;
bool testDeviceLost() override;
......@@ -71,6 +80,10 @@ class DisplayEGL : public DisplayGL
egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) override;
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
gl::Version getMaxSupportedESVersion() const override;
void initializeFrontendFeatures(angle::FrontendFeatures *features) const override;
......@@ -85,6 +98,8 @@ class DisplayEGL : public DisplayGL
void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
egl::Error createRenderer(EGLContext shareContext, std::shared_ptr<RendererEGL> *outRenderer);
egl::Error makeCurrentSurfaceless(gl::Context *context) override;
template <typename T>
......@@ -98,7 +113,7 @@ class DisplayEGL : public DisplayGL
const U &defaultValue) const;
std::shared_ptr<RendererEGL> mRenderer;
FunctionsEGL *mEGL;
FunctionsEGLDL *mEGL;
EGLConfig mConfig;
egl::AttributeMap mDisplayAttributes;
std::vector<EGLint> mConfigAttribList;
......
......@@ -346,11 +346,11 @@ void DisplayAndroid::destroyNativeContext(EGLContext context)
void DisplayAndroid::generateExtensions(egl::DisplayExtensions *outExtensions) const
{
DisplayEGL::generateExtensions(outExtensions);
// Surfaceless can be support if the native driver supports it or we know that we are running on
// a single thread (mVirtualizedContexts == true)
outExtensions->surfacelessContext = mSupportsSurfaceless || mVirtualizedContexts;
DisplayEGL::generateExtensions(outExtensions);
}
egl::Error DisplayAndroid::createRenderer(EGLContext shareContext,
......
......@@ -920,6 +920,13 @@ ContextImpl *DisplayOzone::createContext(const gl::State &state,
return new ContextEGL(state, errorSet, mRenderer);
}
egl::Error DisplayOzone::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context)
{
return DisplayGL::makeCurrent(drawSurface, readSurface, context);
}
egl::ConfigSet DisplayOzone::generateConfigs()
{
egl::ConfigSet configs;
......@@ -953,10 +960,10 @@ void DisplayOzone::setSwapInterval(EGLSurface drawable, SwapControlData *data)
void DisplayOzone::generateExtensions(egl::DisplayExtensions *outExtensions) const
{
DisplayEGL::generateExtensions(outExtensions);
// Surfaceless contexts are emulated even if there is no native support.
outExtensions->surfacelessContext = true;
DisplayEGL::generateExtensions(outExtensions);
}
class WorkerContextOzone final : public WorkerContext
......
......@@ -127,6 +127,10 @@ class DisplayOzone final : public DisplayEGL
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
egl::ConfigSet generateConfigs() override;
bool isValidNativeWindow(EGLNativeWindowType window) const override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment