Commit 38f579f9 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

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: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 96376059
...@@ -227,17 +227,17 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v) ...@@ -227,17 +227,17 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
{ {
WineOpenGLContext* currentContext = (WineOpenGLContext*)[WineOpenGLContext currentContext]; WineOpenGLContext* currentContext = (WineOpenGLContext*)[WineOpenGLContext currentContext];
if ([currentContext isKindOfClass:[WineOpenGLContext class]]) [context removeFromViews:YES];
{
[WineOpenGLContext clearCurrentContext];
if (currentContext != context)
[currentContext removeFromViews:YES];
}
if (context) if (currentContext != context)
{ {
[context removeFromViews:YES]; if (context)
[context makeCurrentContext]; [context makeCurrentContext];
else
[WineOpenGLContext clearCurrentContext];
if ([currentContext isKindOfClass:[WineOpenGLContext class]])
[currentContext removeFromViews:YES];
} }
} }
......
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