Commit b05b7fce authored by Sean Gilhuly's avatar Sean Gilhuly Committed by Commit Bot

Remember if GPU access was disabled by fallback

Set a bit in GpuDataManagerImplPrivate::FallBackToNextGpuMode() to
remember that the hardware acceleration was disabled by fallback, and
add a new error message in GpuAccessAllowed() to account for it. This
branch could be hit if the GPU process crashed repeatedly, and
SwiftShader was not available as a fallback option.

Bug: 986819
Change-Id: I93e2c08900b308e5897b3068053d7704324048ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1714811Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Sean Gilhuly <sgilhuly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680053}
parent 19b4eb7a
......@@ -359,6 +359,8 @@ bool GpuDataManagerImplPrivate::GpuAccessAllowed(std::string* reason) const {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableGpu))
*reason += "through commandline switch --disable-gpu.";
else if (hardware_disabled_by_fallback_)
*reason += "due to frequent crashes.";
else
*reason += "in chrome://settings.";
}
......@@ -904,6 +906,7 @@ void GpuDataManagerImplPrivate::FallBackToNextGpuMode() {
#else
switch (gpu_mode_) {
case gpu::GpuMode::HARDWARE_ACCELERATED:
hardware_disabled_by_fallback_ = true;
DisableHardwareAcceleration();
break;
case gpu::GpuMode::SWIFTSHADER:
......
......@@ -201,6 +201,9 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
// What the gpu process is being run for.
gpu::GpuMode gpu_mode_ = gpu::GpuMode::HARDWARE_ACCELERATED;
// Used to tell if the gpu was disabled due to process crashes.
bool hardware_disabled_by_fallback_ = false;
// We disable histogram stuff in testing, especially in unit tests because
// they cause random failures.
bool update_histograms_ = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment