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

相关推荐
Cg1362691597419 小时前
多态的定义
java·开发语言
GISer_Jing19 小时前
前端学习总结——AI&主流前沿方向篇
前端·人工智能·学习
云霄IT19 小时前
新版电脑微信4.1.x.x小程序逆向之——寻找小程序存放位置目录和__APP__.wxapkg
java·微信·小程序
微信api接口介绍19 小时前
微信社群管理开发
java·开发语言·网络·微信
尘世中一位迷途小书童19 小时前
Monorepo 工具大比拼:为什么我最终选择了 pnpm + Turborepo?
前端·架构
一枚前端小能手19 小时前
🔍 重写vue之ref和reactive
前端·javascript·vue.js
星链引擎19 小时前
4sapi.com开发者进阶版(技术导向,侧重 “原理 + 最佳实践”)
前端
尘世中一位迷途小书童19 小时前
2025年了,你还在用传统的多仓库管理吗?Monorepo 架构深度解析
前端·架构
fruge19 小时前
前端性能优化实践指南:从理论到落地
前端·性能优化
快起来别睡了19 小时前
用这 9 个 API,我把页面性能干到了 90+
前端