Ken Thomases : winemac: Don't change the window's color space.
Alexandre Julliard
julliard at winehq.org
Mon Jul 16 14:40:00 CDT 2018
Module: wine
Branch: master
Commit: ed7e0573882d9fd36e47f6178809d5f3726f8c1c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ed7e0573882d9fd36e47f6178809d5f3726f8c1c
Author: Ken Thomases <ken at codeweavers.com>
Date: Sat Jul 14 14:01:37 2018 -0500
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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 4c59faf..4143d14 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -385,7 +385,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
@property (readonly, copy, nonatomic) NSArray* childWineWindows;
- - (void) updateColorSpace;
- (void) updateForGLSubviews;
- (BOOL) becameEligibleParentOrChild;
@@ -968,7 +967,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
[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 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
if (needEnableScreenUpdates)
NSEnableScreenUpdates();
- if (!equalSizes)
- [self updateColorSpace];
-
if (!enteringFullScreen &&
[[NSProcessInfo processInfo] systemUptime] - enteredFullScreenTime > 1.0)
nonFullscreenFrame = frame;
@@ -2601,35 +2596,8 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
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];
}
More information about the wine-cvs
mailing list