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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 | 973 |
974 activatePendingTree(); | 974 activatePendingTree(); |
975 } | 975 } |
976 | 976 |
977 void LayerTreeHostImpl::activatePendingTree() | 977 void LayerTreeHostImpl::activatePendingTree() |
978 { | 978 { |
979 CHECK(m_pendingTree); | 979 CHECK(m_pendingTree); |
980 TRACE_EVENT_ASYNC_END0("cc", "PendingTree", m_pendingTree.get()); | 980 TRACE_EVENT_ASYNC_END0("cc", "PendingTree", m_pendingTree.get()); |
981 | 981 |
982 m_activeTree->PushPersistedState(m_pendingTree.get()); | 982 m_activeTree->PushPersistedState(m_pendingTree.get()); |
983 m_activeTree->SetRootLayer(TreeSynchronizer::synchronizeTrees(m_pendingTree-
>RootLayer(), m_activeTree->DetachLayerTree(), m_activeTree.get())); | 983 if (m_needsFullTreeSync) |
| 984 m_activeTree->SetRootLayer(TreeSynchronizer::synchronizeTrees(m_pendingT
ree->RootLayer(), m_activeTree->DetachLayerTree(), m_activeTree.get())); |
984 TreeSynchronizer::pushProperties(m_pendingTree->RootLayer(), m_activeTree->R
ootLayer()); | 985 TreeSynchronizer::pushProperties(m_pendingTree->RootLayer(), m_activeTree->R
ootLayer()); |
985 DCHECK(!m_recycleTree); | 986 DCHECK(!m_recycleTree); |
986 | 987 |
987 m_pendingTree->pushPropertiesTo(m_activeTree.get()); | 988 m_pendingTree->pushPropertiesTo(m_activeTree.get()); |
988 | 989 |
989 // Now that we've synced everything from the pending tree to the active | 990 // Now that we've synced everything from the pending tree to the active |
990 // tree, rename the pending tree the recycle tree so we can reuse it on the | 991 // tree, rename the pending tree the recycle tree so we can reuse it on the |
991 // next sync. | 992 // next sync. |
992 m_pendingTree.swap(m_recycleTree); | 993 m_pendingTree.swap(m_recycleTree); |
993 m_recycleTree->ClearRenderSurfaces(); | 994 m_recycleTree->ClearRenderSurfaces(); |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); | 1682 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); |
1682 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); | 1683 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); |
1683 } | 1684 } |
1684 | 1685 |
1685 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) | 1686 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) |
1686 { | 1687 { |
1687 m_paintTimeCounter->SavePaintTime(totalPaintTime); | 1688 m_paintTimeCounter->SavePaintTime(totalPaintTime); |
1688 } | 1689 } |
1689 | 1690 |
1690 } // namespace cc | 1691 } // namespace cc |
OLD | NEW |