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 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 settings, client, proxy, rendering_stats_instrumentation, manager, id)); | 206 settings, client, proxy, rendering_stats_instrumentation, manager, id)); |
207 } | 207 } |
208 | 208 |
209 LayerTreeHostImpl::LayerTreeHostImpl( | 209 LayerTreeHostImpl::LayerTreeHostImpl( |
210 const LayerTreeSettings& settings, | 210 const LayerTreeSettings& settings, |
211 LayerTreeHostImplClient* client, | 211 LayerTreeHostImplClient* client, |
212 Proxy* proxy, | 212 Proxy* proxy, |
213 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 213 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
214 SharedBitmapManager* manager, | 214 SharedBitmapManager* manager, |
215 int id) | 215 int id) |
216 : client_(client), | 216 : BaseBeginFrameSource(0), |
| 217 client_(client), |
217 proxy_(proxy), | 218 proxy_(proxy), |
218 use_gpu_rasterization_(false), | 219 use_gpu_rasterization_(false), |
219 input_handler_client_(NULL), | 220 input_handler_client_(NULL), |
220 did_lock_scrolling_layer_(false), | 221 did_lock_scrolling_layer_(false), |
221 should_bubble_scrolls_(false), | 222 should_bubble_scrolls_(false), |
222 wheel_scrolling_(false), | 223 wheel_scrolling_(false), |
223 scroll_affects_scroll_handler_(false), | 224 scroll_affects_scroll_handler_(false), |
224 scroll_layer_id_when_mouse_over_scrollbar_(0), | 225 scroll_layer_id_when_mouse_over_scrollbar_(0), |
225 tile_priorities_dirty_(false), | 226 tile_priorities_dirty_(false), |
226 root_layer_scroll_offset_delegate_(NULL), | 227 root_layer_scroll_offset_delegate_(NULL), |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 } | 1323 } |
1323 | 1324 |
1324 void LayerTreeHostImpl::SetNeedsRedrawRect(const gfx::Rect& damage_rect) { | 1325 void LayerTreeHostImpl::SetNeedsRedrawRect(const gfx::Rect& damage_rect) { |
1325 if (damage_rect.IsEmpty()) | 1326 if (damage_rect.IsEmpty()) |
1326 return; | 1327 return; |
1327 NotifySwapPromiseMonitorsOfSetNeedsRedraw(); | 1328 NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
1328 client_->SetNeedsRedrawRectOnImplThread(damage_rect); | 1329 client_->SetNeedsRedrawRectOnImplThread(damage_rect); |
1329 } | 1330 } |
1330 | 1331 |
1331 void LayerTreeHostImpl::BeginFrame(const BeginFrameArgs& args) { | 1332 void LayerTreeHostImpl::BeginFrame(const BeginFrameArgs& args) { |
1332 client_->BeginFrame(args); | 1333 frame_sink_->BeginFrame(args); |
1333 } | 1334 } |
1334 | 1335 |
1335 void LayerTreeHostImpl::DidSwapBuffers() { | 1336 void LayerTreeHostImpl::DidSwapBuffers() { |
1336 client_->DidSwapBuffersOnImplThread(); | 1337 client_->DidSwapBuffersOnImplThread(); |
1337 } | 1338 } |
1338 | 1339 |
1339 void LayerTreeHostImpl::DidSwapBuffersComplete() { | 1340 void LayerTreeHostImpl::DidSwapBuffersComplete() { |
1340 client_->DidSwapBuffersCompleteOnImplThread(); | 1341 client_->DidSwapBuffersCompleteOnImplThread(); |
1341 } | 1342 } |
1342 | 1343 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 TRACE_EVENT_FLOW_STEP0( | 1558 TRACE_EVENT_FLOW_STEP0( |
1558 "input", | 1559 "input", |
1559 "LatencyInfo.Flow", | 1560 "LatencyInfo.Flow", |
1560 TRACE_ID_DONT_MANGLE(metadata.latency_info[i].trace_id), | 1561 TRACE_ID_DONT_MANGLE(metadata.latency_info[i].trace_id), |
1561 "SwapBuffers"); | 1562 "SwapBuffers"); |
1562 } | 1563 } |
1563 renderer_->SwapBuffers(metadata); | 1564 renderer_->SwapBuffers(metadata); |
1564 return true; | 1565 return true; |
1565 } | 1566 } |
1566 | 1567 |
1567 void LayerTreeHostImpl::SetNeedsBeginFrame(bool enable) { | 1568 void LayerTreeHostImpl::OnGenerateChange(bool generate_frames) { |
1568 if (output_surface_) | 1569 if (output_surface_) |
1569 output_surface_->SetNeedsBeginFrame(enable); | 1570 output_surface_->SetNeedsBeginFrame(generate_frames); |
1570 else | 1571 else |
1571 DCHECK(!enable); | 1572 DCHECK(!generate_frames); |
| 1573 } |
| 1574 |
| 1575 std::string LayerTreeHostImpl::TypeString() const { |
| 1576 return "LayerTreeHostImpl"; |
1572 } | 1577 } |
1573 | 1578 |
1574 void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) { | 1579 void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) { |
1575 // Sample the frame time now. This time will be used for updating animations | 1580 // Sample the frame time now. This time will be used for updating animations |
1576 // when we draw. | 1581 // when we draw. |
1577 UpdateCurrentFrameTime(); | 1582 UpdateCurrentFrameTime(); |
1578 // Cache the begin impl frame interval | 1583 // Cache the begin impl frame interval |
1579 begin_impl_frame_interval_ = args.interval; | 1584 begin_impl_frame_interval_ = args.interval; |
1580 } | 1585 } |
1581 | 1586 |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3129 swap_promise_monitor_.erase(monitor); | 3134 swap_promise_monitor_.erase(monitor); |
3130 } | 3135 } |
3131 | 3136 |
3132 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3137 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
3133 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3138 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
3134 for (; it != swap_promise_monitor_.end(); it++) | 3139 for (; it != swap_promise_monitor_.end(); it++) |
3135 (*it)->OnSetNeedsRedrawOnImpl(); | 3140 (*it)->OnSetNeedsRedrawOnImpl(); |
3136 } | 3141 } |
3137 | 3142 |
3138 } // namespace cc | 3143 } // namespace cc |
OLD | NEW |