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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 TRACE_EVENT_INSTANT0( | 272 TRACE_EVENT_INSTANT0( |
273 "cc", "LayerTreeHostImpl::CanDraw contents textures purged", | 273 "cc", "LayerTreeHostImpl::CanDraw contents textures purged", |
274 TRACE_EVENT_SCOPE_THREAD); | 274 TRACE_EVENT_SCOPE_THREAD); |
275 return false; | 275 return false; |
276 } | 276 } |
277 return true; | 277 return true; |
278 } | 278 } |
279 | 279 |
280 void LayerTreeHostImpl::Animate(base::TimeTicks monotonic_time, | 280 void LayerTreeHostImpl::Animate(base::TimeTicks monotonic_time, |
281 base::Time wall_clock_time) { | 281 base::Time wall_clock_time) { |
282 if (input_handler_client_) | |
283 input_handler_client_->Animate(monotonic_time); | |
282 AnimatePageScale(monotonic_time); | 284 AnimatePageScale(monotonic_time); |
283 AnimateLayers(monotonic_time, wall_clock_time); | 285 AnimateLayers(monotonic_time, wall_clock_time); |
284 AnimateScrollbars(monotonic_time); | 286 AnimateScrollbars(monotonic_time); |
285 AnimateTopControls(monotonic_time); | 287 AnimateTopControls(monotonic_time); |
286 } | 288 } |
287 | 289 |
288 void LayerTreeHostImpl::ManageTiles() { | 290 void LayerTreeHostImpl::ManageTiles() { |
289 DCHECK(tile_manager_); | 291 DCHECK(tile_manager_); |
290 tile_manager_->ManageTiles(); | 292 tile_manager_->ManageTiles(); |
291 | 293 |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
715 RemoveRenderPasses(CullRenderPassesWithNoQuads(), frame); | 717 RemoveRenderPasses(CullRenderPassesWithNoQuads(), frame); |
716 renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes); | 718 renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes); |
717 RemoveRenderPasses(CullRenderPassesWithCachedTextures(renderer_.get()), | 719 RemoveRenderPasses(CullRenderPassesWithCachedTextures(renderer_.get()), |
718 frame); | 720 frame); |
719 | 721 |
720 // If we're making a frame to draw, it better have at least one render pass. | 722 // If we're making a frame to draw, it better have at least one render pass. |
721 DCHECK(!frame->render_passes.empty()); | 723 DCHECK(!frame->render_passes.empty()); |
722 return draw_frame; | 724 return draw_frame; |
723 } | 725 } |
724 | 726 |
727 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { | |
728 if (input_handler_client_) | |
729 input_handler_client_->MainThreadHasStoppedFlinging(); | |
730 } | |
731 | |
725 void LayerTreeHostImpl::UpdateBackgroundAnimateTicking( | 732 void LayerTreeHostImpl::UpdateBackgroundAnimateTicking( |
726 bool should_background_tick) { | 733 bool should_background_tick) { |
727 bool enabled = should_background_tick && | 734 bool enabled = should_background_tick && |
728 !animation_registrar_->active_animation_controllers().empty(); | 735 !animation_registrar_->active_animation_controllers().empty(); |
729 | 736 |
730 // Lazily create the time_source adapter so that we can vary the interval for | 737 // Lazily create the time_source adapter so that we can vary the interval for |
731 // testing. | 738 // testing. |
732 if (!time_source_client_adapter_) { | 739 if (!time_source_client_adapter_) { |
733 time_source_client_adapter_ = LayerTreeHostImplTimeSourceAdapter::Create( | 740 time_source_client_adapter_ = LayerTreeHostImplTimeSourceAdapter::Create( |
734 this, | 741 this, |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1461 client_->SetNeedsRedrawOnImplThread(); | 1468 client_->SetNeedsRedrawOnImplThread(); |
1462 active_tree_->set_needs_update_draw_properties(); | 1469 active_tree_->set_needs_update_draw_properties(); |
1463 SetFullRootLayerDamage(); | 1470 SetFullRootLayerDamage(); |
1464 } | 1471 } |
1465 | 1472 |
1466 bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() { | 1473 bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() { |
1467 active_tree_->UpdateDrawProperties(); | 1474 active_tree_->UpdateDrawProperties(); |
1468 return !active_tree_->RenderSurfaceLayerList().empty(); | 1475 return !active_tree_->RenderSurfaceLayerList().empty(); |
1469 } | 1476 } |
1470 | 1477 |
1478 void LayerTreeHostImpl::BindToClient(InputHandlerClient* client) { | |
danakj
2013/05/06 16:33:39
If this is going to take ownership of the client*,
| |
1479 DCHECK(input_handler_client_ == NULL); | |
1480 input_handler_client_.reset(client); | |
1481 } | |
1482 | |
1471 InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin( | 1483 InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin( |
1472 gfx::Point viewport_point, InputHandler::ScrollInputType type) { | 1484 gfx::Point viewport_point, InputHandler::ScrollInputType type) { |
1473 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin"); | 1485 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin"); |
1474 | 1486 |
1475 if (top_controls_manager_) | 1487 if (top_controls_manager_) |
1476 top_controls_manager_->ScrollBegin(); | 1488 top_controls_manager_->ScrollBegin(); |
1477 | 1489 |
1478 DCHECK(!CurrentlyScrollingLayer()); | 1490 DCHECK(!CurrentlyScrollingLayer()); |
1479 ClearCurrentlyScrollingLayer(); | 1491 ClearCurrentlyScrollingLayer(); |
1480 | 1492 |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2159 } | 2171 } |
2160 | 2172 |
2161 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2173 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
2162 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2174 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
2163 paint_time_counter_->ClearHistory(); | 2175 paint_time_counter_->ClearHistory(); |
2164 | 2176 |
2165 debug_state_ = debug_state; | 2177 debug_state_ = debug_state; |
2166 } | 2178 } |
2167 | 2179 |
2168 } // namespace cc | 2180 } // namespace cc |
OLD | NEW |