OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/trees/thread_proxy.h" | 5 #include "cc/trees/thread_proxy.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "cc/debug/benchmark_instrumentation.h" | 13 #include "cc/debug/benchmark_instrumentation.h" |
| 14 #include "cc/debug/devtools_instrumentation.h" |
14 #include "cc/input/input_handler.h" | 15 #include "cc/input/input_handler.h" |
15 #include "cc/output/context_provider.h" | 16 #include "cc/output/context_provider.h" |
16 #include "cc/output/output_surface.h" | 17 #include "cc/output/output_surface.h" |
17 #include "cc/quads/draw_quad.h" | 18 #include "cc/quads/draw_quad.h" |
18 #include "cc/resources/prioritized_resource_manager.h" | 19 #include "cc/resources/prioritized_resource_manager.h" |
19 #include "cc/scheduler/delay_based_time_source.h" | 20 #include "cc/scheduler/delay_based_time_source.h" |
20 #include "cc/scheduler/frame_rate_controller.h" | 21 #include "cc/scheduler/frame_rate_controller.h" |
21 #include "cc/scheduler/scheduler.h" | 22 #include "cc/scheduler/scheduler.h" |
22 #include "cc/trees/blocking_task_runner.h" | 23 #include "cc/trees/blocking_task_runner.h" |
23 #include "cc/trees/layer_tree_host.h" | 24 #include "cc/trees/layer_tree_host.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 layer_tree_host->settings().using_synchronous_renderer_compositor), | 88 layer_tree_host->settings().using_synchronous_renderer_compositor), |
88 inside_draw_(false), | 89 inside_draw_(false), |
89 can_cancel_commit_(true), | 90 can_cancel_commit_(true), |
90 defer_commits_(false), | 91 defer_commits_(false), |
91 input_throttled_until_commit_(false), | 92 input_throttled_until_commit_(false), |
92 renew_tree_priority_on_impl_thread_pending_(false), | 93 renew_tree_priority_on_impl_thread_pending_(false), |
93 draw_duration_history_(kDurationHistorySize), | 94 draw_duration_history_(kDurationHistorySize), |
94 begin_main_frame_to_commit_duration_history_(kDurationHistorySize), | 95 begin_main_frame_to_commit_duration_history_(kDurationHistorySize), |
95 commit_to_activate_duration_history_(kDurationHistorySize), | 96 commit_to_activate_duration_history_(kDurationHistorySize), |
96 weak_factory_on_impl_thread_(this), | 97 weak_factory_on_impl_thread_(this), |
97 weak_factory_(this) { | 98 weak_factory_(this), |
| 99 tree_id_(layer_tree_host_->id()) { |
98 TRACE_EVENT0("cc", "ThreadProxy::ThreadProxy"); | 100 TRACE_EVENT0("cc", "ThreadProxy::ThreadProxy"); |
99 DCHECK(IsMainThread()); | 101 DCHECK(IsMainThread()); |
100 DCHECK(layer_tree_host_); | 102 DCHECK(layer_tree_host_); |
101 } | 103 } |
102 | 104 |
103 ThreadProxy::~ThreadProxy() { | 105 ThreadProxy::~ThreadProxy() { |
104 TRACE_EVENT0("cc", "ThreadProxy::~ThreadProxy"); | 106 TRACE_EVENT0("cc", "ThreadProxy::~ThreadProxy"); |
105 DCHECK(IsMainThread()); | 107 DCHECK(IsMainThread()); |
106 DCHECK(!started_); | 108 DCHECK(!started_); |
107 } | 109 } |
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 settings.deadline_scheduling_enabled; | 1342 settings.deadline_scheduling_enabled; |
1341 scheduler_settings.impl_side_painting = settings.impl_side_painting; | 1343 scheduler_settings.impl_side_painting = settings.impl_side_painting; |
1342 scheduler_settings.timeout_and_draw_when_animation_checkerboards = | 1344 scheduler_settings.timeout_and_draw_when_animation_checkerboards = |
1343 settings.timeout_and_draw_when_animation_checkerboards; | 1345 settings.timeout_and_draw_when_animation_checkerboards; |
1344 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = | 1346 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = |
1345 settings.maximum_number_of_failed_draws_before_draw_is_forced_; | 1347 settings.maximum_number_of_failed_draws_before_draw_is_forced_; |
1346 scheduler_settings.using_synchronous_renderer_compositor = | 1348 scheduler_settings.using_synchronous_renderer_compositor = |
1347 settings.using_synchronous_renderer_compositor; | 1349 settings.using_synchronous_renderer_compositor; |
1348 scheduler_settings.throttle_frame_production = | 1350 scheduler_settings.throttle_frame_production = |
1349 settings.throttle_frame_production; | 1351 settings.throttle_frame_production; |
1350 scheduler_on_impl_thread_ = Scheduler::Create(this, scheduler_settings); | 1352 scheduler_on_impl_thread_ = Scheduler::Create(this, scheduler_settings, |
| 1353 tree_id_); |
1351 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); | 1354 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); |
1352 | 1355 |
1353 impl_thread_weak_ptr_ = weak_factory_on_impl_thread_.GetWeakPtr(); | 1356 impl_thread_weak_ptr_ = weak_factory_on_impl_thread_.GetWeakPtr(); |
1354 completion->Signal(); | 1357 completion->Signal(); |
1355 } | 1358 } |
1356 | 1359 |
1357 void ThreadProxy::InitializeOutputSurfaceOnImplThread( | 1360 void ThreadProxy::InitializeOutputSurfaceOnImplThread( |
1358 CompletionEvent* completion, | 1361 CompletionEvent* completion, |
1359 scoped_ptr<OutputSurface> output_surface, | 1362 scoped_ptr<OutputSurface> output_surface, |
1360 scoped_refptr<ContextProvider> offscreen_context_provider, | 1363 scoped_refptr<ContextProvider> offscreen_context_provider, |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 commit_to_activate_duration_history_.InsertSample( | 1593 commit_to_activate_duration_history_.InsertSample( |
1591 base::TimeTicks::HighResNow() - commit_complete_time_); | 1594 base::TimeTicks::HighResNow() - commit_complete_time_); |
1592 } | 1595 } |
1593 | 1596 |
1594 void ThreadProxy::DidManageTiles() { | 1597 void ThreadProxy::DidManageTiles() { |
1595 DCHECK(IsImplThread()); | 1598 DCHECK(IsImplThread()); |
1596 scheduler_on_impl_thread_->DidManageTiles(); | 1599 scheduler_on_impl_thread_->DidManageTiles(); |
1597 } | 1600 } |
1598 | 1601 |
1599 } // namespace cc | 1602 } // namespace cc |
OLD | NEW |