Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored platform options #2368

Merged
merged 3 commits into from Mar 22, 2019

Conversation

Projects
None yet
2 participants
@kekekeks
Copy link
Member

kekekeks commented Mar 12, 2019

#2365

Before:

public static AppBuilder BuildAvaloniaApp()
{
    var builder = AppBuilder.Configure<App>();
    if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
         builder.UseX11(new X11PlatformOptions() {UseGpu = false});
    else if(RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
         builder.UseAvaloniaNative(anopts => 
         {
              anopts.UseGpu = false;
              anopts.MacOptions.ShowInDock = 0;
         });
    else if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
          builder.UseWin32(false, true);
    return builder;
}

After:

public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>()
     .UsePlatformDetect()
     .With(new X11PlatformOptions { UseGpu = false })
     .With(new AvaloniaNativePlatformOptions { UseGpu = false })
     .With(new MacOSPlatformOptions { ShowInDock = false })
     .With(new Win32PlatformOptions { UseDeferredRendering = false });

@kekekeks kekekeks requested review from grokys and danwalmsley Mar 12, 2019

@grokys

This comment has been minimized.

Copy link
Member

grokys commented Mar 13, 2019

@kekekeks what you say "Not Tested", what in particular hasn't been tested, i.e. what should I be testing?

@kekekeks

This comment has been minimized.

Copy link
Member Author

kekekeks commented Mar 13, 2019

I haven't actually run the code on OSX/Windows.

@grokys

grokys approved these changes Mar 22, 2019

Copy link
Member

grokys left a comment

LGTM, a big improvement 👍

@grokys grokys merged commit 4da4fef into master Mar 22, 2019

1 of 2 checks passed

Avalonia (Pull Requests) Avalonia (Pull Requests) failed
Details
AvaloniaUI.Avalonia #20190322.4 succeeded
Details

@grokys grokys deleted the platform-options branch Mar 22, 2019

@grokys grokys added this to the 0.8.0 milestone Apr 3, 2019

@grokys grokys changed the title Refactored platform options (not tested) Refactored platform options Apr 5, 2019

@kekekeks kekekeks referenced this pull request Apr 8, 2019

Merged

Allow for modifying Skia PlatformRenderInterface behavior. #2364

0 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.