| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 params.client = client; | 240 params.client = client; |
| 241 params.settings = &settings; | 241 params.settings = &settings; |
| 242 params.task_graph_runner = deps->GetTaskGraphRunner(); | 242 params.task_graph_runner = deps->GetTaskGraphRunner(); |
| 243 params.main_task_runner = deps->GetCompositorMainThreadTaskRunner(); | 243 params.main_task_runner = deps->GetCompositorMainThreadTaskRunner(); |
| 244 params.mutator_host = mutator_host; | 244 params.mutator_host = mutator_host; |
| 245 if (base::TaskScheduler::GetInstance()) { | 245 if (base::TaskScheduler::GetInstance()) { |
| 246 // The image worker thread needs to allow waiting since it makes discardable | 246 // The image worker thread needs to allow waiting since it makes discardable |
| 247 // shared memory allocations which need to make synchronous calls to the | 247 // shared memory allocations which need to make synchronous calls to the |
| 248 // IO thread. | 248 // IO thread. |
| 249 params.image_worker_task_runner = base::CreateSequencedTaskRunnerWithTraits( | 249 params.image_worker_task_runner = base::CreateSequencedTaskRunnerWithTraits( |
| 250 base::TaskTraits() | 250 {base::WithBaseSyncPrimitives(), base::TaskPriority::BACKGROUND, |
| 251 .WithPriority(base::TaskPriority::BACKGROUND) | 251 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}); |
| 252 .WithShutdownBehavior( | |
| 253 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) | |
| 254 .WithBaseSyncPrimitives()); | |
| 255 } | 252 } |
| 256 if (!is_threaded) { | 253 if (!is_threaded) { |
| 257 // Single-threaded layout tests. | 254 // Single-threaded layout tests. |
| 258 layer_tree_host = | 255 layer_tree_host = |
| 259 cc::LayerTreeHost::CreateSingleThreaded(single_thread_client, ¶ms); | 256 cc::LayerTreeHost::CreateSingleThreaded(single_thread_client, ¶ms); |
| 260 } else { | 257 } else { |
| 261 layer_tree_host = cc::LayerTreeHost::CreateThreaded( | 258 layer_tree_host = cc::LayerTreeHost::CreateThreaded( |
| 262 deps->GetCompositorImplThreadTaskRunner(), ¶ms); | 259 deps->GetCompositorImplThreadTaskRunner(), ¶ms); |
| 263 } | 260 } |
| 264 | 261 |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 void RenderWidgetCompositor::SetContentSourceId(uint32_t id) { | 1146 void RenderWidgetCompositor::SetContentSourceId(uint32_t id) { |
| 1150 layer_tree_host_->SetContentSourceId(id); | 1147 layer_tree_host_->SetContentSourceId(id); |
| 1151 } | 1148 } |
| 1152 | 1149 |
| 1153 void RenderWidgetCompositor::SetLocalSurfaceId( | 1150 void RenderWidgetCompositor::SetLocalSurfaceId( |
| 1154 const cc::LocalSurfaceId& local_surface_id) { | 1151 const cc::LocalSurfaceId& local_surface_id) { |
| 1155 layer_tree_host_->SetLocalSurfaceId(local_surface_id); | 1152 layer_tree_host_->SetLocalSurfaceId(local_surface_id); |
| 1156 } | 1153 } |
| 1157 | 1154 |
| 1158 } // namespace content | 1155 } // namespace content |
| OLD | NEW |