Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(969)

Unified Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 1877533002: mash: Fix launching chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/system/input_device_settings_impl_ozone.cc ('k') | ui/aura/env.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_data_manager_impl_private.cc
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index a4ca614c1a8dfd1296bbc906abb4290fe8bf2c93..35cfa0ee20dbb718716cb566d54201252e261fd6 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -48,6 +48,9 @@
#if defined(OS_ANDROID)
#include "ui/gfx/android/device_display_info.h"
#endif // OS_ANDROID
+#if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA)
+#include "content/common/mojo/mojo_shell_connection_impl.h"
+#endif
namespace content {
@@ -251,6 +254,15 @@ enum BlockStatusHistogram {
BLOCK_STATUS_MAX
};
+bool ShouldDisableHardwareAcceleration() {
+#if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA)
+ if (IsRunningInMojoShell())
+ return true;
+#endif
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableGpu);
+}
+
} // namespace anonymous
void GpuDataManagerImplPrivate::InitializeForTesting(
@@ -913,7 +925,7 @@ bool GpuDataManagerImplPrivate::ShouldDisableAcceleratedVideoDecode(
return true;
// Accelerated decode is never available with --disable-gpu.
- return command_line->HasSwitch(switches::kDisableGpu);
+ return ShouldDisableHardwareAcceleration();
}
void GpuDataManagerImplPrivate::GetDisabledExtensions(
@@ -974,7 +986,7 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(GpuDataManagerImpl* owner)
swiftshader_path_ =
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
switches::kSwiftShaderPath);
- if (command_line->HasSwitch(switches::kDisableGpu))
+ if (ShouldDisableHardwareAcceleration())
DisableHardwareAcceleration();
#if defined(OS_MACOSX)
« no previous file with comments | « chrome/browser/chromeos/system/input_device_settings_impl_ozone.cc ('k') | ui/aura/env.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698