Skip to content
Permalink
Browse files

metal: contrary to documentation, we need to set the drawableSize exp…

…licitly.

Fixes Bugzilla #4149.
  • Loading branch information
icculus committed May 28, 2018
1 parent 8325df2 commit 3d3870982c9ab19fa2cf9cf2334a45df26304a9a
Showing with 5 additions and 6 deletions.
  1. +3 −4 src/video/cocoa/SDL_cocoametalview.m
  2. +2 −2 src/video/uikit/SDL_uikitmetalview.m
@@ -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;
}
@@ -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;
}

0 comments on commit 3d38709

Please sign in to comment.