winemac: Simplify and optimize making a GL context current with no view.

If the context is already current, don't do +clearCurrentContext followed by
-makeCurrentContext.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ken Thomases 2016-02-22 21:14:30 -06:00 committed by Alexandre Julliard
parent 96376059ef
commit 38f579f9ba
1 changed files with 9 additions and 9 deletions

View File

@ -227,17 +227,17 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
{
WineOpenGLContext* currentContext = (WineOpenGLContext*)[WineOpenGLContext currentContext];
if ([currentContext isKindOfClass:[WineOpenGLContext class]])
{
[WineOpenGLContext clearCurrentContext];
if (currentContext != context)
[currentContext removeFromViews:YES];
}
[context removeFromViews:YES];
if (context)
if (currentContext != context)
{
[context removeFromViews:YES];
[context makeCurrentContext];
if (context)
[context makeCurrentContext];
else
[WineOpenGLContext clearCurrentContext];
if ([currentContext isKindOfClass:[WineOpenGLContext class]])
[currentContext removeFromViews:YES];
}
}