Browse Source

[OSX] remove most of the stretching and flickering by calling updateLayer at the end of resize.

pull/5082/head
Dan Walmsley 5 years ago
parent
commit
89b5d13408
  1. 6
      native/Avalonia.Native/src/OSX/rendertarget.mm

6
native/Avalonia.Native/src/OSX/rendertarget.mm

@ -143,13 +143,17 @@ static IAvnGlSurfaceRenderTarget* CreateGlRenderTarget(IOSurfaceRenderTarget* ta
return _layer;
}
- (void)resize:(AvnPixelSize)size withScale: (float) scale;{
- (void)resize:(AvnPixelSize)size withScale: (float) scale{
@synchronized (lock) {
if(surface == nil
|| surface->size.Width != size.Width
|| surface->size.Height != size.Height
|| surface->scale != scale)
{
surface = [[IOSurfaceHolder alloc] initWithSize:size withScale:scale withOpenGlContext:_glContext.getRaw()];
[self updateLayer];
}
}
}

Loading…
Cancel
Save