| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/compositor/gpu_process_transport_factory.h" | 5 #include "content/browser/compositor/gpu_process_transport_factory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "components/viz/service/display_embedder/compositor_overlay_candidate_v
alidator.h" | 35 #include "components/viz/service/display_embedder/compositor_overlay_candidate_v
alidator.h" |
| 36 #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h
" | 36 #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h
" |
| 37 #include "content/browser/browser_main_loop.h" | 37 #include "content/browser/browser_main_loop.h" |
| 38 #include "content/browser/compositor/browser_compositor_output_surface.h" | 38 #include "content/browser/compositor/browser_compositor_output_surface.h" |
| 39 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" | 39 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" |
| 40 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" | 40 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" |
| 41 #include "content/browser/compositor/offscreen_browser_compositor_output_surface
.h" | 41 #include "content/browser/compositor/offscreen_browser_compositor_output_surface
.h" |
| 42 #include "content/browser/compositor/reflector_impl.h" | 42 #include "content/browser/compositor/reflector_impl.h" |
| 43 #include "content/browser/compositor/software_browser_compositor_output_surface.
h" | 43 #include "content/browser/compositor/software_browser_compositor_output_surface.
h" |
| 44 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 44 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 45 #include "content/browser/gpu/compositor_util.h" |
| 45 #include "content/browser/gpu/gpu_data_manager_impl.h" | 46 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 46 #include "content/browser/renderer_host/render_widget_host_impl.h" | 47 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 47 #include "content/common/gpu_stream_constants.h" | 48 #include "content/common/gpu_stream_constants.h" |
| 48 #include "content/public/common/content_switches.h" | 49 #include "content/public/common/content_switches.h" |
| 49 #include "gpu/GLES2/gl2extchromium.h" | 50 #include "gpu/GLES2/gl2extchromium.h" |
| 50 #include "gpu/command_buffer/client/gles2_interface.h" | 51 #include "gpu/command_buffer/client/gles2_interface.h" |
| 51 #include "gpu/command_buffer/client/shared_memory_limits.h" | 52 #include "gpu/command_buffer/client/shared_memory_limits.h" |
| 52 #include "gpu/command_buffer/common/mailbox.h" | 53 #include "gpu/command_buffer/common/mailbox.h" |
| 53 #include "gpu/ipc/client/gpu_channel_host.h" | 54 #include "gpu/ipc/client/gpu_channel_host.h" |
| 54 #include "gpu/ipc/host/gpu_memory_buffer_support.h" | 55 #include "gpu/ipc/host/gpu_memory_buffer_support.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source; | 196 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source; |
| 196 std::unique_ptr<GpuVSyncBeginFrameSource> gpu_vsync_begin_frame_source; | 197 std::unique_ptr<GpuVSyncBeginFrameSource> gpu_vsync_begin_frame_source; |
| 197 ReflectorImpl* reflector = nullptr; | 198 ReflectorImpl* reflector = nullptr; |
| 198 std::unique_ptr<cc::Display> display; | 199 std::unique_ptr<cc::Display> display; |
| 199 bool output_is_secure = false; | 200 bool output_is_secure = false; |
| 200 }; | 201 }; |
| 201 | 202 |
| 202 GpuProcessTransportFactory::GpuProcessTransportFactory() | 203 GpuProcessTransportFactory::GpuProcessTransportFactory() |
| 203 : frame_sink_id_allocator_(kDefaultClientId), | 204 : frame_sink_id_allocator_(kDefaultClientId), |
| 204 renderer_settings_( | 205 renderer_settings_( |
| 205 ui::CreateRendererSettings(&gpu::GetImageTextureTarget)), | 206 ui::CreateRendererSettings(CreateBufferToTextureTargetMap())), |
| 206 task_graph_runner_(new cc::SingleThreadTaskGraphRunner), | 207 task_graph_runner_(new cc::SingleThreadTaskGraphRunner), |
| 207 callback_factory_(this) { | 208 callback_factory_(this) { |
| 208 cc::SetClientNameForMetrics("Browser"); | 209 cc::SetClientNameForMetrics("Browser"); |
| 209 | 210 |
| 210 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 211 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 211 if (command_line->HasSwitch(switches::kDisableGpuVsync)) { | 212 if (command_line->HasSwitch(switches::kDisableGpuVsync)) { |
| 212 std::string display_vsync_string = | 213 std::string display_vsync_string = |
| 213 command_line->GetSwitchValueASCII(switches::kDisableGpuVsync); | 214 command_line->GetSwitchValueASCII(switches::kDisableGpuVsync); |
| 214 // See comments in gl_switches about this flag. The browser compositor | 215 // See comments in gl_switches about this flag. The browser compositor |
| 215 // is only unthrottled when "gpu" or no switch value is passed, as it | 216 // is only unthrottled when "gpu" or no switch value is passed, as it |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 shared_vulkan_context_provider_ = | 959 shared_vulkan_context_provider_ = |
| 959 cc::VulkanInProcessContextProvider::Create(); | 960 cc::VulkanInProcessContextProvider::Create(); |
| 960 } | 961 } |
| 961 | 962 |
| 962 shared_vulkan_context_provider_initialized_ = true; | 963 shared_vulkan_context_provider_initialized_ = true; |
| 963 } | 964 } |
| 964 return shared_vulkan_context_provider_; | 965 return shared_vulkan_context_provider_; |
| 965 } | 966 } |
| 966 | 967 |
| 967 } // namespace content | 968 } // namespace content |
| OLD | NEW |