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

Unified Diff: gpu/ipc/service/image_transport_surface_overlay_mac.mm

Issue 2440853002: Mac: Add command line flag to disable AVFoundation layers (Closed)
Patch Set: Fix formatting Created 4 years, 2 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/gpu/gpu_process_host.cc ('k') | ui/base/ui_base_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/image_transport_surface_overlay_mac.mm
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
index a1fdb02545d21aabc1ee26eb984046a47b9bf3a6..ef4b795dc883ae5c4da1776c97eab64da5f40a87 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -22,6 +22,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/command_line.h"
#include "base/metrics/histogram_macros.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/trace_event.h"
@@ -32,6 +33,7 @@
#include "ui/accelerated_widget_mac/io_surface_context.h"
#include "ui/base/cocoa/animation_utils.h"
#include "ui/base/cocoa/remote_layer_api.h"
+#include "ui/base/ui_base_switches.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/swap_result.h"
#include "ui/gfx/transform.h"
@@ -67,13 +69,18 @@ void IOSurfaceContextNoOp(scoped_refptr<ui::IOSurfaceContext>) {
gl_renderer_id_(0) {
ui::GpuSwitchingManager::GetInstance()->AddObserver(this);
- bool disable_av_sample_buffer_display_layer =
- stub_->GetFeatureInfo()
- ->workarounds()
- .disable_av_sample_buffer_display_layer;
+ static bool av_disabled_at_command_line =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableAVFoundationOverlays);
+
+ bool allow_av_sample_buffer_display_layer =
+ !av_disabled_at_command_line &&
+ !stub_->GetFeatureInfo()
+ ->workarounds()
+ .disable_av_sample_buffer_display_layer;
ca_layer_tree_coordinator_.reset(new ui::CALayerTreeCoordinator(
- use_remote_layer_api_, !disable_av_sample_buffer_display_layer));
+ use_remote_layer_api_, allow_av_sample_buffer_display_layer));
}
ImageTransportSurfaceOverlayMac::~ImageTransportSurfaceOverlayMac() {
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | ui/base/ui_base_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698