Kaydet (Commit) aefeef36 authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Jan Holesovsky

vcl: use resetToReInitialize to avoid context problems on Windows.

It appears that we have to do this for VirtualDevices, where we have
freed / re-allocated the underlying resource, or we fail to switch the
current context, and render to the wrong place, before blatting a
blank texture over the top of it.

Change-Id: I0253f216ea7dc9786374dc83ca38f4f6295e3035
üst 44b6f1cb
...@@ -105,6 +105,15 @@ void OpenGLSalGraphicsImpl::Init() ...@@ -105,6 +105,15 @@ void OpenGLSalGraphicsImpl::Init()
maOffscreenTex.GetHeight() != GetHeight() ) maOffscreenTex.GetHeight() != GetHeight() )
{ {
maOffscreenTex = OpenGLTexture(); maOffscreenTex = OpenGLTexture();
#if defined(WNT)
// URGH ... VirtualDevice may have destroyed the underlying resource
// our context is associated with - FIXME: can we do better here ?
if (mpContext)
{
mpContext->resetToReInitialize();
ReleaseContext();
}
#endif
} }
} }
......
...@@ -621,6 +621,17 @@ bool OpenGLContext::init(SystemChildWindow* pChildWindow) ...@@ -621,6 +621,17 @@ bool OpenGLContext::init(SystemChildWindow* pChildWindow)
return ImplInit(); return ImplInit();
} }
#if defined( WNT )
// FIXME share resetToReInitialize() across platforms...
void OpenGLContext::resetToReInitialize()
{
if( !mbInitialized )
return;
resetCurrent();
mbInitialized = false;
}
#endif
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
bool OpenGLContext::init(Display* dpy, Window win, int screen) bool OpenGLContext::init(Display* dpy, Window win, int screen)
{ {
......
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