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 <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ken Thomases 2018-07-14 14:01:37 -05:00 committed by Alexandre Julliard
parent 6cb520476a
commit ed7e057388
1 changed files with 0 additions and 32 deletions

View File

@ -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];
}