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

相关推荐
UXbot1 分钟前
如何用 AI 生成产品原型:从需求描述到可交互界面的完整 5 步流程
前端·人工智能·ui·交互·ai编程
hbstream2 分钟前
Hermes Agent 一周暴涨五万 Star,但我劝你别急着追
前端·人工智能
消失的旧时光-194312 分钟前
Spring Boot 实战(三):Service 分层 + 统一返回 + 异常处理(工程级写法)
java·spring boot·接口·解耦
光影少年13 分钟前
前端开发桌面端都有哪些框架?
前端·react.js·electron
云烟成雨TD13 分钟前
Spring AI Alibaba 1.x 系列【20】MessagesAgentHook 、MessagesModelHook 相关实现类
java·人工智能·spring
Cecilialana14 分钟前
同域名、同项目、仅 hash 变化,window.location.href 不跳转
前端·javascript
霸道流氓气质15 分钟前
SpringBoot中集成LangChain4j实现集成阿里百炼平台进行AI对话记忆功能和对话隔离功能
java·人工智能·spring boot·langchain4j
脱氧核糖核酸__19 分钟前
LeetCode热题100——41.缺失的第一个正数(题解+答案+要点)
数据结构·c++·算法·leetcode·哈希算法
脱氧核糖核酸__19 分钟前
LeetCode热题100——73.矩阵置零(题目+题解+答案)
c++·算法·leetcode·矩阵
XS03010620 分钟前
Java 基础笔记(二)
java·笔记·python