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/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "cc/animation/scrollbar_animation_controller.h" | 14 #include "cc/animation/scrollbar_animation_controller.h" |
15 #include "cc/animation/timing_function.h" | 15 #include "cc/animation/timing_function.h" |
16 #include "cc/base/math_util.h" | 16 #include "cc/base/math_util.h" |
17 #include "cc/base/thread.h" | |
18 #include "cc/base/util.h" | 17 #include "cc/base/util.h" |
19 #include "cc/debug/debug_rect_history.h" | 18 #include "cc/debug/debug_rect_history.h" |
20 #include "cc/debug/frame_rate_counter.h" | 19 #include "cc/debug/frame_rate_counter.h" |
21 #include "cc/debug/overdraw_metrics.h" | 20 #include "cc/debug/overdraw_metrics.h" |
22 #include "cc/debug/paint_time_counter.h" | 21 #include "cc/debug/paint_time_counter.h" |
23 #include "cc/debug/rendering_stats_instrumentation.h" | 22 #include "cc/debug/rendering_stats_instrumentation.h" |
24 #include "cc/debug/traced_value.h" | 23 #include "cc/debug/traced_value.h" |
25 #include "cc/input/page_scale_animation.h" | 24 #include "cc/input/page_scale_animation.h" |
26 #include "cc/input/top_controls_manager.h" | 25 #include "cc/input/top_controls_manager.h" |
27 #include "cc/layers/append_quads_data.h" | 26 #include "cc/layers/append_quads_data.h" |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 return draw_frame; | 759 return draw_frame; |
761 } | 760 } |
762 | 761 |
763 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { | 762 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { |
764 if (input_handler_client_) | 763 if (input_handler_client_) |
765 input_handler_client_->MainThreadHasStoppedFlinging(); | 764 input_handler_client_->MainThreadHasStoppedFlinging(); |
766 } | 765 } |
767 | 766 |
768 void LayerTreeHostImpl::UpdateBackgroundAnimateTicking( | 767 void LayerTreeHostImpl::UpdateBackgroundAnimateTicking( |
769 bool should_background_tick) { | 768 bool should_background_tick) { |
| 769 DCHECK(proxy_->IsImplThread()); |
| 770 |
770 bool enabled = should_background_tick && | 771 bool enabled = should_background_tick && |
771 !animation_registrar_->active_animation_controllers().empty(); | 772 !animation_registrar_->active_animation_controllers().empty(); |
772 | 773 |
773 // Lazily create the time_source adapter so that we can vary the interval for | 774 // Lazily create the time_source adapter so that we can vary the interval for |
774 // testing. | 775 // testing. |
775 if (!time_source_client_adapter_) { | 776 if (!time_source_client_adapter_) { |
776 time_source_client_adapter_ = LayerTreeHostImplTimeSourceAdapter::Create( | 777 time_source_client_adapter_ = LayerTreeHostImplTimeSourceAdapter::Create( |
777 this, | 778 this, |
778 DelayBasedTimeSource::Create(LowFrequencyAnimationInterval(), | 779 DelayBasedTimeSource::Create(LowFrequencyAnimationInterval(), |
779 proxy_->CurrentThread()->TaskRunner())); | 780 proxy_->ImplThreadTaskRunner())); |
780 } | 781 } |
781 | 782 |
782 time_source_client_adapter_->SetActive(enabled); | 783 time_source_client_adapter_->SetActive(enabled); |
783 } | 784 } |
784 | 785 |
785 void LayerTreeHostImpl::SetViewportDamage(gfx::Rect damage_rect) { | 786 void LayerTreeHostImpl::SetViewportDamage(gfx::Rect damage_rect) { |
786 viewport_damage_rect_.Union(damage_rect); | 787 viewport_damage_rect_.Union(damage_rect); |
787 } | 788 } |
788 | 789 |
789 static inline RenderPass* FindRenderPassById( | 790 static inline RenderPass* FindRenderPassById( |
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2323 } | 2324 } |
2324 | 2325 |
2325 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2326 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
2326 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2327 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
2327 paint_time_counter_->ClearHistory(); | 2328 paint_time_counter_->ClearHistory(); |
2328 | 2329 |
2329 debug_state_ = debug_state; | 2330 debug_state_ = debug_state; |
2330 } | 2331 } |
2331 | 2332 |
2332 } // namespace cc | 2333 } // namespace cc |
OLD | NEW |