Skip to content

Commit 7306d43

Browse files
committed
WPF/OffScreen - Update SetOffScreenRenderingBestPerformanceArgs to match upstream args
Resolves #4915
1 parent ac42ae7 commit 7306d43

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

CefSharp.Core/CefSettingsBase.cs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,18 @@ public void EnablePrintPreview()
390390
}
391391

392392
/// <summary>
393-
/// Set command line arguments for best OSR (Offscreen and WPF) Rendering performance Software Rendering will be used for WebGL, look at the source
394-
/// to determine which flags best suite your requirements.
393+
/// Use software rendering and compositing (disable GPU) for increased FPS
394+
/// and decreased CPU usage. This will also disable WebGL so don't use this
395+
/// method if you need that capability.
395396
/// </summary>
397+
/// <remarks>
398+
/// Sets the --disable-gpu and --disable-gpu-compositing command line args
399+
/// </remarks>
396400
public void SetOffScreenRenderingBestPerformanceArgs()
397401
{
398402
// Use software rendering and compositing (disable GPU) for increased FPS
399-
// and decreased CPU usage.
403+
// and decreased CPU usage. This will also disable WebGL so remove these
404+
// switches if you need that capability.
400405
// See https://github.com/chromiumembedded/cef/issues/1257 for details.
401406
if (!settings.CefCommandLineArgs.ContainsKey("disable-gpu"))
402407
{
@@ -407,18 +412,6 @@ public void SetOffScreenRenderingBestPerformanceArgs()
407412
{
408413
settings.CefCommandLineArgs.Add("disable-gpu-compositing");
409414
}
410-
411-
// Synchronize the frame rate between all processes. This results in
412-
// decreased CPU usage by avoiding the generation of extra frames that
413-
// would otherwise be discarded. The frame rate can be set at browser
414-
// creation time via IBrowserSettings.WindowlessFrameRate or changed
415-
// dynamically using IBrowserHost.SetWindowlessFrameRate. In cefclient
416-
// it can be set via the command-line using `--off-screen-frame-rate=XX`.
417-
// See https://github.com/chromiumembedded/cef/issues/1368 for details.
418-
if (!settings.CefCommandLineArgs.ContainsKey("enable-begin-frame-scheduling"))
419-
{
420-
settings.CefCommandLineArgs.Add("enable-begin-frame-scheduling");
421-
}
422415
}
423416
}
424417
}

0 commit comments

Comments
 (0)