From 5150ce34eff1fc33b0e90d86816ad34866ffd5f0 Mon Sep 17 00:00:00 2001 From: amaitland Date: Thu, 16 Jun 2016 08:14:16 +1000 Subject: [PATCH] Disable GPU on windows 7 https://github.com/cefsharp/CefSharp/issues/1634 --- CefSharp.MinimalExample.OffScreen/Program.cs | 8 ++++++++ CefSharp.MinimalExample.Wpf/App.xaml.cs | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CefSharp.MinimalExample.OffScreen/Program.cs b/CefSharp.MinimalExample.OffScreen/Program.cs index 1acee44..0951b1f 100644 --- a/CefSharp.MinimalExample.OffScreen/Program.cs +++ b/CefSharp.MinimalExample.OffScreen/Program.cs @@ -24,6 +24,14 @@ namespace CefSharp.MinimalExample.OffScreen var settings = new CefSettings(); + var osVersion = Environment.OSVersion; + //Disable GPU for Windows 7 + if (osVersion.Version.Major == 6 && osVersion.Version.Minor == 1) + { + // Disable GPU in WPF and Offscreen examples until #1634 has been resolved + settings.CefCommandLineArgs.Add("disable-gpu", "1"); + } + //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, shutdownOnProcessExit: false, performDependencyCheck: true); diff --git a/CefSharp.MinimalExample.Wpf/App.xaml.cs b/CefSharp.MinimalExample.Wpf/App.xaml.cs index 427bc5b..34a6bf7 100644 --- a/CefSharp.MinimalExample.Wpf/App.xaml.cs +++ b/CefSharp.MinimalExample.Wpf/App.xaml.cs @@ -1,4 +1,5 @@ -using System.Windows; +using System; +using System.Windows; namespace CefSharp.MinimalExample.Wpf { @@ -10,6 +11,14 @@ namespace CefSharp.MinimalExample.Wpf var settings = new CefSettings(); settings.EnableInternalPdfViewerOffScreen(); + var osVersion = Environment.OSVersion; + //Disable GPU for Windows 7 + if (osVersion.Version.Major == 6 && osVersion.Version.Minor == 1) + { + // Disable GPU in WPF and Offscreen examples until #1634 has been resolved + settings.CefCommandLineArgs.Add("disable-gpu", "1"); + } + Cef.Initialize(settings, shutdownOnProcessExit: false, performDependencyCheck: true); } }