| Index: content/renderer/render_widget.cc
|
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
| index 6009c9691b0e933f367d98ec9f2a0aa547ba49fb..1a43daae9a684b5a426fd0ab561794efcf1a4d3d 100644
|
| --- a/content/renderer/render_widget.cc
|
| +++ b/content/renderer/render_widget.cc
|
| @@ -26,6 +26,7 @@
|
| #include "cc/base/switches.h"
|
| #include "cc/debug/benchmark_instrumentation.h"
|
| #include "cc/output/output_surface.h"
|
| +#include "cc/output/vulkan_in_process_context_provider.h"
|
| #include "cc/scheduler/begin_frame_source.h"
|
| #include "cc/trees/layer_tree_host.h"
|
| #include "components/scheduler/renderer/render_widget_scheduling_state.h"
|
| @@ -107,10 +108,6 @@
|
| #include "content/renderer/mus/render_widget_mus_connection.h"
|
| #endif
|
|
|
| -#if defined(ENABLE_VULKAN)
|
| -#include "cc/output/vulkan_in_process_context_provider.h"
|
| -#endif
|
| -
|
| #include "third_party/WebKit/public/web/WebWidget.h"
|
|
|
| using blink::WebCompositionUnderline;
|
| @@ -764,22 +761,20 @@ std::unique_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(
|
| use_software = true;
|
| }
|
|
|
| -#if defined(ENABLE_VULKAN)
|
| scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider;
|
| -#endif
|
| scoped_refptr<ContextProviderCommandBuffer> context_provider;
|
| scoped_refptr<ContextProviderCommandBuffer> worker_context_provider;
|
| if (!use_software) {
|
| -#if defined(ENABLE_VULKAN)
|
| - vulkan_context_provider = cc::VulkanInProcessContextProvider::Create();
|
| - if (vulkan_context_provider) {
|
| - uint32_t output_surface_id = next_output_surface_id_++;
|
| - return base::WrapUnique(new DelegatedCompositorOutputSurface(
|
| - routing_id(), output_surface_id, context_provider,
|
| - worker_context_provider, vulkan_context_provider,
|
| - frame_swap_message_queue_));
|
| + if (command_line.HasSwitch(switches::kEnableVulkan)) {
|
| + vulkan_context_provider = cc::VulkanInProcessContextProvider::Create();
|
| + if (vulkan_context_provider) {
|
| + uint32_t output_surface_id = next_output_surface_id_++;
|
| + return base::WrapUnique(new DelegatedCompositorOutputSurface(
|
| + routing_id(), output_surface_id, context_provider,
|
| + worker_context_provider, vulkan_context_provider,
|
| + frame_swap_message_queue_));
|
| + }
|
| }
|
| -#endif
|
|
|
| gpu::SharedMemoryLimits limits;
|
| // The renderer compositor context doesn't do a lot of stuff, so we don't
|
| @@ -823,9 +818,7 @@ std::unique_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(
|
| return base::WrapUnique(new DelegatedCompositorOutputSurface(
|
| routing_id(), output_surface_id, std::move(context_provider),
|
| std::move(worker_context_provider),
|
| -#if defined(ENABLE_VULKAN)
|
| vulkan_context_provider,
|
| -#endif
|
| frame_swap_message_queue_));
|
| }
|
|
|
| @@ -834,10 +827,7 @@ std::unique_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(
|
| new cc::SoftwareOutputDevice());
|
|
|
| return base::WrapUnique(new CompositorOutputSurface(
|
| - routing_id(), output_surface_id, nullptr, nullptr,
|
| -#if defined(ENABLE_VULKAN)
|
| - nullptr,
|
| -#endif
|
| + routing_id(), output_surface_id, nullptr, nullptr, nullptr,
|
| std::move(software_device), frame_swap_message_queue_, true));
|
| }
|
|
|
|
|