| 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());
|
|
|