zoukankan      html  css  js  c++  java
  • cefsharp解决闪烁

    CefSharp禁用GPU的命令行参数

    其中,Major和Minor分别指代系统的主版本(大版本)、次版本(小版本)版本号。其中指定了Windows7系统会禁用 GPU。,突发奇想,是否windows8.1也是因为这个问题?然后开始验证。

    所以,经查阅,各系统的对应版本如下:

    系统的主版本、次版本

    1 Windows 10 -- 10.0* 2 Windows Server 2016 Technical Preview -- 10.0* 3 Windows 8.1 -- 6.3* 4 Windows Server 2012 R2 -- 6.3* 5 Windows 8 -- 6.2 6 Windows Server 2012 --6.2 7 Windows 7 -- 6.1 8 Windows Server 2008 R2 -- 6.1 9 Windows Server 2008 -- 610 Windows Vista -- 611 Windows Server 2003 R2 -- 5.212 Windows Server 2003 -- 5.213 Windows XP 64-Bit Edition -- 5.214 Windows XP -- 5.115 Windows 2000 -- 5

    系统的主版本、次版本

    如上图得知,若判断是否为Windows8.1系统,判断osVersion.Version.Major == 6 && osVersion.Version.Minor == 3 即可,

    但是不知源码中 为何要判断windows7的禁用GPU,在windows7下取消禁用GPU的测试,发现页面并未闪烁。

    但是为了安全起见,并且身边没有window8和其他的系统,所以决定,应用CefSharp的时候,配置CefCommandLineArgs进行了只判断osVersion.Version.Major == 6的处理,即windows8.1、windows8、windows7等都禁用了GPU。

      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 resolved6                 
    settings.CefCommandLineArgs.Add("disable-gpu", "1");
    }       
    var setting = new CefSharp.CefSettings();
    setting.CefCommandLineArgs.Add("disable-gpu", "1"); // 禁用gpu
  • 相关阅读:
    Vue 页面权限控制和登陆验证
    Vue 动态添加路由及生成菜单
    开发一个简单的 Vue 弹窗组件
    VS使用和错误收集
    ARP欺骗的实现
    虚拟机安装64位系统(Windows Server 2008R2 Datacenter版本)
    Kali安装问题
    HTML5学习之四:多媒体播放
    HTML5学习之三:文件与拖放
    HTML5学习之二:HTML5中的表单2
  • 原文地址:https://www.cnblogs.com/tianciliangen/p/7641470.html
Copyright © 2011-2022 走看看