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:
parent
96376059ef
commit
38f579f9ba
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue