Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/winemac.drv/cocoa_window.m | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index d5434b8a966..bc06a9506ee 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -311,6 +311,16 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi @end
+#ifndef MAC_OS_X_VERSION_10_14 +@protocol NSViewLayerContentScaleDelegate <NSObject> +@optional + + - (BOOL) layer:(CALayer*)layer shouldInheritContentsScale:(CGFloat)newScale fromWindow:(NSWindow*)window; + +@end +#endif + + @interface WineBaseView : NSView @end
@@ -327,7 +337,7 @@ - (id) initWithFrame:(NSRect)frame device:(id<MTLDevice>)device; #endif
-@interface WineContentView : WineBaseView <NSTextInputClient> +@interface WineContentView : WineBaseView <NSTextInputClient, NSViewLayerContentScaleDelegate> { NSMutableArray* glContexts; NSMutableArray* pendingGlContexts; @@ -339,6 +349,7 @@ @interface WineContentView : WineBaseView <NSTextInputClient> NSMutableAttributedString* markedText; NSRange markedTextSelection;
+ BOOL _retinaMode; int backingSize[2];
#ifdef HAVE_METAL_METAL_H @@ -688,9 +699,15 @@ - (void) setRetinaMode:(int)mode [self setWantsBestResolutionOpenGLSurface:mode]; [self updateGLContexts];
+ _retinaMode = !!mode; [super setRetinaMode:mode]; }
+ - (BOOL) layer:(CALayer*)layer shouldInheritContentsScale:(CGFloat)newScale fromWindow:(NSWindow*)window + { + return (_retinaMode || newScale == 1.0); + } + - (void) viewDidHide { [super viewDidHide]; @@ -1002,6 +1019,7 @@ + (WineWindow*) createWindowWithFeatures:(const struct macdrv_window_features*)w contentView = [[[WineContentView alloc] initWithFrame:NSZeroRect] autorelease]; if (!contentView) return nil; + [contentView setWantsLayer:YES]; [contentView setAutoresizesSubviews:NO];
/* We use tracking areas in addition to setAcceptsMouseMovedEvents:YES @@ -3576,6 +3594,7 @@ macdrv_view macdrv_create_view(CGRect rect) NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
view = [[WineContentView alloc] initWithFrame:NSRectFromCGRect(cgrect_mac_from_win(rect))]; + [view setWantsLayer:YES]; [view setAutoresizesSubviews:NO]; [view setAutoresizingMask:NSViewNotSizable]; [view setHidden:YES];
Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/winemac.drv/cocoa_window.h | 2 - dlls/winemac.drv/cocoa_window.m | 89 ++++++++++++++++----------------- 2 files changed, 44 insertions(+), 47 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.h b/dlls/winemac.drv/cocoa_window.h index f9c3902dc36..d04961f8251 100644 --- a/dlls/winemac.drv/cocoa_window.h +++ b/dlls/winemac.drv/cocoa_window.h @@ -51,8 +51,6 @@ @interface WineWindow : NSPanel <NSWindowDelegate> NSRect wineFrame; NSRect roundedWineFrame;
- NSBezierPath* shape; - NSData* shapeData; BOOL shapeChangedSinceLastDraw;
BOOL colorKeyed; diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index bc06a9506ee..4d7aa570552 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -321,6 +321,22 @@ - (BOOL) layer:(CALayer*)layer shouldInheritContentsScale:(CGFloat)newScale from #endif
+@interface CAShapeLayer (WineShapeMaskExtensions) + +@property(readonly, nonatomic, getter=isEmptyShaped) BOOL emptyShaped; + +@end + +@implementation CAShapeLayer (WineShapeMaskExtensions) + + - (BOOL) isEmptyShaped + { + return CGRectEqualToRect(CGPathGetBoundingBox(self.path), CGRectZero); + } + +@end + + @interface WineBaseView : NSView @end
@@ -388,8 +404,6 @@ @interface WineWindow () @property (nonatomic) void* surface; @property (nonatomic) pthread_mutex_t* surface_mutex;
-@property (copy, nonatomic) NSBezierPath* shape; -@property (copy, nonatomic) NSData* shapeData; @property (nonatomic) BOOL shapeChangedSinceLastDraw; @property (readonly, nonatomic) BOOL needsTransparency;
@@ -402,6 +416,8 @@ @interface WineWindow ()
@property (readonly, copy, nonatomic) NSArray* childWineWindows;
+ - (void) setShape:(CGPathRef)newShape; + - (void) updateForGLSubviews;
- (BOOL) becameEligibleParentOrChild; @@ -494,17 +510,6 @@ - (void) drawRect:(NSRect)rect if ([window contentView] != self) return;
- if (window.drawnSinceShown && window.shapeChangedSinceLastDraw && window.shape && !window.colorKeyed && !window.usePerPixelAlpha) - { - [[NSColor clearColor] setFill]; - NSRectFill(rect); - - [window.shape addClip]; - - [[NSColor windowBackgroundColor] setFill]; - NSRectFill(rect); - } - if (window.surface && window.surface_mutex && !pthread_mutex_lock(window.surface_mutex)) { @@ -517,8 +522,6 @@ - (void) drawRect:(NSRect)rect CGContextRef context; int i;
- [window.shape addClip]; - context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; CGContextSetBlendMode(context, kCGBlendModeCopy); CGContextSetInterpolationQuality(context, retina_on ? kCGInterpolationHigh : kCGInterpolationNone); @@ -968,7 +971,7 @@ @implementation WineWindow @synthesize disabled, noActivate, floating, fullscreen, fakingClose, latentParentWindow, hwnd, queue; @synthesize drawnSinceShown; @synthesize surface, surface_mutex; - @synthesize shape, shapeData, shapeChangedSinceLastDraw; + @synthesize shapeChangedSinceLastDraw; @synthesize colorKeyed, colorKeyRed, colorKeyGreen, colorKeyBlue; @synthesize usePerPixelAlpha; @synthesize imeData, commandDone; @@ -1069,8 +1072,6 @@ - (void) dealloc [queue release]; [latentChildWindows release]; [latentParentWindow release]; - [shape release]; - [shapeData release]; [super dealloc]; }
@@ -2013,7 +2014,7 @@ - (void) setDisabled:(BOOL)newValue
- (BOOL) needsTransparency { - return self.shape || self.colorKeyed || self.usePerPixelAlpha || + return self.contentView.layer.mask || self.colorKeyed || self.usePerPixelAlpha || (gl_surface_mode == GL_SURFACE_BEHIND && [(WineContentView*)self.contentView hasGLDescendant]); }
@@ -2035,22 +2036,27 @@ - (void) checkTransparency } }
- - (void) setShape:(NSBezierPath*)newShape + - (void) setShape:(CGPathRef)newShape { - if (shape == newShape) return; + CALayer* layer = [[self contentView] layer]; + CAShapeLayer* mask = layer.mask; + if (CGPathEqualToPath(newShape, mask.path)) return;
- if (shape) - { - [[self contentView] setNeedsDisplayInRect:[shape bounds]]; - [shape release]; - } + if (newShape && !layer.mask) + layer.mask = mask = [CAShapeLayer layer]; + else if (!newShape) + layer.mask = mask = nil; + + if (mask.path) + [[self contentView] setNeedsDisplayInRect:NSRectFromCGRect(CGPathGetBoundingBox(mask.path))]; if (newShape) - [[self contentView] setNeedsDisplayInRect:[newShape bounds]]; + [[self contentView] setNeedsDisplayInRect:NSRectFromCGRect(CGPathGetBoundingBox(newShape))];
- shape = [newShape copy]; + mask.path = newShape; self.shapeChangedSinceLastDraw = TRUE;
[self checkTransparency]; + [self checkEmptyShaped]; }
- (void) makeFocused:(BOOL)activate @@ -2247,7 +2253,7 @@ - (void) checkWineDisplayLink
- (BOOL) isEmptyShaped { - return (self.shapeData.length == sizeof(CGRectZero) && !memcmp(self.shapeData.bytes, &CGRectZero, sizeof(CGRectZero))); + return ([[[self contentView] layer].mask isEmptyShaped]); }
- (BOOL) canProvideSnapshot @@ -2650,8 +2656,7 @@ - (void) setRetinaMode:(int)mode
[transform scaleBy:scale];
- if (shape) - [shape transformUsingAffineTransform:transform]; + [[self contentView] layer].mask.contentsScale = mode ? 2.0 : 1.0;
for (WineBaseView* subview in [self.contentView subviews]) { @@ -3456,25 +3461,19 @@ void macdrv_set_window_shape(macdrv_window w, const CGRect *rects, int count) OnMainThread(^{ if (!rects || !count) { - window.shape = nil; - window.shapeData = nil; + [window setShape:NULL]; [window checkEmptyShaped]; } else { - size_t length = sizeof(*rects) * count; - if (window.shapeData.length != length || memcmp(window.shapeData.bytes, rects, length)) - { - NSBezierPath* path; - unsigned int i; + CGMutablePathRef path; + unsigned int i;
- path = [NSBezierPath bezierPath]; - for (i = 0; i < count; i++) - [path appendBezierPathWithRect:NSRectFromCGRect(cgrect_mac_from_win(rects[i]))]; - window.shape = path; - window.shapeData = [NSData dataWithBytes:rects length:length]; - [window checkEmptyShaped]; - } + path = CGPathCreateMutable(); + for (i = 0; i < count; i++) + CGPathAddRect(path, NULL, cgrect_mac_from_win(rects[i])); + [window setShape:path]; + CGPathRelease(path); } });
One of my goals with this series is getting rid of the -drawRect: method. We shouldn't need it after we start setting surface contents directly to layers.
Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/winemac.drv/cocoa_window.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 4d7aa570552..3eb8ec20877 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -491,9 +491,9 @@ - (BOOL) isFlipped return YES; }
- - (void) drawRect:(NSRect)rect + - (void) viewWillDraw { - WineWindow* window = (WineWindow*)[self window]; + [super viewWillDraw];
for (WineOpenGLContext* context in pendingGlContexts) { @@ -506,6 +506,11 @@ - (void) drawRect:(NSRect)rect } [glContexts addObjectsFromArray:pendingGlContexts]; [pendingGlContexts removeAllObjects]; + } + + - (void) drawRect:(NSRect)rect + { + WineWindow* window = (WineWindow*)[self window];
if ([window contentView] != self) return;
Use a top-down DIB for the surface instead of a bottom-up DIB. This seems to match better with how Core Graphics expects to receive image data, and allows us to avoid a transform to flip the surface image. Unfortunately, it requires us to use a transform to flip the image in the -drawRect: path. We'll be getting rid of that in the next patch, though.
Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/winemac.drv/cocoa_window.m | 86 ++++++++++++++++++++++++++------- dlls/winemac.drv/macdrv_cocoa.h | 3 +- dlls/winemac.drv/surface.c | 42 +++++++++++----- 3 files changed, 101 insertions(+), 30 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 3eb8ec20877..75fc26bbcf8 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -491,6 +491,54 @@ - (BOOL) isFlipped return YES; }
+ - (BOOL) wantsUpdateLayer + { + return YES /*!_everHadGLContext*/; + } + + - (void) updateLayer + { + WineWindow* window = (WineWindow*)[self window]; + CGImageRef image = NULL; + CGRect imageRect; + CALayer* layer = [self layer]; + + if ([window contentView] != self) + return; + + if (!window.surface || !window.surface_mutex) + return; + + pthread_mutex_lock(window.surface_mutex); + if (get_surface_blit_rects(window.surface, NULL, NULL)) + { + imageRect = layer.bounds; + imageRect.origin.x *= layer.contentsScale; + imageRect.origin.y *= layer.contentsScale; + imageRect.size.width *= layer.contentsScale; + imageRect.size.height *= layer.contentsScale; + image = create_surface_image(window.surface, &imageRect, FALSE, window.colorKeyed, + window.colorKeyRed, window.colorKeyGreen, window.colorKeyBlue); + } + pthread_mutex_unlock(window.surface_mutex); + + if (image) + { + layer.contents = (id)image; + CFRelease(image); + [window windowDidDrawContent]; + + // If the window may be transparent, then we have to invalidate the + // shadow every time we draw. Also, if this is the first time we've + // drawn since changing from transparent to opaque. + if (window.colorKeyed || window.usePerPixelAlpha || window.shapeChangedSinceLastDraw) + { + window.shapeChangedSinceLastDraw = FALSE; + [window invalidateShadow]; + } + } + } + - (void) viewWillDraw { [super viewWillDraw]; @@ -521,12 +569,17 @@ - (void) drawRect:(NSRect)rect const CGRect* rects; int count;
- if (get_surface_blit_rects(window.surface, &rects, &count) && count) + if (get_surface_blit_rects(window.surface, &rects, &count)) { CGRect dirtyRect = cgrect_win_from_mac(NSRectToCGRect(rect)); + NSAffineTransform* xform = [NSAffineTransform transform]; CGContextRef context; int i;
+ [xform translateXBy:0.0 yBy:self.bounds.size.height]; + [xform scaleXBy:1.0 yBy:-1.0]; + [xform concat]; + context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; CGContextSetBlendMode(context, kCGBlendModeCopy); CGContextSetInterpolationQuality(context, retina_on ? kCGInterpolationHigh : kCGInterpolationNone); @@ -537,25 +590,15 @@ - (void) drawRect:(NSRect)rect CGImageRef image;
imageRect = CGRectIntersection(rects[i], dirtyRect); - image = create_surface_image(window.surface, &imageRect, FALSE); + image = create_surface_image(window.surface, &imageRect, FALSE, window.colorKeyed, + window.colorKeyRed, window.colorKeyGreen, window.colorKeyBlue);
if (image) { - if (window.colorKeyed) - { - CGImageRef maskedImage; - CGFloat components[] = { window.colorKeyRed - 0.5, window.colorKeyRed + 0.5, - window.colorKeyGreen - 0.5, window.colorKeyGreen + 0.5, - window.colorKeyBlue - 0.5, window.colorKeyBlue + 0.5 }; - maskedImage = CGImageCreateWithMaskingColors(image, components); - if (maskedImage) - { - CGImageRelease(image); - image = maskedImage; - } - } - - CGContextDrawImage(context, cgrect_mac_from_win(imageRect), image); + // Account for the flipped coordinate system. + imageRect = cgrect_mac_from_win(imageRect); + imageRect.origin.y = self.bounds.size.height - imageRect.origin.y - imageRect.size.height; + CGContextDrawImage(context, imageRect, image);
CGImageRelease(image); } @@ -708,6 +751,9 @@ - (void) setRetinaMode:(int)mode [self updateGLContexts];
_retinaMode = !!mode; + [self layer].contentsScale = mode ? 2.0 : 1.0; + [self layer].minificationFilter = mode ? kCAFilterLinear : kCAFilterNearest; + [self layer].magnificationFilter = mode ? kCAFilterLinear : kCAFilterNearest; [super setRetinaMode:mode]; }
@@ -1028,6 +1074,9 @@ + (WineWindow*) createWindowWithFeatures:(const struct macdrv_window_features*)w if (!contentView) return nil; [contentView setWantsLayer:YES]; + [contentView layer].minificationFilter = retina_on ? kCAFilterLinear : kCAFilterNearest; + [contentView layer].magnificationFilter = retina_on ? kCAFilterLinear : kCAFilterNearest; + [contentView layer].contentsScale = retina_on ? 2.0 : 1.0; [contentView setAutoresizesSubviews:NO];
/* We use tracking areas in addition to setAcceptsMouseMovedEvents:YES @@ -3599,6 +3648,9 @@ macdrv_view macdrv_create_view(CGRect rect)
view = [[WineContentView alloc] initWithFrame:NSRectFromCGRect(cgrect_mac_from_win(rect))]; [view setWantsLayer:YES]; + [view layer].minificationFilter = retina_on ? kCAFilterLinear : kCAFilterNearest; + [view layer].magnificationFilter = retina_on ? kCAFilterLinear : kCAFilterNearest; + [view layer].contentsScale = retina_on ? 2.0 : 1.0; [view setAutoresizesSubviews:NO]; [view setAutoresizingMask:NSViewNotSizable]; [view setHidden:YES]; diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h index b02ad79f025..47ae6627b9f 100644 --- a/dlls/winemac.drv/macdrv_cocoa.h +++ b/dlls/winemac.drv/macdrv_cocoa.h @@ -566,7 +566,8 @@ extern void macdrv_order_cocoa_window(macdrv_window w, macdrv_window prev, extern void macdrv_get_cocoa_window_frame(macdrv_window w, CGRect* out_frame) DECLSPEC_HIDDEN; extern void macdrv_set_cocoa_parent_window(macdrv_window w, macdrv_window parent) DECLSPEC_HIDDEN; extern void macdrv_set_window_surface(macdrv_window w, void *surface, pthread_mutex_t *mutex) DECLSPEC_HIDDEN; -extern CGImageRef create_surface_image(void *window_surface, CGRect *rect, int copy_data) DECLSPEC_HIDDEN; +extern CGImageRef create_surface_image(void *window_surface, CGRect *rect, int copy_data, int color_keyed, + CGFloat key_red, CGFloat key_green, CGFloat key_blue) DECLSPEC_HIDDEN; extern int get_surface_blit_rects(void *window_surface, const CGRect **rects, int *count) DECLSPEC_HIDDEN; extern void macdrv_window_needs_display(macdrv_window w, CGRect rect) DECLSPEC_HIDDEN; extern void macdrv_set_window_shape(macdrv_window w, const CGRect *rects, int count) DECLSPEC_HIDDEN; diff --git a/dlls/winemac.drv/surface.c b/dlls/winemac.drv/surface.c index 7be1b6850e0..6a5cd535923 100644 --- a/dlls/winemac.drv/surface.c +++ b/dlls/winemac.drv/surface.c @@ -264,7 +264,7 @@ struct window_surface *create_surface(macdrv_window window, const RECT *rect,
surface->info.bmiHeader.biSize = sizeof(surface->info.bmiHeader); surface->info.bmiHeader.biWidth = width; - surface->info.bmiHeader.biHeight = height; /* bottom-up */ + surface->info.bmiHeader.biHeight = -height; /* top-down */ surface->info.bmiHeader.biPlanes = 1; surface->info.bmiHeader.biBitCount = 32; surface->info.bmiHeader.biSizeImage = get_dib_image_size(&surface->info); @@ -342,18 +342,21 @@ int get_surface_blit_rects(void *window_surface, const CGRect **rects, int *coun { struct macdrv_window_surface *surface = get_mac_surface(window_surface);
- if (surface->blit_data) + if (rects && count) { - *rects = (const CGRect*)surface->blit_data->Buffer; - *count = surface->blit_data->rdh.nCount; - } - else - { - *rects = NULL; - *count = 0; + if (surface->blit_data) + { + *rects = (const CGRect*)surface->blit_data->Buffer; + *count = surface->blit_data->rdh.nCount; + } + else + { + *rects = NULL; + *count = 0; + } }
- return (surface->blit_data != NULL); + return (surface->blit_data != NULL && surface->blit_data->rdh.nCount > 0); }
/*********************************************************************** @@ -371,7 +374,8 @@ int get_surface_blit_rects(void *window_surface, const CGRect **rects, int *coun * must not use Win32 or Wine functions, including debug * logging. */ -CGImageRef create_surface_image(void *window_surface, CGRect *rect, int copy_data) +CGImageRef create_surface_image(void *window_surface, CGRect *rect, int copy_data, int color_keyed, + CGFloat key_red, CGFloat key_green, CGFloat key_blue) { CGImageRef cgimage = NULL; struct macdrv_window_surface *surface = get_mac_surface(window_surface); @@ -392,7 +396,7 @@ CGImageRef create_surface_image(void *window_surface, CGRect *rect, int copy_dat
colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); bytes_per_row = get_dib_stride(width, 32); - offset = CGRectGetMinX(visrect) * 4 + (height - CGRectGetMaxY(visrect)) * bytes_per_row; + offset = CGRectGetMinX(visrect) * 4 + CGRectGetMinY(visrect) * bytes_per_row; size = min(CGRectGetHeight(visrect) * bytes_per_row, surface->info.bmiHeader.biSizeImage - offset);
@@ -412,6 +416,20 @@ CGImageRef create_surface_image(void *window_surface, CGRect *rect, int copy_dat provider, NULL, retina_on, kCGRenderingIntentDefault); CGDataProviderRelease(provider); CGColorSpaceRelease(colorspace); + + if (color_keyed) + { + CGImageRef maskedImage; + CGFloat components[] = { key_red - 0.5, key_red + 0.5, + key_green - 0.5, key_green + 0.5, + key_blue - 0.5, key_blue + 0.5 }; + maskedImage = CGImageCreateWithMaskingColors(cgimage, components); + if (maskedImage) + { + CGImageRelease(cgimage); + cgimage = maskedImage; + } + } }
return cgimage;
Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/winemac.drv/cocoa_window.m | 64 --------------------------------- 1 file changed, 64 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 75fc26bbcf8..f30ea0284a1 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -556,70 +556,6 @@ - (void) viewWillDraw [pendingGlContexts removeAllObjects]; }
- - (void) drawRect:(NSRect)rect - { - WineWindow* window = (WineWindow*)[self window]; - - if ([window contentView] != self) - return; - - if (window.surface && window.surface_mutex && - !pthread_mutex_lock(window.surface_mutex)) - { - const CGRect* rects; - int count; - - if (get_surface_blit_rects(window.surface, &rects, &count)) - { - CGRect dirtyRect = cgrect_win_from_mac(NSRectToCGRect(rect)); - NSAffineTransform* xform = [NSAffineTransform transform]; - CGContextRef context; - int i; - - [xform translateXBy:0.0 yBy:self.bounds.size.height]; - [xform scaleXBy:1.0 yBy:-1.0]; - [xform concat]; - - context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; - CGContextSetBlendMode(context, kCGBlendModeCopy); - CGContextSetInterpolationQuality(context, retina_on ? kCGInterpolationHigh : kCGInterpolationNone); - - for (i = 0; i < count; i++) - { - CGRect imageRect; - CGImageRef image; - - imageRect = CGRectIntersection(rects[i], dirtyRect); - image = create_surface_image(window.surface, &imageRect, FALSE, window.colorKeyed, - window.colorKeyRed, window.colorKeyGreen, window.colorKeyBlue); - - if (image) - { - // Account for the flipped coordinate system. - imageRect = cgrect_mac_from_win(imageRect); - imageRect.origin.y = self.bounds.size.height - imageRect.origin.y - imageRect.size.height; - CGContextDrawImage(context, imageRect, image); - - CGImageRelease(image); - } - } - - [window windowDidDrawContent]; - } - - pthread_mutex_unlock(window.surface_mutex); - } - - // If the window may be transparent, then we have to invalidate the - // shadow every time we draw. Also, if this is the first time we've - // drawn since changing from transparent to opaque. - if (window.drawnSinceShown && (window.colorKeyed || window.usePerPixelAlpha || window.shapeChangedSinceLastDraw)) - { - window.shapeChangedSinceLastDraw = FALSE; - [window invalidateShadow]; - } - } - - (void) addGLContext:(WineOpenGLContext*)context { BOOL hadContext = _everHadGLContext;
On Tue, Aug 31, 2021 at 05:27:34PM -0500, Chip Davis wrote:
Signed-off-by: Chip Davis cdavis@codeweavers.com
dlls/winemac.drv/cocoa_window.h | 2 - dlls/winemac.drv/cocoa_window.m | 89 ++++++++++++++++----------------- 2 files changed, 44 insertions(+), 47 deletions(-)
This is producing some (additional) warnings on macOS 10.13:
gcc -m32 -c -o dlls/winemac.drv/cocoa_window.o dlls/winemac.drv/cocoa_window.m -Idlls/winemac.drv -Iinclude -D__WINESRC__ \ -D_REENTRANT -fPIC -fasynchronous-unwind-tables -Wall -pipe -fno-stack-protector \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self \ -Wno-pragma-pack -Wstrict-prototypes -Wtype-limits -Wvla -Wwrite-strings -Wpointer-arith -gdwarf-2 \ -gstrict-dwarf -fno-omit-frame-pointer -O2 -g -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 dlls/winemac.drv/cocoa_window.m:2040:23: warning: incompatible pointer types initializing 'CAShapeLayer *' with an expression of type 'CALayer * _Nullable' [-Wincompatible-pointer-types] CAShapeLayer* mask = layer.mask; ^ ~~~~~~~~~~ dlls/winemac.drv/cocoa_window.m:2254:50: warning: 'CALayer' may not respond to 'isEmptyShaped' return ([[[self contentView] layer].mask isEmptyShaped]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
Huw.
September 1, 2021 4:45 AM, "Huw Davies" huw@codeweavers.com wrote:
On Tue, Aug 31, 2021 at 05:27:34PM -0500, Chip Davis wrote:
Signed-off-by: Chip Davis cdavis@codeweavers.com
dlls/winemac.drv/cocoa_window.h | 2 - dlls/winemac.drv/cocoa_window.m | 89 ++++++++++++++++----------------- 2 files changed, 44 insertions(+), 47 deletions(-)
This is producing some (additional) warnings on macOS 10.13:
gcc -m32 -c -o dlls/winemac.drv/cocoa_window.o dlls/winemac.drv/cocoa_window.m -Idlls/winemac.drv -Iinclude -D__WINESRC__ \ -D_REENTRANT -fPIC -fasynchronous-unwind-tables -Wall -pipe -fno-stack-protector \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self \ -Wno-pragma-pack -Wstrict-prototypes -Wtype-limits -Wvla -Wwrite-strings -Wpointer-arith -gdwarf-2 \ -gstrict-dwarf -fno-omit-frame-pointer -O2 -g -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 dlls/winemac.drv/cocoa_window.m:2040:23: warning: incompatible pointer types initializing 'CAShapeLayer *' with an expression of type 'CALayer * _Nullable' [-Wincompatible-pointer-types] CAShapeLayer* mask = layer.mask; ^ ~~~~~~~~~~ dlls/winemac.drv/cocoa_window.m:2254:50: warning: 'CALayer' may not respond to 'isEmptyShaped' return ([[[self contentView] layer].mask isEmptyShaped]);
Huh. I guess the 10.13 SDK doesn't have __kindof there. I'll resend.
Chip
Ugh. Don't know how the patchset summary was lost. It's supposed to say something to the effect of:
This patchset enables layer-backed views for the macOS graphics driver, and sets the drawn bits directly into the layer. We are able to do this now, because the minimum version is now 10.8. It is my hope that this will ease the implementation of full Retina support as well as drawing to other processes' windows.
August 31, 2021 6:03 PM, "Chip Davis" cdavis@codeweavers.com wrote:
Chip
Would dropping OSX 10.10 and below help?
As mentioned prior it’s currently a PITA to compile wine on those versions of OSX.
On Tue, Aug 31, 2021 at 7:08 PM Chip Davis cdavis@codeweavers.com wrote:
Ugh. Don't know how the patchset summary was lost. It's supposed to say something to the effect of:
This patchset enables layer-backed views for the macOS graphics driver, and sets the drawn bits directly into the layer. We are able to do this now, because the minimum version is now 10.8. It is my hope that this will ease the implementation of full Retina support as well as drawing to other processes' windows.
August 31, 2021 6:03 PM, "Chip Davis" cdavis@codeweavers.com wrote:
Chip
August 31, 2021 7:20 PM, "Dean Greer" <gcenx83@gmail.com (mailto:gcenx83@gmail.com?to=%22Dean%20Greer%22%20gcenx83@gmail.com)> wrote: Would dropping OSX 10.10 and below help?No. The stuff we need for both Retina support and other process drawing is in 10.7. On Tue, Aug 31, 2021 at 7:08 PM Chip Davis <cdavis@codeweavers.com (mailto:cdavis@codeweavers.com)> wrote:Ugh. Don't know how the patchset summary was lost. It's supposed to say something to the effect of:
This patchset enables layer-backed views for the macOS graphics driver, and sets the drawn bits directly into the layer. We are able to do this now, because the minimum version is now 10.8. It is my hope that this will ease the implementation of full Retina support as well as drawing to other processes' windows.
August 31, 2021 6:03 PM, "Chip Davis" <cdavis@codeweavers.com (mailto:cdavis@codeweavers.com)> wrote:
Chip Chip