| 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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 pendingTree()->UpdateDrawProperties(LayerTreeImpl::UPDATE_PENDING_TREE); | 965 pendingTree()->UpdateDrawProperties(LayerTreeImpl::UPDATE_PENDING_TREE); |
| 966 | 966 |
| 967 TRACE_EVENT_ASYNC_STEP1("cc", | 967 TRACE_EVENT_ASYNC_STEP1("cc", |
| 968 "PendingTree", m_pendingTree.get(), "activate", | 968 "PendingTree", m_pendingTree.get(), "activate", |
| 969 "state", ValueToString(activationStateAsValue())); | 969 "state", ValueToString(activationStateAsValue())); |
| 970 | 970 |
| 971 // It's always fine to activate to an empty tree. Otherwise, only | 971 // It's always fine to activate to an empty tree. Otherwise, only |
| 972 // activate once all visible resources in pending tree are ready | 972 // activate once all visible resources in pending tree are ready |
| 973 // or tile manager has no work scheduled for pending tree. | 973 // or tile manager has no work scheduled for pending tree. |
| 974 if (activeTree()->RootLayer() && | 974 if (activeTree()->RootLayer() && |
| 975 !pendingTree()->AreVisibleResourcesReady() && | 975 !pendingTree()->AreVisibleResourcesReady()) { |
| 976 m_tileManager->HasPendingWorkScheduled(PENDING_TREE)) { | 976 // In smoothness takes priority mode, the pending tree's priorities are |
| 977 TRACE_EVENT_ASYNC_STEP0("cc", | 977 // ignored, so the tile manager may not have work for it even though it |
| 978 "PendingTree", m_pendingTree.get(), "waiting"); | 978 // is simultaneously not ready to be activated. |
| 979 return; | 979 if (m_tileManager->GlobalState().tree_priority == |
| 980 SMOOTHNESS_TAKES_PRIORITY || |
| 981 m_tileManager->HasPendingWorkScheduled(PENDING_TREE)) { |
| 982 TRACE_EVENT_ASYNC_STEP0("cc", |
| 983 "PendingTree", |
| 984 m_pendingTree.get(), |
| 985 "waiting"); |
| 986 return; |
| 987 } |
| 980 } | 988 } |
| 981 | 989 |
| 982 activatePendingTree(); | 990 activatePendingTree(); |
| 983 } | 991 } |
| 984 | 992 |
| 985 void LayerTreeHostImpl::activatePendingTree() | 993 void LayerTreeHostImpl::activatePendingTree() |
| 986 { | 994 { |
| 987 CHECK(m_pendingTree); | 995 CHECK(m_pendingTree); |
| 988 TRACE_EVENT_ASYNC_END0("cc", "PendingTree", m_pendingTree.get()); | 996 TRACE_EVENT_ASYNC_END0("cc", "PendingTree", m_pendingTree.get()); |
| 989 | 997 |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1757 if (m_tileManager) | 1765 if (m_tileManager) |
| 1758 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats
()); | 1766 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats
()); |
| 1759 } | 1767 } |
| 1760 | 1768 |
| 1761 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) | 1769 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) |
| 1762 { | 1770 { |
| 1763 m_paintTimeCounter->SavePaintTime(totalPaintTime); | 1771 m_paintTimeCounter->SavePaintTime(totalPaintTime); |
| 1764 } | 1772 } |
| 1765 | 1773 |
| 1766 } // namespace cc | 1774 } // namespace cc |
| OLD | NEW |