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

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

Issue 1874813002: mash: Disable gpu in chrome when running as a mus client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add TODO 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 | « no previous file | no next file » | 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..6ed9790cd153f9271a5b517b6f975e771cc32dce 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,16 @@ enum BlockStatusHistogram {
BLOCK_STATUS_MAX
};
+bool ShouldDisableHardwareAcceleration() {
+#if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA)
+ // TODO(rjkroege): Remove this when https://crbug.com/602519 is fixed.
+ if (IsRunningInMojoShell())
+ return true;
+#endif
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableGpu);
+}
+
} // namespace anonymous
void GpuDataManagerImplPrivate::InitializeForTesting(
@@ -913,7 +926,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 +987,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 | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698