[PATCH] winemac: Don't change the window's color space.
Ken Thomases
ken at codeweavers.com
Sat Jul 14 14:01:37 CDT 2018
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>
---
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 @@ @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];
}
--
2.10.2
More information about the wine-devel
mailing list