Revert pending surface destruction (part of revision 632).

TRAC #16271 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@656 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 062231c0
#define MAJOR_VERSION 0
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 655
#define BUILD_REVISION 656
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -603,15 +603,8 @@ EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *sha
void Display::destroySurface(egl::Surface *surface)
{
if (surface == egl::getCurrentDrawSurface() || surface == egl::getCurrentReadSurface())
{
surface->setPendingDestroy();
}
else
{
delete surface;
mSurfaceSet.erase(surface);
}
delete surface;
mSurfaceSet.erase(surface);
}
void Display::destroyContext(gl::Context *context)
......@@ -645,7 +638,7 @@ bool Display::isValidContext(gl::Context *context)
bool Display::isValidSurface(egl::Surface *surface)
{
return mSurfaceSet.find(surface) != mSurfaceSet.end() && !surface->isPendingDestroy();
return mSurfaceSet.find(surface) != mSurfaceSet.end();
}
bool Display::hasExistingWindowSurface(HWND window)
......
......@@ -38,8 +38,6 @@ Surface::Surface(Display *display, const Config *config, HWND window)
mSwapInterval = -1;
setSwapInterval(1);
mIsPendingDestroy = false;
subclassWindow();
}
......@@ -60,8 +58,6 @@ Surface::Surface(Display *display, const Config *config, HANDLE shareHandle, EGL
mSwapBehavior = EGL_BUFFER_PRESERVED;
mSwapInterval = -1;
setSwapInterval(1);
mIsPendingDestroy = false;
}
Surface::~Surface()
......@@ -324,7 +320,6 @@ DWORD Surface::convertInterval(EGLint interval)
return D3DPRESENT_INTERVAL_DEFAULT;
}
bool Surface::swap()
{
if (mSwapChain)
......@@ -430,13 +425,4 @@ D3DFORMAT Surface::getFormat() const
{
return mConfig->mRenderTargetFormat;
}
void Surface::setPendingDestroy() {
mIsPendingDestroy = true;
}
bool Surface::isPendingDestroy() const {
return mIsPendingDestroy;
}
}
......@@ -61,9 +61,6 @@ class Surface
virtual void setBoundTexture(gl::Texture2D *texture);
virtual gl::Texture2D *getBoundTexture() const;
void setPendingDestroy();
bool isPendingDestroy() const;
private:
DISALLOW_COPY_AND_ASSIGN(Surface);
......@@ -74,7 +71,6 @@ private:
IDirect3DTexture9* mOffscreenTexture;
HANDLE mShareHandle;
bool mIsPendingDestroy;
void subclassWindow();
void unsubclassWindow();
......
......@@ -936,18 +936,6 @@ EGLBoolean __stdcall eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface
glMakeCurrent(context, display, static_cast<egl::Surface*>(draw));
// If the previous surfaces are still current, this might just flag
// them as pending destruction again, deferring destruction to a future
// eglMakeCurrent or eglTerminate call.
if (previousDraw && previousDraw->isPendingDestroy())
{
eglDestroySurface(dpy, previousDraw);
}
if (previousRead && previousRead != previousDraw && previousRead->isPendingDestroy())
{
eglDestroySurface(dpy, previousRead);
}
return success(EGL_TRUE);
}
catch(std::bad_alloc&)
......
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