Ken Thomases : winemac: When clearing the OpenGL context, disassociate it from its view.
Alexandre Julliard
julliard at winehq.org
Tue Jan 14 13:44:59 CST 2014
Module: wine
Branch: master
Commit: 18963963306cbb75d409189da8ec2df219850d25
URL: http://source.winehq.org/git/wine.git/?a=commit;h=18963963306cbb75d409189da8ec2df219850d25
Author: Ken Thomases <ken at codeweavers.com>
Date: Tue Jan 14 01:24:57 2014 -0600
winemac: When clearing the OpenGL context, disassociate it from its view.
---
dlls/winemac.drv/cocoa_opengl.m | 41 +++++++++++++++++++++++++++------------
1 file changed, 29 insertions(+), 12 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_opengl.m b/dlls/winemac.drv/cocoa_opengl.m
index f546be5..0b67ed1 100644
--- a/dlls/winemac.drv/cocoa_opengl.m
+++ b/dlls/winemac.drv/cocoa_opengl.m
@@ -90,6 +90,23 @@
}
}
+ - (void) removeFromViews:(BOOL)removeViews
+ {
+ if ([self view])
+ {
+ macdrv_remove_view_opengl_context((macdrv_view)[self view], (macdrv_opengl_context)self);
+ if (removeViews)
+ [self clearDrawableLeavingSurfaceOnScreen];
+ }
+ if ([self latentView])
+ {
+ macdrv_remove_view_opengl_context((macdrv_view)[self latentView], (macdrv_opengl_context)self);
+ if (removeViews)
+ [self setLatentView:nil];
+ }
+ needsUpdate = FALSE;
+ }
+
@end
@@ -122,11 +139,7 @@ void macdrv_dispose_opengl_context(macdrv_opengl_context c)
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
WineOpenGLContext *context = (WineOpenGLContext*)c;
- if ([context view])
- macdrv_remove_view_opengl_context((macdrv_view)[context view], c);
- if ([context latentView])
- macdrv_remove_view_opengl_context((macdrv_view)[context latentView], c);
- [context clearDrawableLeavingSurfaceOnScreen];
+ [context removeFromViews:YES];
[context release];
[pool release];
@@ -143,11 +156,7 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
if (context)
{
- if ([context view])
- macdrv_remove_view_opengl_context((macdrv_view)[context view], c);
- if ([context latentView])
- macdrv_remove_view_opengl_context((macdrv_view)[context latentView], c);
- context.needsUpdate = FALSE;
+ [context removeFromViews:NO];
if (view)
{
macdrv_add_view_opengl_context(v, c);
@@ -169,11 +178,19 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
else
{
[WineOpenGLContext clearCurrentContext];
- [context clearDrawableLeavingSurfaceOnScreen];
+ [context removeFromViews:YES];
}
}
else
- [WineOpenGLContext clearCurrentContext];
+ {
+ WineOpenGLContext* currentContext = (WineOpenGLContext*)[WineOpenGLContext currentContext];
+
+ if ([currentContext isKindOfClass:[WineOpenGLContext class]])
+ {
+ [WineOpenGLContext clearCurrentContext];
+ [currentContext removeFromViews:YES];
+ }
+ }
[pool release];
}
More information about the wine-cvs
mailing list