cocoa: fix rendering artefacts in retina displays

Set the correct contentsScale in the CALayer instead of using
the default (1.0) which causes rendering artefacts in retina
displays due to using a smaller bitamp than the display size.

See: https://developer.apple.com/documentation/quartzcore/calayer/1410746-contentsscale?language=objc

Fix: #3942
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7828>
This commit is contained in:
Andoni Morales Alastruey 2024-11-05 00:01:56 +01:00 committed by GStreamer Marge Bot
parent 78b5b798d0
commit 5a3dd943fe

View file

@ -746,6 +746,10 @@ close_window_cb (gpointer data)
return NO;
}
- (void)viewDidChangeBackingProperties {
self.layer.contentsScale = [[self window] backingScaleFactor];
}
@end
void