Commit 95401dbb by Jamie Madill Committed by Commit Bot

Surface: Pass DisplayImpl to initialize and swap.

In new back-ends (Vulkan) this will allow us to avoid storing a ref to the Renderer in the Surface class. BUG=angleproject:1319 Change-Id: I3b3f50893070d2993e4e91dd82ee539a083b3727 Reviewed-on: https://chromium-review.googlesource.com/419837 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 57e6d50e
...@@ -557,7 +557,7 @@ Error Display::createWindowSurface(const Config *configuration, EGLNativeWindowT ...@@ -557,7 +557,7 @@ Error Display::createWindowSurface(const Config *configuration, EGLNativeWindowT
std::unique_ptr<Surface> surface( std::unique_ptr<Surface> surface(
new WindowSurface(mImplementation, configuration, window, attribs)); new WindowSurface(mImplementation, configuration, window, attribs));
ANGLE_TRY(surface->initialize()); ANGLE_TRY(surface->initialize(*this));
ASSERT(outSurface != nullptr); ASSERT(outSurface != nullptr);
*outSurface = surface.release(); *outSurface = surface.release();
...@@ -580,7 +580,7 @@ Error Display::createPbufferSurface(const Config *configuration, const Attribute ...@@ -580,7 +580,7 @@ Error Display::createPbufferSurface(const Config *configuration, const Attribute
} }
std::unique_ptr<Surface> surface(new PbufferSurface(mImplementation, configuration, attribs)); std::unique_ptr<Surface> surface(new PbufferSurface(mImplementation, configuration, attribs));
ANGLE_TRY(surface->initialize()); ANGLE_TRY(surface->initialize(*this));
ASSERT(outSurface != nullptr); ASSERT(outSurface != nullptr);
*outSurface = surface.release(); *outSurface = surface.release();
...@@ -604,7 +604,7 @@ Error Display::createPbufferFromClientBuffer(const Config *configuration, ...@@ -604,7 +604,7 @@ Error Display::createPbufferFromClientBuffer(const Config *configuration,
std::unique_ptr<Surface> surface( std::unique_ptr<Surface> surface(
new PbufferSurface(mImplementation, configuration, buftype, clientBuffer, attribs)); new PbufferSurface(mImplementation, configuration, buftype, clientBuffer, attribs));
ANGLE_TRY(surface->initialize()); ANGLE_TRY(surface->initialize(*this));
ASSERT(outSurface != nullptr); ASSERT(outSurface != nullptr);
*outSurface = surface.release(); *outSurface = surface.release();
...@@ -625,7 +625,7 @@ Error Display::createPixmapSurface(const Config *configuration, NativePixmapType ...@@ -625,7 +625,7 @@ Error Display::createPixmapSurface(const Config *configuration, NativePixmapType
std::unique_ptr<Surface> surface( std::unique_ptr<Surface> surface(
new PixmapSurface(mImplementation, configuration, nativePixmap, attribs)); new PixmapSurface(mImplementation, configuration, nativePixmap, attribs));
ANGLE_TRY(surface->initialize()); ANGLE_TRY(surface->initialize(*this));
ASSERT(outSurface != nullptr); ASSERT(outSurface != nullptr);
*outSurface = surface.release(); *outSurface = surface.release();
......
...@@ -116,7 +116,7 @@ class Display final : angle::NonCopyable ...@@ -116,7 +116,7 @@ class Display final : angle::NonCopyable
const AttributeMap &getAttributeMap() const { return mAttributeMap; } const AttributeMap &getAttributeMap() const { return mAttributeMap; }
EGLNativeDisplayType getNativeDisplayId() const { return mDisplayId; } EGLNativeDisplayType getNativeDisplayId() const { return mDisplayId; }
rx::DisplayImpl *getImplementation() { return mImplementation; } rx::DisplayImpl *getImplementation() const { return mImplementation; }
Device *getDevice() const; Device *getDevice() const;
EGLenum getPlatform() const { return mPlatform; } EGLenum getPlatform() const { return mPlatform; }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <iostream> #include <iostream>
#include "libANGLE/Config.h" #include "libANGLE/Config.h"
#include "libANGLE/Display.h"
#include "libANGLE/Framebuffer.h" #include "libANGLE/Framebuffer.h"
#include "libANGLE/Texture.h" #include "libANGLE/Texture.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
...@@ -87,9 +88,9 @@ Surface::~Surface() ...@@ -87,9 +88,9 @@ Surface::~Surface()
SafeDelete(mImplementation); SafeDelete(mImplementation);
} }
Error Surface::initialize() Error Surface::initialize(const Display &display)
{ {
ANGLE_TRY(mImplementation->initialize()); ANGLE_TRY(mImplementation->initialize(display.getImplementation()));
// Initialized here since impl is nullptr in the constructor. // Initialized here since impl is nullptr in the constructor.
// Must happen after implementation initialize for Android. // Must happen after implementation initialize for Android.
...@@ -133,9 +134,9 @@ EGLint Surface::getType() const ...@@ -133,9 +134,9 @@ EGLint Surface::getType() const
return mType; return mType;
} }
Error Surface::swap() Error Surface::swap(const Display &display)
{ {
return mImplementation->swap(); return mImplementation->swap(display.getImplementation());
} }
Error Surface::swapWithDamage(EGLint *rects, EGLint n_rects) Error Surface::swapWithDamage(EGLint *rects, EGLint n_rects)
......
...@@ -53,8 +53,8 @@ class Surface : public gl::FramebufferAttachmentObject ...@@ -53,8 +53,8 @@ class Surface : public gl::FramebufferAttachmentObject
EGLint getType() const; EGLint getType() const;
Error initialize(); Error initialize(const Display &display);
Error swap(); Error swap(const Display &display);
Error swapWithDamage(EGLint *rects, EGLint n_rects); Error swapWithDamage(EGLint *rects, EGLint n_rects);
Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height); Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height);
Error querySurfacePointerANGLE(EGLint attribute, void **value); Error querySurfacePointerANGLE(EGLint attribute, void **value);
......
...@@ -28,9 +28,9 @@ class MockSurfaceImpl : public rx::SurfaceImpl ...@@ -28,9 +28,9 @@ class MockSurfaceImpl : public rx::SurfaceImpl
MockSurfaceImpl() : SurfaceImpl(mockState) {} MockSurfaceImpl() : SurfaceImpl(mockState) {}
virtual ~MockSurfaceImpl() { destroy(); } virtual ~MockSurfaceImpl() { destroy(); }
MOCK_METHOD0(initialize, egl::Error()); MOCK_METHOD1(initialize, egl::Error(const DisplayImpl *));
MOCK_METHOD1(createDefaultFramebuffer, rx::FramebufferImpl *(const gl::FramebufferState &data)); MOCK_METHOD1(createDefaultFramebuffer, rx::FramebufferImpl *(const gl::FramebufferState &data));
MOCK_METHOD0(swap, egl::Error()); MOCK_METHOD1(swap, egl::Error(const DisplayImpl *));
MOCK_METHOD2(swapWithDamage, egl::Error(EGLint *, EGLint)); MOCK_METHOD2(swapWithDamage, egl::Error(EGLint *, EGLint));
MOCK_METHOD4(postSubBuffer, egl::Error(EGLint, EGLint, EGLint, EGLint)); MOCK_METHOD4(postSubBuffer, egl::Error(EGLint, EGLint, EGLint, EGLint));
MOCK_METHOD2(querySurfacePointerANGLE, egl::Error(EGLint, void**)); MOCK_METHOD2(querySurfacePointerANGLE, egl::Error(EGLint, void**));
......
...@@ -28,6 +28,7 @@ struct SurfaceState; ...@@ -28,6 +28,7 @@ struct SurfaceState;
namespace rx namespace rx
{ {
class DisplayImpl;
class FramebufferImpl; class FramebufferImpl;
class SurfaceImpl : public FramebufferAttachmentObjectImpl class SurfaceImpl : public FramebufferAttachmentObjectImpl
...@@ -36,9 +37,9 @@ class SurfaceImpl : public FramebufferAttachmentObjectImpl ...@@ -36,9 +37,9 @@ class SurfaceImpl : public FramebufferAttachmentObjectImpl
SurfaceImpl(const egl::SurfaceState &surfaceState); SurfaceImpl(const egl::SurfaceState &surfaceState);
virtual ~SurfaceImpl(); virtual ~SurfaceImpl();
virtual egl::Error initialize() = 0; virtual egl::Error initialize(const DisplayImpl *displayImpl) = 0;
virtual FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) = 0; virtual FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) = 0;
virtual egl::Error swap() = 0; virtual egl::Error swap(const DisplayImpl *displayImpl) = 0;
virtual egl::Error swapWithDamage(EGLint *rects, EGLint n_rects); virtual egl::Error swapWithDamage(EGLint *rects, EGLint n_rects);
virtual egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) = 0; virtual egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) = 0;
virtual egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) = 0; virtual egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) = 0;
......
...@@ -82,7 +82,7 @@ void SurfaceD3D::releaseSwapChain() ...@@ -82,7 +82,7 @@ void SurfaceD3D::releaseSwapChain()
SafeDelete(mSwapChain); SafeDelete(mSwapChain);
} }
egl::Error SurfaceD3D::initialize() egl::Error SurfaceD3D::initialize(const DisplayImpl *displayImpl)
{ {
if (mNativeWindow->getNativeWindow()) if (mNativeWindow->getNativeWindow())
{ {
...@@ -280,7 +280,7 @@ bool SurfaceD3D::checkForOutOfDateSwapChain() ...@@ -280,7 +280,7 @@ bool SurfaceD3D::checkForOutOfDateSwapChain()
return wasDirty; return wasDirty;
} }
egl::Error SurfaceD3D::swap() egl::Error SurfaceD3D::swap(const DisplayImpl *displayImpl)
{ {
return swapRect(0, 0, mWidth, mHeight); return swapRect(0, 0, mWidth, mHeight);
} }
......
...@@ -28,10 +28,10 @@ class SurfaceD3D : public SurfaceImpl ...@@ -28,10 +28,10 @@ class SurfaceD3D : public SurfaceImpl
~SurfaceD3D() override; ~SurfaceD3D() override;
void releaseSwapChain(); void releaseSwapChain();
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override; FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
......
...@@ -29,10 +29,10 @@ class PbufferSurfaceCGL : public SurfaceGL ...@@ -29,10 +29,10 @@ class PbufferSurfaceCGL : public SurfaceGL
const FunctionsGL *functions); const FunctionsGL *functions);
~PbufferSurfaceCGL() override; ~PbufferSurfaceCGL() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
egl::Error makeCurrent() override; egl::Error makeCurrent() override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
...@@ -60,6 +60,6 @@ class PbufferSurfaceCGL : public SurfaceGL ...@@ -60,6 +60,6 @@ class PbufferSurfaceCGL : public SurfaceGL
GLuint mDSRenderbuffer; GLuint mDSRenderbuffer;
}; };
} } // namespace rx
#endif // LIBANGLE_RENDERER_GL_CGL_PBUFFERSURFACECGL_H_ #endif // LIBANGLE_RENDERER_GL_CGL_PBUFFERSURFACECGL_H_
...@@ -55,7 +55,7 @@ PbufferSurfaceCGL::~PbufferSurfaceCGL() ...@@ -55,7 +55,7 @@ PbufferSurfaceCGL::~PbufferSurfaceCGL()
} }
} }
egl::Error PbufferSurfaceCGL::initialize() egl::Error PbufferSurfaceCGL::initialize(const DisplayImpl *displayImpl)
{ {
mFunctions->genRenderbuffers(1, &mColorRenderbuffer); mFunctions->genRenderbuffers(1, &mColorRenderbuffer);
mStateManager->bindRenderbuffer(GL_RENDERBUFFER, mColorRenderbuffer); mStateManager->bindRenderbuffer(GL_RENDERBUFFER, mColorRenderbuffer);
...@@ -80,7 +80,7 @@ egl::Error PbufferSurfaceCGL::makeCurrent() ...@@ -80,7 +80,7 @@ egl::Error PbufferSurfaceCGL::makeCurrent()
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
egl::Error PbufferSurfaceCGL::swap() egl::Error PbufferSurfaceCGL::swap(const DisplayImpl *displayImpl)
{ {
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
...@@ -140,4 +140,4 @@ FramebufferImpl *PbufferSurfaceCGL::createDefaultFramebuffer(const gl::Framebuff ...@@ -140,4 +140,4 @@ FramebufferImpl *PbufferSurfaceCGL::createDefaultFramebuffer(const gl::Framebuff
mRenderer->getBlitter(), mStateManager); mRenderer->getBlitter(), mStateManager);
} }
} } // namespace rx
...@@ -61,10 +61,10 @@ class WindowSurfaceCGL : public SurfaceGL ...@@ -61,10 +61,10 @@ class WindowSurfaceCGL : public SurfaceGL
CGLContextObj context); CGLContextObj context);
~WindowSurfaceCGL() override; ~WindowSurfaceCGL() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
egl::Error makeCurrent() override; egl::Error makeCurrent() override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
...@@ -95,6 +95,6 @@ class WindowSurfaceCGL : public SurfaceGL ...@@ -95,6 +95,6 @@ class WindowSurfaceCGL : public SurfaceGL
GLuint mDSRenderbuffer; GLuint mDSRenderbuffer;
}; };
} } // namespace rx
#endif // LIBANGLE_RENDERER_GL_CGL_WINDOWSURFACECGL_H_ #endif // LIBANGLE_RENDERER_GL_CGL_WINDOWSURFACECGL_H_
...@@ -194,7 +194,7 @@ WindowSurfaceCGL::~WindowSurfaceCGL() ...@@ -194,7 +194,7 @@ WindowSurfaceCGL::~WindowSurfaceCGL()
} }
} }
egl::Error WindowSurfaceCGL::initialize() egl::Error WindowSurfaceCGL::initialize(const DisplayImpl *displayImpl)
{ {
unsigned width = getWidth(); unsigned width = getWidth();
unsigned height = getHeight(); unsigned height = getHeight();
...@@ -237,7 +237,7 @@ egl::Error WindowSurfaceCGL::makeCurrent() ...@@ -237,7 +237,7 @@ egl::Error WindowSurfaceCGL::makeCurrent()
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
egl::Error WindowSurfaceCGL::swap() egl::Error WindowSurfaceCGL::swap(const DisplayImpl *displayImpl)
{ {
mFunctions->flush(); mFunctions->flush();
mSwapState.beingRendered->swapId = ++mCurrentSwapId; mSwapState.beingRendered->swapId = ++mCurrentSwapId;
...@@ -329,4 +329,4 @@ FramebufferImpl *WindowSurfaceCGL::createDefaultFramebuffer(const gl::Framebuffe ...@@ -329,4 +329,4 @@ FramebufferImpl *WindowSurfaceCGL::createDefaultFramebuffer(const gl::Framebuffe
mStateManager); mStateManager);
} }
} } // namespace rx
...@@ -25,7 +25,7 @@ PbufferSurfaceEGL::~PbufferSurfaceEGL() ...@@ -25,7 +25,7 @@ PbufferSurfaceEGL::~PbufferSurfaceEGL()
{ {
} }
egl::Error PbufferSurfaceEGL::initialize() egl::Error PbufferSurfaceEGL::initialize(const DisplayImpl *displayImpl)
{ {
mSurface = mEGL->createPbufferSurface(mConfig, mAttribList.data()); mSurface = mEGL->createPbufferSurface(mConfig, mAttribList.data());
if (mSurface == EGL_NO_SURFACE) if (mSurface == EGL_NO_SURFACE)
......
...@@ -28,7 +28,7 @@ class PbufferSurfaceEGL : public SurfaceEGL ...@@ -28,7 +28,7 @@ class PbufferSurfaceEGL : public SurfaceEGL
RendererGL *renderer); RendererGL *renderer);
~PbufferSurfaceEGL() override; ~PbufferSurfaceEGL() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
}; };
} // namespace rx } // namespace rx
......
...@@ -47,7 +47,7 @@ egl::Error SurfaceEGL::makeCurrent() ...@@ -47,7 +47,7 @@ egl::Error SurfaceEGL::makeCurrent()
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
egl::Error SurfaceEGL::swap() egl::Error SurfaceEGL::swap(const DisplayImpl *displayImpl)
{ {
EGLBoolean success = mEGL->swapBuffers(mSurface); EGLBoolean success = mEGL->swapBuffers(mSurface);
if (success == EGL_FALSE) if (success == EGL_FALSE)
......
...@@ -29,7 +29,7 @@ class SurfaceEGL : public SurfaceGL ...@@ -29,7 +29,7 @@ class SurfaceEGL : public SurfaceGL
~SurfaceEGL() override; ~SurfaceEGL() override;
egl::Error makeCurrent() override; egl::Error makeCurrent() override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
......
...@@ -26,7 +26,7 @@ WindowSurfaceEGL::~WindowSurfaceEGL() ...@@ -26,7 +26,7 @@ WindowSurfaceEGL::~WindowSurfaceEGL()
{ {
} }
egl::Error WindowSurfaceEGL::initialize() egl::Error WindowSurfaceEGL::initialize(const DisplayImpl *displayImpl)
{ {
mSurface = mEGL->createWindowSurface(mConfig, mWindow, mAttribList.data()); mSurface = mEGL->createWindowSurface(mConfig, mWindow, mAttribList.data());
if (mSurface == EGL_NO_SURFACE) if (mSurface == EGL_NO_SURFACE)
......
...@@ -26,7 +26,7 @@ class WindowSurfaceEGL : public SurfaceEGL ...@@ -26,7 +26,7 @@ class WindowSurfaceEGL : public SurfaceEGL
RendererGL *renderer); RendererGL *renderer);
~WindowSurfaceEGL() override; ~WindowSurfaceEGL() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
private: private:
EGLNativeWindowType mWindow; EGLNativeWindowType mWindow;
......
...@@ -26,7 +26,7 @@ SurfaceOzone::~SurfaceOzone() ...@@ -26,7 +26,7 @@ SurfaceOzone::~SurfaceOzone()
delete mBuffer; delete mBuffer;
} }
egl::Error SurfaceOzone::initialize() egl::Error SurfaceOzone::initialize(const DisplayImpl *displayImpl)
{ {
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
...@@ -41,7 +41,7 @@ egl::Error SurfaceOzone::makeCurrent() ...@@ -41,7 +41,7 @@ egl::Error SurfaceOzone::makeCurrent()
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
egl::Error SurfaceOzone::swap() egl::Error SurfaceOzone::swap(const DisplayImpl *displayImpl)
{ {
mBuffer->present(); mBuffer->present();
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
......
...@@ -25,10 +25,10 @@ class SurfaceOzone : public SurfaceGL ...@@ -25,10 +25,10 @@ class SurfaceOzone : public SurfaceGL
FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override; FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
egl::Error makeCurrent() override; egl::Error makeCurrent() override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
......
...@@ -42,7 +42,7 @@ PbufferSurfaceGLX::~PbufferSurfaceGLX() ...@@ -42,7 +42,7 @@ PbufferSurfaceGLX::~PbufferSurfaceGLX()
} }
} }
egl::Error PbufferSurfaceGLX::initialize() egl::Error PbufferSurfaceGLX::initialize(const DisplayImpl *displayImpl)
{ {
// Avoid creating 0-sized PBuffers as it fails on the Intel Mesa driver // Avoid creating 0-sized PBuffers as it fails on the Intel Mesa driver
// as commented on https://bugs.freedesktop.org/show_bug.cgi?id=38869 so we // as commented on https://bugs.freedesktop.org/show_bug.cgi?id=38869 so we
...@@ -82,7 +82,7 @@ egl::Error PbufferSurfaceGLX::makeCurrent() ...@@ -82,7 +82,7 @@ egl::Error PbufferSurfaceGLX::makeCurrent()
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
egl::Error PbufferSurfaceGLX::swap() egl::Error PbufferSurfaceGLX::swap(const DisplayImpl *displayImpl)
{ {
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
...@@ -140,4 +140,4 @@ egl::Error PbufferSurfaceGLX::checkForResize() ...@@ -140,4 +140,4 @@ egl::Error PbufferSurfaceGLX::checkForResize()
// The size of pbuffers never change // The size of pbuffers never change
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
} } // namespace rx
...@@ -30,10 +30,10 @@ class PbufferSurfaceGLX : public SurfaceGLX ...@@ -30,10 +30,10 @@ class PbufferSurfaceGLX : public SurfaceGLX
glx::FBConfig fbConfig); glx::FBConfig fbConfig);
~PbufferSurfaceGLX() override; ~PbufferSurfaceGLX() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
egl::Error makeCurrent() override; egl::Error makeCurrent() override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
...@@ -59,6 +59,6 @@ class PbufferSurfaceGLX : public SurfaceGLX ...@@ -59,6 +59,6 @@ class PbufferSurfaceGLX : public SurfaceGLX
glx::Pbuffer mPbuffer; glx::Pbuffer mPbuffer;
}; };
} } // namespace rx
#endif // LIBANGLE_RENDERER_GL_GLX_PBUFFERSURFACEGLX_H_ #endif // LIBANGLE_RENDERER_GL_GLX_PBUFFERSURFACEGLX_H_
...@@ -63,7 +63,7 @@ WindowSurfaceGLX::~WindowSurfaceGLX() ...@@ -63,7 +63,7 @@ WindowSurfaceGLX::~WindowSurfaceGLX()
mGLXDisplay->syncXCommands(); mGLXDisplay->syncXCommands();
} }
egl::Error WindowSurfaceGLX::initialize() egl::Error WindowSurfaceGLX::initialize(const DisplayImpl *displayImpl)
{ {
// Check that the window's visual ID is valid, as part of the AMGLE_x11_visual // Check that the window's visual ID is valid, as part of the AMGLE_x11_visual
// extension. // extension.
...@@ -141,7 +141,7 @@ egl::Error WindowSurfaceGLX::makeCurrent() ...@@ -141,7 +141,7 @@ egl::Error WindowSurfaceGLX::makeCurrent()
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
egl::Error WindowSurfaceGLX::swap() egl::Error WindowSurfaceGLX::swap(const DisplayImpl *displayImpl)
{ {
// We need to swap before resizing as some drivers clobber the back buffer // We need to swap before resizing as some drivers clobber the back buffer
// when the window is resized. // when the window is resized.
...@@ -241,4 +241,4 @@ bool WindowSurfaceGLX::getWindowDimensions(Window window, unsigned int *width, u ...@@ -241,4 +241,4 @@ bool WindowSurfaceGLX::getWindowDimensions(Window window, unsigned int *width, u
return XGetGeometry(mDisplay, window, &root, &x, &y, width, height, &border, &depth) != 0; return XGetGeometry(mDisplay, window, &root, &x, &y, width, height, &border, &depth) != 0;
} }
} } // namespace rx
...@@ -32,10 +32,10 @@ class WindowSurfaceGLX : public SurfaceGLX ...@@ -32,10 +32,10 @@ class WindowSurfaceGLX : public SurfaceGLX
glx::FBConfig fbConfig); glx::FBConfig fbConfig);
~WindowSurfaceGLX() override; ~WindowSurfaceGLX() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
egl::Error makeCurrent() override; egl::Error makeCurrent() override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
...@@ -68,6 +68,6 @@ class WindowSurfaceGLX : public SurfaceGLX ...@@ -68,6 +68,6 @@ class WindowSurfaceGLX : public SurfaceGLX
SwapControlData mSwapControl; SwapControlData mSwapControl;
}; };
} } // namespace rx
#endif // LIBANGLE_RENDERER_GL_GLX_WINDOWSURFACEGLX_H_ #endif // LIBANGLE_RENDERER_GL_GLX_WINDOWSURFACEGLX_H_
...@@ -226,7 +226,7 @@ egl::Error D3DTextureSurfaceWGL::ValidateD3DTextureClientBuffer(EGLClientBuffer ...@@ -226,7 +226,7 @@ egl::Error D3DTextureSurfaceWGL::ValidateD3DTextureClientBuffer(EGLClientBuffer
return GetD3DTextureInfo(clientBuffer, nullptr, nullptr, nullptr, nullptr); return GetD3DTextureInfo(clientBuffer, nullptr, nullptr, nullptr, nullptr);
} }
egl::Error D3DTextureSurfaceWGL::initialize() egl::Error D3DTextureSurfaceWGL::initialize(const DisplayImpl *displayImpl)
{ {
IUnknown *device = nullptr; IUnknown *device = nullptr;
ANGLE_TRY(GetD3DTextureInfo(mClientBuffer, &mWidth, &mHeight, &mObject, &device)); ANGLE_TRY(GetD3DTextureInfo(mClientBuffer, &mWidth, &mHeight, &mObject, &device));
...@@ -287,7 +287,7 @@ egl::Error D3DTextureSurfaceWGL::unMakeCurrent() ...@@ -287,7 +287,7 @@ egl::Error D3DTextureSurfaceWGL::unMakeCurrent()
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
egl::Error D3DTextureSurfaceWGL::swap() egl::Error D3DTextureSurfaceWGL::swap(const DisplayImpl *displayImpl)
{ {
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
......
...@@ -37,11 +37,11 @@ class D3DTextureSurfaceWGL : public SurfaceGL ...@@ -37,11 +37,11 @@ class D3DTextureSurfaceWGL : public SurfaceGL
static egl::Error ValidateD3DTextureClientBuffer(EGLClientBuffer clientBuffer); static egl::Error ValidateD3DTextureClientBuffer(EGLClientBuffer clientBuffer);
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
egl::Error makeCurrent() override; egl::Error makeCurrent() override;
egl::Error unMakeCurrent() override; egl::Error unMakeCurrent() override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
......
...@@ -86,7 +86,7 @@ DXGISwapChainWindowSurfaceWGL::~DXGISwapChainWindowSurfaceWGL() ...@@ -86,7 +86,7 @@ DXGISwapChainWindowSurfaceWGL::~DXGISwapChainWindowSurfaceWGL()
SafeRelease(mSwapChain1); SafeRelease(mSwapChain1);
} }
egl::Error DXGISwapChainWindowSurfaceWGL::initialize() egl::Error DXGISwapChainWindowSurfaceWGL::initialize(const DisplayImpl *displayImpl)
{ {
if (mOrientation != EGL_SURFACE_ORIENTATION_INVERT_Y_ANGLE) if (mOrientation != EGL_SURFACE_ORIENTATION_INVERT_Y_ANGLE)
{ {
...@@ -128,7 +128,7 @@ egl::Error DXGISwapChainWindowSurfaceWGL::makeCurrent() ...@@ -128,7 +128,7 @@ egl::Error DXGISwapChainWindowSurfaceWGL::makeCurrent()
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
egl::Error DXGISwapChainWindowSurfaceWGL::swap() egl::Error DXGISwapChainWindowSurfaceWGL::swap(const DisplayImpl *displayImpl)
{ {
mFunctionsGL->flush(); mFunctionsGL->flush();
......
...@@ -38,10 +38,10 @@ class DXGISwapChainWindowSurfaceWGL : public SurfaceGL ...@@ -38,10 +38,10 @@ class DXGISwapChainWindowSurfaceWGL : public SurfaceGL
EGLint orientation); EGLint orientation);
~DXGISwapChainWindowSurfaceWGL() override; ~DXGISwapChainWindowSurfaceWGL() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
egl::Error makeCurrent() override; egl::Error makeCurrent() override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
......
...@@ -72,7 +72,7 @@ static int GetWGLTextureTarget(EGLenum eglTextureTarget) ...@@ -72,7 +72,7 @@ static int GetWGLTextureTarget(EGLenum eglTextureTarget)
} }
} }
egl::Error PbufferSurfaceWGL::initialize() egl::Error PbufferSurfaceWGL::initialize(const DisplayImpl *displayImpl)
{ {
const int pbufferCreationAttributes[] = const int pbufferCreationAttributes[] =
{ {
...@@ -122,7 +122,7 @@ egl::Error PbufferSurfaceWGL::makeCurrent() ...@@ -122,7 +122,7 @@ egl::Error PbufferSurfaceWGL::makeCurrent()
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
egl::Error PbufferSurfaceWGL::swap() egl::Error PbufferSurfaceWGL::swap(const DisplayImpl *displayImpl)
{ {
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
......
...@@ -34,10 +34,10 @@ class PbufferSurfaceWGL : public SurfaceGL ...@@ -34,10 +34,10 @@ class PbufferSurfaceWGL : public SurfaceGL
const FunctionsWGL *functions); const FunctionsWGL *functions);
~PbufferSurfaceWGL() override; ~PbufferSurfaceWGL() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
egl::Error makeCurrent() override; egl::Error makeCurrent() override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
......
...@@ -41,7 +41,7 @@ WindowSurfaceWGL::~WindowSurfaceWGL() ...@@ -41,7 +41,7 @@ WindowSurfaceWGL::~WindowSurfaceWGL()
mDeviceContext = nullptr; mDeviceContext = nullptr;
} }
egl::Error WindowSurfaceWGL::initialize() egl::Error WindowSurfaceWGL::initialize(const DisplayImpl *displayImpl)
{ {
mDeviceContext = GetDC(mWindow); mDeviceContext = GetDC(mWindow);
if (!mDeviceContext) if (!mDeviceContext)
...@@ -100,7 +100,7 @@ egl::Error WindowSurfaceWGL::makeCurrent() ...@@ -100,7 +100,7 @@ egl::Error WindowSurfaceWGL::makeCurrent()
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
egl::Error WindowSurfaceWGL::swap() egl::Error WindowSurfaceWGL::swap(const DisplayImpl *displayImpl)
{ {
if (!mFunctionsWGL->swapBuffers(mDeviceContext)) if (!mFunctionsWGL->swapBuffers(mDeviceContext))
{ {
......
...@@ -30,10 +30,10 @@ class WindowSurfaceWGL : public SurfaceGL ...@@ -30,10 +30,10 @@ class WindowSurfaceWGL : public SurfaceGL
EGLint orientation); EGLint orientation);
~WindowSurfaceWGL() override; ~WindowSurfaceWGL() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
egl::Error makeCurrent() override; egl::Error makeCurrent() override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
......
...@@ -24,7 +24,7 @@ SurfaceNULL::~SurfaceNULL() ...@@ -24,7 +24,7 @@ SurfaceNULL::~SurfaceNULL()
{ {
} }
egl::Error SurfaceNULL::initialize() egl::Error SurfaceNULL::initialize(const DisplayImpl *displayImpl)
{ {
return egl::NoError(); return egl::NoError();
} }
...@@ -34,7 +34,7 @@ FramebufferImpl *SurfaceNULL::createDefaultFramebuffer(const gl::FramebufferStat ...@@ -34,7 +34,7 @@ FramebufferImpl *SurfaceNULL::createDefaultFramebuffer(const gl::FramebufferStat
return new FramebufferNULL(state); return new FramebufferNULL(state);
} }
egl::Error SurfaceNULL::swap() egl::Error SurfaceNULL::swap(const DisplayImpl *displayImpl)
{ {
return egl::NoError(); return egl::NoError();
} }
......
...@@ -21,9 +21,9 @@ class SurfaceNULL : public SurfaceImpl ...@@ -21,9 +21,9 @@ class SurfaceNULL : public SurfaceImpl
SurfaceNULL(const egl::SurfaceState &surfaceState); SurfaceNULL(const egl::SurfaceState &surfaceState);
~SurfaceNULL() override; ~SurfaceNULL() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override; FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
......
...@@ -22,7 +22,7 @@ SurfaceVk::~SurfaceVk() ...@@ -22,7 +22,7 @@ SurfaceVk::~SurfaceVk()
{ {
} }
egl::Error SurfaceVk::initialize() egl::Error SurfaceVk::initialize(const DisplayImpl *displayImpl)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
return egl::Error(EGL_BAD_ACCESS); return egl::Error(EGL_BAD_ACCESS);
...@@ -34,7 +34,7 @@ FramebufferImpl *SurfaceVk::createDefaultFramebuffer(const gl::FramebufferState ...@@ -34,7 +34,7 @@ FramebufferImpl *SurfaceVk::createDefaultFramebuffer(const gl::FramebufferState
return static_cast<FramebufferImpl *>(0); return static_cast<FramebufferImpl *>(0);
} }
egl::Error SurfaceVk::swap() egl::Error SurfaceVk::swap(const DisplayImpl *displayImpl)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
return egl::Error(EGL_BAD_ACCESS); return egl::Error(EGL_BAD_ACCESS);
......
...@@ -21,9 +21,9 @@ class SurfaceVk : public SurfaceImpl ...@@ -21,9 +21,9 @@ class SurfaceVk : public SurfaceImpl
SurfaceVk(const egl::SurfaceState &surfaceState); SurfaceVk(const egl::SurfaceState &surfaceState);
~SurfaceVk() override; ~SurfaceVk() override;
egl::Error initialize() override; egl::Error initialize(const DisplayImpl *displayImpl) override;
FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override; FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override;
egl::Error swap() override; egl::Error swap(const DisplayImpl *displayImpl) override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
......
...@@ -840,7 +840,7 @@ EGLBoolean EGLAPIENTRY SwapBuffers(EGLDisplay dpy, EGLSurface surface) ...@@ -840,7 +840,7 @@ EGLBoolean EGLAPIENTRY SwapBuffers(EGLDisplay dpy, EGLSurface surface)
return EGL_FALSE; return EGL_FALSE;
} }
error = eglSurface->swap(); error = eglSurface->swap(*display);
if (error.isError()) if (error.isError())
{ {
thread->setError(error); thread->setError(error);
......
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