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

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

Issue 2018603002: Mac: Clean up ifdefs in output surface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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 ea713fd1a5b1269dd56115420be12082250bfc93..ce4d76468672ca91c1035098acafe532848b2174 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -72,12 +72,9 @@
#elif defined(USE_X11)
#include "content/browser/compositor/software_output_device_x11.h"
#elif defined(OS_MACOSX)
-#include "components/display_compositor/compositor_overlay_candidate_validator_mac.h"
+#include "content/browser/compositor/gpu_browser_compositor_output_surface_mac.h"
#include "content/browser/compositor/software_output_device_mac.h"
-#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
-#include "ui/base/cocoa/remote_layer_api.h"
-#include "ui/base/ui_base_switches.h"
#elif defined(OS_ANDROID)
#include "components/display_compositor/compositor_overlay_candidate_validator_android.h"
#endif
@@ -137,13 +134,6 @@ scoped_refptr<content::ContextProviderCommandBuffer> CreateContextCommon(
gpu::SharedMemoryLimits(), attributes, shared_context_provider, type));
}
-#if defined(OS_MACOSX)
-bool IsCALayersDisabledFromCommandLine() {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- return command_line->HasSwitch(switches::kDisableMacOverlays);
-}
-#endif
-
} // namespace
namespace content {
@@ -229,19 +219,6 @@ CreateOverlayCandidateValidator(gfx::AcceleratedWidget widget) {
new display_compositor::CompositorOverlayCandidateValidatorOzone(
std::move(overlay_candidates)));
}
-#elif defined(OS_MACOSX)
- // Overlays are only supported through the remote layer API.
- if (ui::RemoteLayerAPISupported()) {
- 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 display_compositor::CompositorOverlayCandidateValidatorMac(
- ca_layers_disabled));
- }
#elif defined(OS_ANDROID)
validator.reset(
new display_compositor::CompositorOverlayCandidateValidatorAndroid());
@@ -453,25 +430,23 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
std::unique_ptr<
display_compositor::CompositorOverlayCandidateValidator>()));
} else if (capabilities.surfaceless) {
- GLenum target = GL_TEXTURE_2D;
- GLenum format = GL_RGB;
#if defined(OS_MACOSX)
- target = GL_TEXTURE_RECTANGLE_ARB;
- format = GL_RGBA;
-#endif
+ surface = base::WrapUnique(new GpuBrowserCompositorOutputSurfaceMac(
+ context_provider, data->surface_handle, compositor->vsync_manager(),
+ compositor->task_runner().get(),
+ BrowserGpuMemoryBufferManager::current()));
+#else
surface =
base::WrapUnique(new GpuSurfacelessBrowserCompositorOutputSurface(
context_provider, data->surface_handle,
compositor->vsync_manager(), compositor->task_runner().get(),
- CreateOverlayCandidateValidator(compositor->widget()), target,
- format, BrowserGpuMemoryBufferManager::current()));
+ CreateOverlayCandidateValidator(compositor->widget()),
+ GL_TEXTURE_2D, GL_RGB,
+ BrowserGpuMemoryBufferManager::current()));
+#endif
} else {
std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
validator;
-#if !defined(OS_MACOSX)
- // Overlays are only supported on surfaceless output surfaces on Mac.
- validator = CreateOverlayCandidateValidator(compositor->widget());
-#endif
surface = base::WrapUnique(new GpuBrowserCompositorOutputSurface(
context_provider, compositor->vsync_manager(),
compositor->task_runner().get(), std::move(validator)));
danakj 2016/05/26 21:33:51 nullptr for the validator?
ccameron 2016/05/26 22:46:16 Oh no ... I didn't realize that was !defined(OS_MA

Powered by Google App Engine
This is Rietveld 408576698