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.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <stack> | 8 #include <stack> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 background_color_(SK_ColorWHITE), | 130 background_color_(SK_ColorWHITE), |
131 has_transparent_background_(false), | 131 has_transparent_background_(false), |
132 partial_texture_update_requests_(0), | 132 partial_texture_update_requests_(0), |
133 in_paint_layer_contents_(false), | 133 in_paint_layer_contents_(false), |
134 total_frames_used_for_lcd_text_metrics_(0), | 134 total_frames_used_for_lcd_text_metrics_(0), |
135 id_(s_layer_tree_host_sequence_number.GetNext() + 1), | 135 id_(s_layer_tree_host_sequence_number.GetNext() + 1), |
136 next_commit_forces_redraw_(false), | 136 next_commit_forces_redraw_(false), |
137 shared_bitmap_manager_(shared_bitmap_manager), | 137 shared_bitmap_manager_(shared_bitmap_manager), |
138 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), | 138 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), |
139 surface_id_namespace_(0u), | 139 surface_id_namespace_(0u), |
140 next_surface_sequence_(1u) { | 140 next_surface_sequence_(1u), |
| 141 swap_interval_(1) { |
141 if (settings_.accelerated_animation_enabled) | 142 if (settings_.accelerated_animation_enabled) |
142 animation_registrar_ = AnimationRegistrar::Create(); | 143 animation_registrar_ = AnimationRegistrar::Create(); |
143 rendering_stats_instrumentation_->set_record_rendering_stats( | 144 rendering_stats_instrumentation_->set_record_rendering_stats( |
144 debug_state_.RecordRenderingStats()); | 145 debug_state_.RecordRenderingStats()); |
145 } | 146 } |
146 | 147 |
147 void LayerTreeHost::InitializeThreaded( | 148 void LayerTreeHost::InitializeThreaded( |
148 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 149 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
149 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 150 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
150 scoped_ptr<BeginFrameSource> external_begin_frame_source) { | 151 scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 | 735 |
735 void LayerTreeHost::SetVisible(bool visible) { | 736 void LayerTreeHost::SetVisible(bool visible) { |
736 if (visible_ == visible) | 737 if (visible_ == visible) |
737 return; | 738 return; |
738 visible_ = visible; | 739 visible_ = visible; |
739 if (!visible) | 740 if (!visible) |
740 ReduceMemoryUsage(); | 741 ReduceMemoryUsage(); |
741 proxy_->SetVisible(visible); | 742 proxy_->SetVisible(visible); |
742 } | 743 } |
743 | 744 |
| 745 void LayerTreeHost::SetThrottleFrameProduction(bool throttle) { |
| 746 proxy_->SetThrottleFrameProduction(throttle); |
| 747 } |
| 748 |
744 void LayerTreeHost::StartPageScaleAnimation(const gfx::Vector2d& target_offset, | 749 void LayerTreeHost::StartPageScaleAnimation(const gfx::Vector2d& target_offset, |
745 bool use_anchor, | 750 bool use_anchor, |
746 float scale, | 751 float scale, |
747 base::TimeDelta duration) { | 752 base::TimeDelta duration) { |
748 pending_page_scale_animation_.reset( | 753 pending_page_scale_animation_.reset( |
749 new PendingPageScaleAnimation( | 754 new PendingPageScaleAnimation( |
750 target_offset, | 755 target_offset, |
751 use_anchor, | 756 use_anchor, |
752 scale, | 757 scale, |
753 duration)); | 758 duration)); |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 bool children_need_begin_frames) const { | 1388 bool children_need_begin_frames) const { |
1384 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); | 1389 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); |
1385 } | 1390 } |
1386 | 1391 |
1387 void LayerTreeHost::SendBeginFramesToChildren( | 1392 void LayerTreeHost::SendBeginFramesToChildren( |
1388 const BeginFrameArgs& args) const { | 1393 const BeginFrameArgs& args) const { |
1389 client_->SendBeginFramesToChildren(args); | 1394 client_->SendBeginFramesToChildren(args); |
1390 } | 1395 } |
1391 | 1396 |
1392 } // namespace cc | 1397 } // namespace cc |
OLD | NEW |