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

Unified Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 1926973003: [mac] Remove dependencies from BrowserCompositorOverlayCandidateValidatorMac. (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 | « content/browser/compositor/browser_compositor_overlay_candidate_validator_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/gpu_process_transport_factory.cc
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 065117aabf62bc9ad0eefbeeb2b370b41a8b49a7..e615006ed1b7f2051eb7f64f9c9c72a78534ebec 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -74,7 +74,9 @@
#elif defined(OS_MACOSX)
#include "content/browser/compositor/browser_compositor_overlay_candidate_validator_mac.h"
#include "content/browser/compositor/software_output_device_mac.h"
+#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "ui/base/cocoa/remote_layer_api.h"
+#include "ui/base/ui_base_switches.h"
#elif defined(OS_ANDROID)
#include "content/browser/compositor/browser_compositor_overlay_candidate_validator_android.h"
#endif
@@ -131,6 +133,13 @@ CreateContextCommon(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
nullptr));
}
+#if defined(OS_MACOSX)
+bool IsCALayersDisabledFromCommandLine() {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ return command_line->HasSwitch(switches::kDisableMacOverlays);
+}
+#endif
+
} // namespace
namespace content {
@@ -216,7 +225,14 @@ CreateOverlayCandidateValidator(gfx::AcceleratedWidget widget) {
#elif defined(OS_MACOSX)
// Overlays are only supported through the remote layer API.
if (ui::RemoteLayerAPISupported()) {
- validator.reset(new BrowserCompositorOverlayCandidateValidatorMac());
+ static bool overlays_disabled_at_command_line =
+ IsCALayersDisabledFromCommandLine();
+ const bool ca_layers_disabled =
+ overlays_disabled_at_command_line ||
+ GpuDataManagerImpl::GetInstance()->IsDriverBugWorkaroundActive(
+ gpu::DISABLE_OVERLAY_CA_LAYERS);
+ validator.reset(
+ new BrowserCompositorOverlayCandidateValidatorMac(ca_layers_disabled));
}
#elif defined(OS_ANDROID)
validator.reset(new BrowserCompositorOverlayCandidateValidatorAndroid());
« no previous file with comments | « content/browser/compositor/browser_compositor_overlay_candidate_validator_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698