选项页控制硬件加速开关
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值即可控制。