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值即可控制。

相关推荐
captain376几秒前
HTTP(2)
java·网络·http·java-ee
徐子童2 分钟前
介绍MVCC机制
java·mysql·面试题·秋招·并发·mvcc
Wang's Blog4 分钟前
Java 项目实战: 外卖平台-启用禁用员工账号与Long精度丢失修复
java·服务器
乌暮9 分钟前
Java 抽象类与接口详解:半成品图纸 vs 能力合同
java·开发语言·后端·学习
All for pursuit.10 分钟前
【栈-5】84.柱状图中最大的矩形
数据结构·c++·算法·leetcode
01二进制代码漫游日记15 分钟前
C++之类和对象(上)02
c++
一条泥憨鱼16 分钟前
苍穹外卖【day12| 工作台,通过Apache POI导入/导出运营数据】
java·后端·苍穹外卖
心平气和量大福大20 分钟前
android-权限
android·java
IT_陈寒22 分钟前
Redis大key删除引发的服务雪崩,这次我真记住了
前端·人工智能·后端
006_26 分钟前
ruoyi-vue-plus项目 minio外网访问配置
java