Chromium 硬件加速开关c++

选项页控制硬件加速开关

1、前端代码

javascript 复制代码
<settings-toggle-button id="hardwareAcceleration"

        pref="{{prefs.hardware_acceleration_mode.enabled}}"

        label="$i18n{hardwareAccelerationLabel}">

      <template is="dom-if" if="[[shouldShowRestart_(

          prefs.hardware_acceleration_mode.enabled.value)]]">

        <cr-button on-click="onRestartClick_" slot="more-actions">

          $i18n{restart}

        </cr-button>

      </template>

</settings-toggle-button>

2、c++代码

cpp 复制代码
​
// Set to true if hardware acceleration mode is enabled on this browser.

inline constexpr char kHardwareAccelerationModeEnabled[] =

    "hardware_acceleration_mode.enabled";

​

chrome\browser\gpu\gpu_mode_manager.cc

cpp 复制代码
// static
void GpuModeManager::RegisterPrefs(PrefRegistrySimple* registry) {
  registry->RegisterBooleanPref(
      prefs::kHardwareAccelerationModeEnabled, true);
  registry->RegisterBooleanPref(
      prefs::kHardwareAccelerationModePrevious, true);
}

修改此kHardwareAccelerationModeEnabled值即可控制。

相关推荐
FL16238631294 分钟前
[C++]使用纯opencv部署yolov12目标检测onnx模型
c++·opencv·yolo
JenKinJia11 分钟前
Windows10配置C++版本的Kafka,并进行发布和订阅测试
开发语言·c++
s_fox_15 分钟前
Nginx Embedded Variables 嵌入式变量解析(4)
java·网络·nginx
Jelena1577958579221 分钟前
使用Java爬虫获取1688 item_get_company 接口的公司档案信息
java·开发语言·爬虫
大数据追光猿22 分钟前
Python中的Flask深入认知&搭建前端页面?
前端·css·python·前端框架·flask·html5
数据小小爬虫24 分钟前
Jsoup解析商品详情时,如何确保数据准确性?
java·爬虫
莫忘初心丶24 分钟前
python flask 使用教程 快速搭建一个 Web 应用
前端·python·flask
V+zmm1013434 分钟前
自驾游拼团小程序的设计与实现(ssm论文源码调试讲解)
java·数据库·微信小程序·小程序·毕业设计
wen__xvn1 小时前
每日一题洛谷P1914 小书童——凯撒密码c++
数据结构·c++·算法
坚定信念,勇往无前1 小时前
springboot单机支持1w并发,需要做哪些优化
java·spring boot·后端