[Commits] SDL: metal and moltenvk: fix highdpi.

libsdl.org revision control commits-owner at libsdl.org
Tue Jan 2 17:44:58 PST 2018


details:   https://hg.libsdl.org/SDL/rev/4b858abfb24d
changeset: 11809:4b858abfb24d
user:      Alex Szpakowski <slime73 at gmail.com>
date:      Tue Jan 02 21:44:28 2018 -0400
description:
metal and moltenvk: fix highdpi.

diffstat:

 src/render/metal/SDL_render_metal.m  |  3 ---
 src/video/cocoa/SDL_cocoametalview.m |  7 +++----
 2 files changed, 3 insertions(+), 7 deletions(-)

diffs (40 lines):

diff -r 510c0e047122 -r 4b858abfb24d src/render/metal/SDL_render_metal.m
--- a/src/render/metal/SDL_render_metal.m	Tue Jan 02 19:06:14 2018 -0400
+++ b/src/render/metal/SDL_render_metal.m	Tue Jan 02 21:44:28 2018 -0400
@@ -563,9 +563,6 @@
 METAL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
 { @autoreleasepool {
     METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
-    // !!! FIXME: We shouldn't need ActivateRenderer, but drawableSize is 0
-    // in the first frame without it.
-    METAL_ActivateRenderer(renderer);
     if (w) {
         *w = (int)data.mtllayer.drawableSize.width;
     }
diff -r 510c0e047122 -r 4b858abfb24d src/video/cocoa/SDL_cocoametalview.m
--- a/src/video/cocoa/SDL_cocoametalview.m	Tue Jan 02 19:06:14 2018 -0400
+++ b/src/video/cocoa/SDL_cocoametalview.m	Tue Jan 02 21:44:28 2018 -0400
@@ -61,11 +61,12 @@
                    useHighDPI:(bool)useHighDPI
 {
 	if ((self = [super initWithFrame:frame])) {
-    
+        self.wantsLayer = YES;
+
         /* Allow resize. */
         self.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
         _tag = METALVIEW_TAG;
-      
+
         _useHighDPI = useHighDPI;
         [self updateDrawableSize];
 	}
@@ -100,8 +101,6 @@
     SDL_cocoametalview *metalview
         = [[SDL_cocoametalview alloc] initWithFrame:view.frame
                        useHighDPI:(window->flags & SDL_WINDOW_ALLOW_HIGHDPI)];
-    // Instantiate the CAMetalLayer
-    metalview.wantsLayer = YES;
     [view addSubview:metalview];
     return metalview;
 }


More information about the commits mailing list