From bf252b8061d1d3c9358432dd1c9ce44113ff5597 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 1 Sep 2020 21:33:54 -0400 Subject: [PATCH] Fixes sizing of buffers to the current output. --- OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm b/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm index 502e4b31c..da55ca7fa 100644 --- a/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm +++ b/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm @@ -296,15 +296,15 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget; [self setAspectRatio]; @synchronized(self) { - [self updateSizeBuffers]; + [self updateSizeBuffersToSize:size]; } } -- (void)updateSizeBuffers { +- (void)updateSizeBuffersToSize:(CGSize)size { // TODO: consider multisampling here? But it seems like you'd need another level of indirection // in order to maintain an ongoing buffer that supersamples only at the end. - const NSUInteger frameBufferWidth = NSUInteger(_view.drawableSize.width * _view.layer.contentsScale); - const NSUInteger frameBufferHeight = NSUInteger(_view.drawableSize.height * _view.layer.contentsScale); + const NSUInteger frameBufferWidth = NSUInteger(size.width * _view.layer.contentsScale); + const NSUInteger frameBufferHeight = NSUInteger(size.height * _view.layer.contentsScale); // Generate a framebuffer and a stencil. MTLTextureDescriptor *const textureDescriptor = [MTLTextureDescriptor