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/layer_tree_host_impl.h" | 5 #include "cc/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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 // activate once all high res visible tiles are ready on the pending tree. | 1019 // activate once all high res visible tiles are ready on the pending tree. |
1020 if (total_pending && total_active && total_pending != drawable_pending) | 1020 if (total_pending && total_active && total_pending != drawable_pending) |
1021 return; | 1021 return; |
1022 | 1022 |
1023 activatePendingTree(); | 1023 activatePendingTree(); |
1024 } | 1024 } |
1025 | 1025 |
1026 void LayerTreeHostImpl::activatePendingTree() | 1026 void LayerTreeHostImpl::activatePendingTree() |
1027 { | 1027 { |
1028 CHECK(m_pendingTree); | 1028 CHECK(m_pendingTree); |
| 1029 |
| 1030 m_activeTree->PushPersistedState(m_pendingTree.get()); |
1029 m_activeTree.swap(m_pendingTree); | 1031 m_activeTree.swap(m_pendingTree); |
1030 // TODO(enne): consider recycling this tree to prevent layer churn | 1032 // TODO(enne): consider recycling this tree to prevent layer churn |
1031 m_pendingTree.reset(); | 1033 m_pendingTree.reset(); |
1032 m_client->onCanDrawStateChanged(canDraw()); | 1034 m_client->onCanDrawStateChanged(canDraw()); |
1033 m_client->onHasPendingTreeStateChanged(pendingTree()); | 1035 m_client->onHasPendingTreeStateChanged(pendingTree()); |
1034 } | 1036 } |
1035 | 1037 |
1036 void LayerTreeHostImpl::setVisible(bool visible) | 1038 void LayerTreeHostImpl::setVisible(bool visible) |
1037 { | 1039 { |
1038 DCHECK(m_proxy->isImplThread()); | 1040 DCHECK(m_proxy->isImplThread()); |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); | 1705 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); |
1704 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1706 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
1705 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1707 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1706 m_client->setNeedsRedrawOnImplThread(); | 1708 m_client->setNeedsRedrawOnImplThread(); |
1707 | 1709 |
1708 for (size_t i = 0; i < layer->children().size(); ++i) | 1710 for (size_t i = 0; i < layer->children().size(); ++i) |
1709 animateScrollbarsRecursive(layer->children()[i], time); | 1711 animateScrollbarsRecursive(layer->children()[i], time); |
1710 } | 1712 } |
1711 | 1713 |
1712 } // namespace cc | 1714 } // namespace cc |
OLD | NEW |