Commit 3311d474 by Jamie Madill Committed by Commit Bot

Display: Add a shared state object.

This will allow us to manage the SurfaceSet in the GL layer. BUG=angleproject:1684 Change-Id: Iab8243157710beab2667ef10275571078ce9ae8e Reviewed-on: https://chromium-review.googlesource.com/424228Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 1754ba0d
...@@ -139,7 +139,7 @@ static DevicePlatformDisplayMap *GetDevicePlatformDisplayMap() ...@@ -139,7 +139,7 @@ static DevicePlatformDisplayMap *GetDevicePlatformDisplayMap()
return &displays; return &displays;
} }
rx::DisplayImpl *CreateDisplayFromDevice(Device *eglDevice) rx::DisplayImpl *CreateDisplayFromDevice(Device *eglDevice, const DisplayState &state)
{ {
rx::DisplayImpl *impl = nullptr; rx::DisplayImpl *impl = nullptr;
...@@ -147,7 +147,7 @@ rx::DisplayImpl *CreateDisplayFromDevice(Device *eglDevice) ...@@ -147,7 +147,7 @@ rx::DisplayImpl *CreateDisplayFromDevice(Device *eglDevice)
{ {
#if defined(ANGLE_ENABLE_D3D11) #if defined(ANGLE_ENABLE_D3D11)
case EGL_D3D11_DEVICE_ANGLE: case EGL_D3D11_DEVICE_ANGLE:
impl = new rx::DisplayD3D(); impl = new rx::DisplayD3D(state);
break; break;
#endif #endif
#if defined(ANGLE_ENABLE_D3D9) #if defined(ANGLE_ENABLE_D3D9)
...@@ -170,7 +170,7 @@ rx::DisplayImpl *CreateDisplayFromDevice(Device *eglDevice) ...@@ -170,7 +170,7 @@ rx::DisplayImpl *CreateDisplayFromDevice(Device *eglDevice)
return impl; return impl;
} }
rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap) rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap, const DisplayState &state)
{ {
rx::DisplayImpl *impl = nullptr; rx::DisplayImpl *impl = nullptr;
EGLAttrib displayType = EGLAttrib displayType =
...@@ -180,15 +180,15 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap) ...@@ -180,15 +180,15 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap)
case EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE: case EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE:
#if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11) #if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11)
// Default to D3D displays // Default to D3D displays
impl = new rx::DisplayD3D(); impl = new rx::DisplayD3D(state);
#elif defined(ANGLE_USE_X11) #elif defined(ANGLE_USE_X11)
impl = new rx::DisplayGLX(); impl = new rx::DisplayGLX(state);
#elif defined(ANGLE_PLATFORM_APPLE) #elif defined(ANGLE_PLATFORM_APPLE)
impl = new rx::DisplayCGL(); impl = new rx::DisplayCGL(state);
#elif defined(ANGLE_USE_OZONE) #elif defined(ANGLE_USE_OZONE)
impl = new rx::DisplayOzone(); impl = new rx::DisplayOzone(state);
#elif defined(ANGLE_PLATFORM_ANDROID) #elif defined(ANGLE_PLATFORM_ANDROID)
impl = new rx::DisplayAndroid(); impl = new rx::DisplayAndroid(state);
#else #else
// No display available // No display available
UNREACHABLE(); UNREACHABLE();
...@@ -198,7 +198,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap) ...@@ -198,7 +198,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap)
case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE: case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE:
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE: case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
#if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11) #if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11)
impl = new rx::DisplayD3D(); impl = new rx::DisplayD3D(state);
#else #else
// A D3D display was requested on a platform that doesn't support it // A D3D display was requested on a platform that doesn't support it
UNREACHABLE(); UNREACHABLE();
...@@ -208,11 +208,11 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap) ...@@ -208,11 +208,11 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap)
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE: case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
#if defined(ANGLE_ENABLE_OPENGL) #if defined(ANGLE_ENABLE_OPENGL)
#if defined(ANGLE_PLATFORM_WINDOWS) #if defined(ANGLE_PLATFORM_WINDOWS)
impl = new rx::DisplayWGL(); impl = new rx::DisplayWGL(state);
#elif defined(ANGLE_USE_X11) #elif defined(ANGLE_USE_X11)
impl = new rx::DisplayGLX(); impl = new rx::DisplayGLX(state);
#elif defined(ANGLE_PLATFORM_APPLE) #elif defined(ANGLE_PLATFORM_APPLE)
impl = new rx::DisplayCGL(); impl = new rx::DisplayCGL(state);
#elif defined(ANGLE_USE_OZONE) #elif defined(ANGLE_USE_OZONE)
// This might work but has never been tried, so disallow for now. // This might work but has never been tried, so disallow for now.
impl = nullptr; impl = nullptr;
...@@ -231,13 +231,13 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap) ...@@ -231,13 +231,13 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap)
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE: case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
#if defined(ANGLE_ENABLE_OPENGL) #if defined(ANGLE_ENABLE_OPENGL)
#if defined(ANGLE_PLATFORM_WINDOWS) #if defined(ANGLE_PLATFORM_WINDOWS)
impl = new rx::DisplayWGL(); impl = new rx::DisplayWGL(state);
#elif defined(ANGLE_USE_X11) #elif defined(ANGLE_USE_X11)
impl = new rx::DisplayGLX(); impl = new rx::DisplayGLX(state);
#elif defined(ANGLE_USE_OZONE) #elif defined(ANGLE_USE_OZONE)
impl = new rx::DisplayOzone(); impl = new rx::DisplayOzone(state);
#elif defined(ANGLE_PLATFORM_ANDROID) #elif defined(ANGLE_PLATFORM_ANDROID)
impl = new rx::DisplayAndroid(); impl = new rx::DisplayAndroid(state);
#else #else
// No GLES support on this platform, fail display creation. // No GLES support on this platform, fail display creation.
impl = nullptr; impl = nullptr;
...@@ -247,7 +247,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap) ...@@ -247,7 +247,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap)
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE: case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
#if defined(ANGLE_ENABLE_VULKAN) #if defined(ANGLE_ENABLE_VULKAN)
impl = new rx::DisplayVk(); impl = new rx::DisplayVk(state);
#else #else
// No display available // No display available
UNREACHABLE(); UNREACHABLE();
...@@ -256,7 +256,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap) ...@@ -256,7 +256,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap)
case EGL_PLATFORM_ANGLE_TYPE_NULL_ANGLE: case EGL_PLATFORM_ANGLE_TYPE_NULL_ANGLE:
#if defined(ANGLE_ENABLE_NULL) #if defined(ANGLE_ENABLE_NULL)
impl = new rx::DisplayNULL(); impl = new rx::DisplayNULL(state);
#else #else
// No display available // No display available
UNREACHABLE(); UNREACHABLE();
...@@ -304,7 +304,7 @@ Display *Display::GetDisplayFromAttribs(void *native_display, const AttributeMap ...@@ -304,7 +304,7 @@ Display *Display::GetDisplayFromAttribs(void *native_display, const AttributeMap
// Apply new attributes if the display is not initialized yet. // Apply new attributes if the display is not initialized yet.
if (!display->isInitialized()) if (!display->isInitialized())
{ {
rx::DisplayImpl *impl = CreateDisplayFromAttribs(attribMap); rx::DisplayImpl *impl = CreateDisplayFromAttribs(attribMap, display->getState());
if (impl == nullptr) if (impl == nullptr)
{ {
// No valid display implementation for these attributes // No valid display implementation for these attributes
...@@ -360,7 +360,7 @@ Display *Display::GetDisplayFromDevice(void *native_display) ...@@ -360,7 +360,7 @@ Display *Display::GetDisplayFromDevice(void *native_display)
// Apply new attributes if the display is not initialized yet. // Apply new attributes if the display is not initialized yet.
if (!display->isInitialized()) if (!display->isInitialized())
{ {
rx::DisplayImpl *impl = CreateDisplayFromDevice(eglDevice); rx::DisplayImpl *impl = CreateDisplayFromDevice(eglDevice, display->getState());
display->setAttributes(impl, egl::AttributeMap()); display->setAttributes(impl, egl::AttributeMap());
} }
...@@ -510,9 +510,9 @@ void Display::terminate() ...@@ -510,9 +510,9 @@ void Display::terminate()
destroyStream(*mStreamSet.begin()); destroyStream(*mStreamSet.begin());
} }
while (!mImplementation->getSurfaceSet().empty()) while (!mState.surfaceSet.empty())
{ {
destroySurface(*mImplementation->getSurfaceSet().begin()); destroySurface(*mState.surfaceSet.begin());
} }
mConfigSet.clear(); mConfigSet.clear();
...@@ -605,7 +605,7 @@ Error Display::createWindowSurface(const Config *configuration, EGLNativeWindowT ...@@ -605,7 +605,7 @@ Error Display::createWindowSurface(const Config *configuration, EGLNativeWindowT
ASSERT(outSurface != nullptr); ASSERT(outSurface != nullptr);
*outSurface = surface.release(); *outSurface = surface.release();
mImplementation->getSurfaceSet().insert(*outSurface); mState.surfaceSet.insert(*outSurface);
WindowSurfaceMap *windowSurfaces = GetWindowSurfaces(); WindowSurfaceMap *windowSurfaces = GetWindowSurfaces();
ASSERT(windowSurfaces && windowSurfaces->find(window) == windowSurfaces->end()); ASSERT(windowSurfaces && windowSurfaces->find(window) == windowSurfaces->end());
...@@ -628,7 +628,7 @@ Error Display::createPbufferSurface(const Config *configuration, const Attribute ...@@ -628,7 +628,7 @@ Error Display::createPbufferSurface(const Config *configuration, const Attribute
ASSERT(outSurface != nullptr); ASSERT(outSurface != nullptr);
*outSurface = surface.release(); *outSurface = surface.release();
mImplementation->getSurfaceSet().insert(*outSurface); mState.surfaceSet.insert(*outSurface);
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
...@@ -652,7 +652,7 @@ Error Display::createPbufferFromClientBuffer(const Config *configuration, ...@@ -652,7 +652,7 @@ Error Display::createPbufferFromClientBuffer(const Config *configuration,
ASSERT(outSurface != nullptr); ASSERT(outSurface != nullptr);
*outSurface = surface.release(); *outSurface = surface.release();
mImplementation->getSurfaceSet().insert(*outSurface); mState.surfaceSet.insert(*outSurface);
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
...@@ -673,7 +673,7 @@ Error Display::createPixmapSurface(const Config *configuration, NativePixmapType ...@@ -673,7 +673,7 @@ Error Display::createPixmapSurface(const Config *configuration, NativePixmapType
ASSERT(outSurface != nullptr); ASSERT(outSurface != nullptr);
*outSurface = surface.release(); *outSurface = surface.release();
mImplementation->getSurfaceSet().insert(*outSurface); mState.surfaceSet.insert(*outSurface);
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
...@@ -806,7 +806,8 @@ void Display::destroySurface(Surface *surface) ...@@ -806,7 +806,8 @@ void Display::destroySurface(Surface *surface)
ASSERT(surfaceRemoved); ASSERT(surfaceRemoved);
} }
mImplementation->destroySurface(surface); mState.surfaceSet.erase(surface);
surface->onDestroy();
} }
void Display::destroyImage(egl::Image *image) void Display::destroyImage(egl::Image *image)
...@@ -894,8 +895,7 @@ bool Display::isValidContext(const gl::Context *context) const ...@@ -894,8 +895,7 @@ bool Display::isValidContext(const gl::Context *context) const
bool Display::isValidSurface(const Surface *surface) const bool Display::isValidSurface(const Surface *surface) const
{ {
return mImplementation->getSurfaceSet().find(const_cast<Surface *>(surface)) != return mState.surfaceSet.find(const_cast<Surface *>(surface)) != mState.surfaceSet.end();
mImplementation->getSurfaceSet().end();
} }
bool Display::isValidImage(const Image *image) const bool Display::isValidImage(const Image *image) const
......
...@@ -37,6 +37,13 @@ class Image; ...@@ -37,6 +37,13 @@ class Image;
class Surface; class Surface;
class Stream; class Stream;
using SurfaceSet = std::set<Surface *>;
struct DisplayState final : angle::NonCopyable
{
SurfaceSet surfaceSet;
};
class Display final : angle::NonCopyable class Display final : angle::NonCopyable
{ {
public: public:
...@@ -122,6 +129,8 @@ class Display final : angle::NonCopyable ...@@ -122,6 +129,8 @@ class Display final : angle::NonCopyable
gl::Version getMaxSupportedESVersion() const; gl::Version getMaxSupportedESVersion() const;
const DisplayState &getState() const { return mState; }
private: private:
Display(EGLenum platform, EGLNativeDisplayType displayId, Device *eglDevice); Display(EGLenum platform, EGLNativeDisplayType displayId, Device *eglDevice);
...@@ -132,6 +141,7 @@ class Display final : angle::NonCopyable ...@@ -132,6 +141,7 @@ class Display final : angle::NonCopyable
void initDisplayExtensions(); void initDisplayExtensions();
void initVendorString(); void initVendorString();
DisplayState mState;
rx::DisplayImpl *mImplementation; rx::DisplayImpl *mImplementation;
EGLNativeDisplayType mDisplayId; EGLNativeDisplayType mDisplayId;
......
...@@ -8,26 +8,20 @@ ...@@ -8,26 +8,20 @@
#include "libANGLE/renderer/DisplayImpl.h" #include "libANGLE/renderer/DisplayImpl.h"
#include "libANGLE/Display.h"
#include "libANGLE/Surface.h" #include "libANGLE/Surface.h"
namespace rx namespace rx
{ {
DisplayImpl::DisplayImpl() DisplayImpl::DisplayImpl(const egl::DisplayState &state)
: mExtensionsInitialized(false), : mState(state), mExtensionsInitialized(false), mCapsInitialized(false)
mCapsInitialized(false)
{ {
} }
DisplayImpl::~DisplayImpl() DisplayImpl::~DisplayImpl()
{ {
ASSERT(mSurfaceSet.empty()); ASSERT(mState.surfaceSet.empty());
}
void DisplayImpl::destroySurface(egl::Surface *surface)
{
mSurfaceSet.erase(surface);
surface->onDestroy();
} }
const egl::DisplayExtensions &DisplayImpl::getExtensions() const const egl::DisplayExtensions &DisplayImpl::getExtensions() const
......
...@@ -24,6 +24,7 @@ namespace egl ...@@ -24,6 +24,7 @@ namespace egl
{ {
class AttributeMap; class AttributeMap;
class Display; class Display;
struct DisplayState;
struct Config; struct Config;
class Surface; class Surface;
class ImageSibling; class ImageSibling;
...@@ -45,7 +46,7 @@ class StreamProducerImpl; ...@@ -45,7 +46,7 @@ class StreamProducerImpl;
class DisplayImpl : public EGLImplFactory class DisplayImpl : public EGLImplFactory
{ {
public: public:
DisplayImpl(); DisplayImpl(const egl::DisplayState &state);
virtual ~DisplayImpl(); virtual ~DisplayImpl();
virtual egl::Error initialize(egl::Display *display) = 0; virtual egl::Error initialize(egl::Display *display) = 0;
...@@ -75,18 +76,10 @@ class DisplayImpl : public EGLImplFactory ...@@ -75,18 +76,10 @@ class DisplayImpl : public EGLImplFactory
virtual gl::Version getMaxSupportedESVersion() const = 0; virtual gl::Version getMaxSupportedESVersion() const = 0;
const egl::Caps &getCaps() const; const egl::Caps &getCaps() const;
typedef std::set<egl::Surface*> SurfaceSet;
const SurfaceSet &getSurfaceSet() const { return mSurfaceSet; }
SurfaceSet &getSurfaceSet() { return mSurfaceSet; }
void destroySurface(egl::Surface *surface);
const egl::DisplayExtensions &getExtensions() const; const egl::DisplayExtensions &getExtensions() const;
protected: protected:
// Place the surface set here so it can be accessible for handling const egl::DisplayState &mState;
// context loss events. (It is shared between the Display and Impl.)
SurfaceSet mSurfaceSet;
private: private:
virtual void generateExtensions(egl::DisplayExtensions *outExtensions) const = 0; virtual void generateExtensions(egl::DisplayExtensions *outExtensions) const = 0;
......
...@@ -154,7 +154,7 @@ egl::Error CreateRendererD3D(egl::Display *display, RendererD3D **outRenderer) ...@@ -154,7 +154,7 @@ egl::Error CreateRendererD3D(egl::Display *display, RendererD3D **outRenderer)
return result; return result;
} }
DisplayD3D::DisplayD3D() : mRenderer(nullptr) DisplayD3D::DisplayD3D(const egl::DisplayState &state) : DisplayImpl(state), mRenderer(nullptr)
{ {
} }
...@@ -249,7 +249,7 @@ bool DisplayD3D::testDeviceLost() ...@@ -249,7 +249,7 @@ bool DisplayD3D::testDeviceLost()
egl::Error DisplayD3D::restoreLostDevice() egl::Error DisplayD3D::restoreLostDevice()
{ {
// Release surface resources to make the Reset() succeed // Release surface resources to make the Reset() succeed
for (auto &surface : mSurfaceSet) for (auto &surface : mState.surfaceSet)
{ {
if (surface->getBoundTexture()) if (surface->getBoundTexture())
{ {
...@@ -265,7 +265,7 @@ egl::Error DisplayD3D::restoreLostDevice() ...@@ -265,7 +265,7 @@ egl::Error DisplayD3D::restoreLostDevice()
} }
// Restore any surfaces that may have been lost // Restore any surfaces that may have been lost
for (const auto &surface : mSurfaceSet) for (const auto &surface : mState.surfaceSet)
{ {
SurfaceD3D *surfaceD3D = GetImplAs<SurfaceD3D>(surface); SurfaceD3D *surfaceD3D = GetImplAs<SurfaceD3D>(surface);
...@@ -330,7 +330,7 @@ void DisplayD3D::generateCaps(egl::Caps *outCaps) const ...@@ -330,7 +330,7 @@ void DisplayD3D::generateCaps(egl::Caps *outCaps) const
egl::Error DisplayD3D::waitClient() const egl::Error DisplayD3D::waitClient() const
{ {
for (auto &surface : getSurfaceSet()) for (auto &surface : mState.surfaceSet)
{ {
SurfaceD3D *surfaceD3D = GetImplAs<SurfaceD3D>(surface); SurfaceD3D *surfaceD3D = GetImplAs<SurfaceD3D>(surface);
surfaceD3D->checkForOutOfDateSwapChain(); surfaceD3D->checkForOutOfDateSwapChain();
......
...@@ -19,7 +19,7 @@ class RendererD3D; ...@@ -19,7 +19,7 @@ class RendererD3D;
class DisplayD3D : public DisplayImpl class DisplayD3D : public DisplayImpl
{ {
public: public:
DisplayD3D(); DisplayD3D(const egl::DisplayState &state);
egl::Error initialize(egl::Display *display) override; egl::Error initialize(egl::Display *display) override;
virtual void terminate() override; virtual void terminate() override;
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
namespace rx namespace rx
{ {
DisplayGL::DisplayGL() : mRenderer(nullptr), mCurrentDrawSurface(nullptr) DisplayGL::DisplayGL(const egl::DisplayState &state)
: DisplayImpl(state), mRenderer(nullptr), mCurrentDrawSurface(nullptr)
{ {
} }
...@@ -73,7 +74,8 @@ StreamProducerImpl *DisplayGL::createStreamProducerD3DTextureNV12( ...@@ -73,7 +74,8 @@ StreamProducerImpl *DisplayGL::createStreamProducerD3DTextureNV12(
egl::Error DisplayGL::makeCurrent(egl::Surface *drawSurface, egl::Surface *readSurface, gl::Context *context) egl::Error DisplayGL::makeCurrent(egl::Surface *drawSurface, egl::Surface *readSurface, gl::Context *context)
{ {
// Notify the previous surface (if it still exists) that it is no longer current // Notify the previous surface (if it still exists) that it is no longer current
if (mCurrentDrawSurface && mSurfaceSet.find(mCurrentDrawSurface) != mSurfaceSet.end()) if (mCurrentDrawSurface &&
mState.surfaceSet.find(mCurrentDrawSurface) != mState.surfaceSet.end())
{ {
ANGLE_TRY(GetImplAs<SurfaceGL>(mCurrentDrawSurface)->unMakeCurrent()); ANGLE_TRY(GetImplAs<SurfaceGL>(mCurrentDrawSurface)->unMakeCurrent());
} }
......
...@@ -25,7 +25,7 @@ class RendererGL; ...@@ -25,7 +25,7 @@ class RendererGL;
class DisplayGL : public DisplayImpl class DisplayGL : public DisplayImpl
{ {
public: public:
DisplayGL(); DisplayGL(const egl::DisplayState &state);
~DisplayGL() override; ~DisplayGL() override;
egl::Error initialize(egl::Display *display) override; egl::Error initialize(egl::Display *display) override;
......
...@@ -20,7 +20,7 @@ namespace rx ...@@ -20,7 +20,7 @@ namespace rx
class DisplayCGL : public DisplayGL class DisplayCGL : public DisplayGL
{ {
public: public:
DisplayCGL(); DisplayCGL(const egl::DisplayState &state);
~DisplayCGL() override; ~DisplayCGL() override;
egl::Error initialize(egl::Display *display) override; egl::Error initialize(egl::Display *display) override;
......
...@@ -44,7 +44,8 @@ class FunctionsGLCGL : public FunctionsGL ...@@ -44,7 +44,8 @@ class FunctionsGLCGL : public FunctionsGL
void *mDylibHandle; void *mDylibHandle;
}; };
DisplayCGL::DisplayCGL() : DisplayGL(), mEGLDisplay(nullptr), mFunctions(nullptr), mContext(nullptr) DisplayCGL::DisplayCGL(const egl::DisplayState &state)
: DisplayGL(state), mEGLDisplay(nullptr), mFunctions(nullptr), mContext(nullptr)
{ {
} }
......
...@@ -13,8 +13,8 @@ namespace rx ...@@ -13,8 +13,8 @@ namespace rx
#define EGL_NO_CONFIG ((EGLConfig)0) #define EGL_NO_CONFIG ((EGLConfig)0)
DisplayEGL::DisplayEGL() DisplayEGL::DisplayEGL(const egl::DisplayState &state)
: DisplayGL(), : DisplayGL(state),
mEGL(nullptr), mEGL(nullptr),
mConfig(EGL_NO_CONFIG), mConfig(EGL_NO_CONFIG),
mContext(EGL_NO_CONTEXT), mContext(EGL_NO_CONTEXT),
......
...@@ -18,7 +18,7 @@ namespace rx ...@@ -18,7 +18,7 @@ namespace rx
class DisplayEGL : public DisplayGL class DisplayEGL : public DisplayGL
{ {
public: public:
DisplayEGL(); DisplayEGL(const egl::DisplayState &state);
~DisplayEGL() override; ~DisplayEGL() override;
std::string getVendorString() const override; std::string getVendorString() const override;
......
...@@ -32,7 +32,8 @@ const char *GetEGLPath() ...@@ -32,7 +32,8 @@ const char *GetEGLPath()
namespace rx namespace rx
{ {
DisplayAndroid::DisplayAndroid() : DisplayEGL(), mDummyPbuffer(EGL_NO_SURFACE) DisplayAndroid::DisplayAndroid(const egl::DisplayState &state)
: DisplayEGL(state), mDummyPbuffer(EGL_NO_SURFACE)
{ {
} }
......
...@@ -21,7 +21,7 @@ namespace rx ...@@ -21,7 +21,7 @@ namespace rx
class DisplayAndroid : public DisplayEGL class DisplayAndroid : public DisplayEGL
{ {
public: public:
DisplayAndroid(); DisplayAndroid(const egl::DisplayState &state);
~DisplayAndroid() override; ~DisplayAndroid() override;
egl::Error initialize(egl::Display *display) override; egl::Error initialize(egl::Display *display) override;
......
...@@ -325,8 +325,8 @@ void DisplayOzone::Buffer::present() ...@@ -325,8 +325,8 @@ void DisplayOzone::Buffer::present()
} }
} }
DisplayOzone::DisplayOzone() DisplayOzone::DisplayOzone(const egl::DisplayState &state)
: DisplayEGL(), : DisplayEGL(state),
mSwapControl(SwapControl::ABSENT), mSwapControl(SwapControl::ABSENT),
mMinSwapInterval(0), mMinSwapInterval(0),
mMaxSwapInterval(0), mMaxSwapInterval(0),
......
...@@ -107,7 +107,7 @@ class DisplayOzone final : public DisplayEGL ...@@ -107,7 +107,7 @@ class DisplayOzone final : public DisplayEGL
GLuint mTexture; GLuint mTexture;
}; };
DisplayOzone(); DisplayOzone(const egl::DisplayState &state);
~DisplayOzone() override; ~DisplayOzone() override;
egl::Error initialize(egl::Display *display) override; egl::Error initialize(egl::Display *display) override;
......
...@@ -106,8 +106,8 @@ class FunctionsGLGLX : public FunctionsGL ...@@ -106,8 +106,8 @@ class FunctionsGLGLX : public FunctionsGL
PFNGETPROCPROC mGetProc; PFNGETPROCPROC mGetProc;
}; };
DisplayGLX::DisplayGLX() DisplayGLX::DisplayGLX(const egl::DisplayState &state)
: DisplayGL(), : DisplayGL(state),
mFunctionsGL(nullptr), mFunctionsGL(nullptr),
mRequestedVisual(-1), mRequestedVisual(-1),
mContextConfig(nullptr), mContextConfig(nullptr),
......
...@@ -38,7 +38,7 @@ struct SwapControlData ...@@ -38,7 +38,7 @@ struct SwapControlData
class DisplayGLX : public DisplayGL class DisplayGLX : public DisplayGL
{ {
public: public:
DisplayGLX(); DisplayGLX(const egl::DisplayState &state);
~DisplayGLX() override; ~DisplayGLX() override;
egl::Error initialize(egl::Display *display) override; egl::Error initialize(egl::Display *display) override;
......
...@@ -58,8 +58,8 @@ class FunctionsGLWindows : public FunctionsGL ...@@ -58,8 +58,8 @@ class FunctionsGLWindows : public FunctionsGL
PFNWGLGETPROCADDRESSPROC mGetProcAddressWGL; PFNWGLGETPROCADDRESSPROC mGetProcAddressWGL;
}; };
DisplayWGL::DisplayWGL() DisplayWGL::DisplayWGL(const egl::DisplayState &state)
: DisplayGL(), : DisplayGL(state),
mOpenGLModule(nullptr), mOpenGLModule(nullptr),
mFunctionsWGL(nullptr), mFunctionsWGL(nullptr),
mFunctionsGL(nullptr), mFunctionsGL(nullptr),
......
...@@ -21,7 +21,7 @@ class FunctionsWGL; ...@@ -21,7 +21,7 @@ class FunctionsWGL;
class DisplayWGL : public DisplayGL class DisplayWGL : public DisplayGL
{ {
public: public:
DisplayWGL(); DisplayWGL(const egl::DisplayState &state);
~DisplayWGL() override; ~DisplayWGL() override;
egl::Error initialize(egl::Display *display) override; egl::Error initialize(egl::Display *display) override;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
namespace rx namespace rx
{ {
DisplayNULL::DisplayNULL() : DisplayImpl(), mDevice(nullptr) DisplayNULL::DisplayNULL(const egl::DisplayState &state) : DisplayImpl(state), mDevice(nullptr)
{ {
} }
......
...@@ -18,7 +18,7 @@ namespace rx ...@@ -18,7 +18,7 @@ namespace rx
class DisplayNULL : public DisplayImpl class DisplayNULL : public DisplayImpl
{ {
public: public:
DisplayNULL(); DisplayNULL(const egl::DisplayState &state);
~DisplayNULL() override; ~DisplayNULL() override;
egl::Error initialize(egl::Display *display) override; egl::Error initialize(egl::Display *display) override;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
namespace rx namespace rx
{ {
DisplayVk::DisplayVk() : DisplayImpl(), mRenderer(nullptr) DisplayVk::DisplayVk(const egl::DisplayState &state) : DisplayImpl(state), mRenderer(nullptr)
{ {
} }
......
...@@ -19,7 +19,7 @@ class RendererVk; ...@@ -19,7 +19,7 @@ class RendererVk;
class DisplayVk : public DisplayImpl class DisplayVk : public DisplayImpl
{ {
public: public:
DisplayVk(); DisplayVk(const egl::DisplayState &state);
~DisplayVk() override; ~DisplayVk() override;
egl::Error initialize(egl::Display *display) override; egl::Error initialize(egl::Display *display) 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