Skip to content

Commit

Permalink
metal: contrary to documentation, we need to set the drawableSize exp…
Browse files Browse the repository at this point in the history
…licitly.

Fixes Bugzilla #4149.
  • Loading branch information
icculus committed May 28, 2018
1 parent 8325df2 commit 3d38709
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/video/cocoa/SDL_cocoametalview.m
Expand Up @@ -66,11 +66,10 @@ - (instancetype)initWithFrame:(NSRect)frame
/* Allow resize. */
self.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;

/* Set the desired scale. The default drawableSize of a CAMetalLayer
* is its bounds x its scale so nothing further needs to be done.
*/
/* Set the desired scale. */
((CAMetalLayer *) self.layer).drawableSize = NSSizeToCGSize([self bounds].size);
self.layer.contentsScale = scale;
}
}

return self;
}
Expand Down
4 changes: 2 additions & 2 deletions src/video/uikit/SDL_uikitmetalview.m
Expand Up @@ -49,8 +49,8 @@ - (instancetype)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame])) {
self.tag = METALVIEW_TAG;
/* Set the desired scale. The default drawableSize of a CAMetalLayer
* is its bounds x its scale so nothing further needs to be done. */
/* Set the desired scale. */
((CAMetalLayer *) self.layer).drawableSize = self.bounds.size;
self.layer.contentsScale = scale;
}

Expand Down

0 comments on commit 3d38709

Please sign in to comment.