• 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
  • 相关阅读:
    521.最长特殊序列 I
    520.检查大写字母
    459.重复的子字符串
    Java 读取 .properties 文件的几种方式
    Idea 使用教程
    db2 with用法
    DB2 alter 新增/删除/修改列
    Bootstrap treegrid 实现树形表格结构
    Mysql 递归查询
    navicat for mysql 下载安装教程
  • 原文地址:https://www.cnblogs.com/tianciliangen/p/7641470.html
Copyright © 2020-2023  润新知