Commit 2cc53379 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Consolidate code paths for clearing the OpenGL context.

We clear it if the context or the view is NULL. If the context is non-NULL, we want to disassociate the views of both the current and passed-in contexts, if they differ.
parent d57a99b4
......@@ -154,36 +154,28 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
WineOpenGLContext *context = (WineOpenGLContext*)c;
NSView* view = (NSView*)v;
if (context)
if (context && view)
{
[context removeFromViews:NO];
if (view)
{
macdrv_add_view_opengl_context(v, c);
if (context.needsUpdate)
{
context.needsUpdate = FALSE;
[context setView:view];
[context setLatentView:nil];
}
else
{
if ([context view])
[context clearDrawableLeavingSurfaceOnScreen];
[context setLatentView:view];
}
macdrv_add_view_opengl_context(v, c);
[context makeCurrentContext];
if ([context view])
[context clearToBlackIfNeeded];
if (context.needsUpdate)
{
context.needsUpdate = FALSE;
[context setView:view];
[context setLatentView:nil];
}
else
{
[WineOpenGLContext clearCurrentContext];
[context removeFromViews:YES];
if ([context view])
[context clearDrawableLeavingSurfaceOnScreen];
[context setLatentView:view];
}
[context makeCurrentContext];
if ([context view])
[context clearToBlackIfNeeded];
}
else
{
......@@ -192,8 +184,12 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
if ([currentContext isKindOfClass:[WineOpenGLContext class]])
{
[WineOpenGLContext clearCurrentContext];
[currentContext removeFromViews:YES];
if (currentContext != context)
[currentContext removeFromViews:YES];
}
if (context)
[context removeFromViews:YES];
}
[pool release];
......
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