cocoawindow: fix wrong content scale with ANGLE EGL context
ANGLE expects that the surface layer content scale is updated
accordingly.
<b406401e42/src/libANGLE/renderer/metal/SurfaceMtl.mm (L597-L636)>
This commit is contained in:
committed by
Sam Lantinga
parent
a36ef1f187
commit
ef41e0a0f0
@@ -1375,6 +1375,8 @@ static NSCursor *Cocoa_GetDesiredCursor(void)
|
|||||||
|
|
||||||
- (void)windowDidChangeBackingProperties:(NSNotification *)aNotification
|
- (void)windowDidChangeBackingProperties:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
|
SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)_data.window->internal;
|
||||||
|
NSView *contentView = windata.sdlContentView;
|
||||||
NSNumber *oldscale = [[aNotification userInfo] objectForKey:NSBackingPropertyOldScaleFactorKey];
|
NSNumber *oldscale = [[aNotification userInfo] objectForKey:NSBackingPropertyOldScaleFactorKey];
|
||||||
|
|
||||||
if (inFullscreenTransition) {
|
if (inFullscreenTransition) {
|
||||||
@@ -1382,6 +1384,9 @@ static NSCursor *Cocoa_GetDesiredCursor(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ([oldscale doubleValue] != [_data.nswindow backingScaleFactor]) {
|
if ([oldscale doubleValue] != [_data.nswindow backingScaleFactor]) {
|
||||||
|
// Update the content scale on the window layer
|
||||||
|
// This is required to keep content scale in sync with ANGLE
|
||||||
|
contentView.layer.contentsScale = [_data.nswindow backingScaleFactor];
|
||||||
// Send a resize event when the backing scale factor changes.
|
// Send a resize event when the backing scale factor changes.
|
||||||
[self windowDidResize:aNotification];
|
[self windowDidResize:aNotification];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user