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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 3485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3496 // screen_space_transform_is_animating. So when we see a new animation get | 3496 // screen_space_transform_is_animating. So when we see a new animation get |
3497 // activated, we need to update the draw properties on the active tree. | 3497 // activated, we need to update the draw properties on the active tree. |
3498 active_tree()->set_needs_update_draw_properties(); | 3498 active_tree()->set_needs_update_draw_properties(); |
3499 // Request another frame to run the next tick of the animation. | 3499 // Request another frame to run the next tick of the animation. |
3500 SetNeedsOneBeginImplFrame(); | 3500 SetNeedsOneBeginImplFrame(); |
3501 } | 3501 } |
3502 } | 3502 } |
3503 | 3503 |
3504 std::string LayerTreeHostImpl::LayerTreeAsJson() const { | 3504 std::string LayerTreeHostImpl::LayerTreeAsJson() const { |
3505 std::string str; | 3505 std::string str; |
3506 if (active_tree_->root_layer()) { | 3506 if (active_tree_->root_layer_for_testing()) { |
3507 std::unique_ptr<base::Value> json( | 3507 std::unique_ptr<base::Value> json( |
3508 active_tree_->root_layer()->LayerTreeAsJson()); | 3508 active_tree_->root_layer_for_testing()->LayerTreeAsJson()); |
3509 base::JSONWriter::WriteWithOptions( | 3509 base::JSONWriter::WriteWithOptions( |
3510 *json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &str); | 3510 *json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &str); |
3511 } | 3511 } |
3512 return str; | 3512 return str; |
3513 } | 3513 } |
3514 | 3514 |
3515 void LayerTreeHostImpl::RegisterScrollbarAnimationController( | 3515 void LayerTreeHostImpl::RegisterScrollbarAnimationController( |
3516 int scroll_layer_id) { | 3516 int scroll_layer_id) { |
3517 if (settings().scrollbar_animator == LayerTreeSettings::NO_ANIMATOR) | 3517 if (settings().scrollbar_animator == LayerTreeSettings::NO_ANIMATOR) |
3518 return; | 3518 return; |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4010 return task_runner_provider_->HasImplThread(); | 4010 return task_runner_provider_->HasImplThread(); |
4011 } | 4011 } |
4012 | 4012 |
4013 bool LayerTreeHostImpl::CommitToActiveTree() const { | 4013 bool LayerTreeHostImpl::CommitToActiveTree() const { |
4014 // In single threaded mode we skip the pending tree and commit directly to the | 4014 // In single threaded mode we skip the pending tree and commit directly to the |
4015 // active tree. | 4015 // active tree. |
4016 return !task_runner_provider_->HasImplThread(); | 4016 return !task_runner_provider_->HasImplThread(); |
4017 } | 4017 } |
4018 | 4018 |
4019 } // namespace cc | 4019 } // namespace cc |
OLD | NEW |