From ed7e0573882d9fd36e47f6178809d5f3726f8c1c Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Sat, 14 Jul 2018 14:01:37 -0500 Subject: [PATCH] winemac: Don't change the window's color space. This was originally done to improve performance at the expense of visually- correct rendering. I've reconsidered that trade-off. Signed-off-by: Ken Thomases Signed-off-by: Alexandre Julliard --- dlls/winemac.drv/cocoa_window.m | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 4c59faf1f4b..4143d147dfc 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -385,7 +385,6 @@ @interface WineWindow () @property (readonly, copy, nonatomic) NSArray* childWineWindows; - - (void) updateColorSpace; - (void) updateForGLSubviews; - (BOOL) becameEligibleParentOrChild; @@ -968,7 +967,6 @@ + (WineWindow*) createWindowWithFeatures:(const struct macdrv_window_features*)w [window setShowsResizeIndicator:NO]; [window setHasShadow:wf->shadow]; [window setAcceptsMouseMovedEvents:YES]; - [window setColorSpace:[NSColorSpace genericRGBColorSpace]]; [window setDelegate:window]; [window setBackgroundColor:[NSColor clearColor]]; [window setOpaque:NO]; @@ -1927,9 +1925,6 @@ - (void) setFrameFromWine:(NSRect)contentRect if (needEnableScreenUpdates) NSEnableScreenUpdates(); - if (!equalSizes) - [self updateColorSpace]; - if (!enteringFullScreen && [[NSProcessInfo processInfo] systemUptime] - enteredFullScreenTime > 1.0) nonFullscreenFrame = frame; @@ -2601,35 +2596,8 @@ - (NSArray*) childWineWindows return [childWindows objectsAtIndexes:indexes]; } - // We normally use the generic/calibrated RGB color space for the window, - // rather than the device color space, to avoid expensive color conversion - // which slows down drawing. However, for windows displaying OpenGL, having - // a different color space than the screen greatly reduces frame rates, often - // limiting it to the display refresh rate. - // - // To avoid this, we switch back to the screen color space whenever the - // window is covered by a view with an attached OpenGL context. - - (void) updateColorSpace - { - NSRect contentRect = [[self contentView] frame]; - BOOL coveredByGLView = FALSE; - WineContentView* view = (WineContentView*)[[self contentView] hitTest:NSMakePoint(NSMidX(contentRect), NSMidY(contentRect))]; - if ([view isKindOfClass:[WineContentView class]] && view.everHadGLContext) - { - NSRect frame = [view convertRect:[view bounds] toView:nil]; - if (NSContainsRect(frame, contentRect)) - coveredByGLView = TRUE; - } - - if (coveredByGLView) - [self setColorSpace:nil]; - else - [self setColorSpace:[NSColorSpace genericRGBColorSpace]]; - } - - (void) updateForGLSubviews { - [self updateColorSpace]; if (gl_surface_mode == GL_SURFACE_BEHIND) [self checkTransparency]; }