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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 has_gpu_rasterization_trigger_(false), | 115 has_gpu_rasterization_trigger_(false), |
116 content_is_suitable_for_gpu_rasterization_(true), | 116 content_is_suitable_for_gpu_rasterization_(true), |
117 gpu_rasterization_histogram_recorded_(false), | 117 gpu_rasterization_histogram_recorded_(false), |
118 background_color_(SK_ColorWHITE), | 118 background_color_(SK_ColorWHITE), |
119 has_transparent_background_(false), | 119 has_transparent_background_(false), |
120 partial_texture_update_requests_(0), | 120 partial_texture_update_requests_(0), |
121 in_paint_layer_contents_(false), | 121 in_paint_layer_contents_(false), |
122 total_frames_used_for_lcd_text_metrics_(0), | 122 total_frames_used_for_lcd_text_metrics_(0), |
123 id_(s_layer_tree_host_sequence_number.GetNext() + 1), | 123 id_(s_layer_tree_host_sequence_number.GetNext() + 1), |
124 next_commit_forces_redraw_(false), | 124 next_commit_forces_redraw_(false), |
125 shared_bitmap_manager_(manager) { | 125 shared_bitmap_manager_(manager), |
| 126 begin_frame_requested_(false) { |
126 if (settings_.accelerated_animation_enabled) | 127 if (settings_.accelerated_animation_enabled) |
127 animation_registrar_ = AnimationRegistrar::Create(); | 128 animation_registrar_ = AnimationRegistrar::Create(); |
128 rendering_stats_instrumentation_->set_record_rendering_stats( | 129 rendering_stats_instrumentation_->set_record_rendering_stats( |
129 debug_state_.RecordRenderingStats()); | 130 debug_state_.RecordRenderingStats()); |
130 } | 131 } |
131 | 132 |
132 void LayerTreeHost::InitializeThreaded( | 133 void LayerTreeHost::InitializeThreaded( |
133 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 134 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
134 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { | 135 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { |
135 InitializeProxy( | 136 InitializeProxy( |
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 DCHECK(swap_promise); | 1289 DCHECK(swap_promise); |
1289 swap_promise_list_.push_back(swap_promise.Pass()); | 1290 swap_promise_list_.push_back(swap_promise.Pass()); |
1290 } | 1291 } |
1291 | 1292 |
1292 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1293 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1293 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1294 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
1294 swap_promise_list_[i]->DidNotSwap(reason); | 1295 swap_promise_list_[i]->DidNotSwap(reason); |
1295 swap_promise_list_.clear(); | 1296 swap_promise_list_.clear(); |
1296 } | 1297 } |
1297 | 1298 |
| 1299 void LayerTreeHost::SendBeginFrame(const BeginFrameArgs& args) { |
| 1300 begin_frame_requested_ = false; |
| 1301 client_->SendBeginFrame(args); |
| 1302 } |
| 1303 |
| 1304 void LayerTreeHost::RequestBeginFrame() { |
| 1305 // If next BeginFrame is already requested, we can use it. |
| 1306 if (begin_frame_requested_) |
| 1307 return; |
| 1308 begin_frame_requested_ = true; |
| 1309 proxy_->BeginFrameRequested(); |
| 1310 } |
| 1311 |
1298 } // namespace cc | 1312 } // namespace cc |
OLD | NEW |