| 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 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 if (!m_settings.acceleratedAnimationEnabled || m_animationRegistrar->active_
animation_controllers().empty() || !rootLayer()) | 1493 if (!m_settings.acceleratedAnimationEnabled || m_animationRegistrar->active_
animation_controllers().empty() || !rootLayer()) |
| 1494 return; | 1494 return; |
| 1495 | 1495 |
| 1496 TRACE_EVENT0("cc", "LayerTreeHostImpl::animateLayers"); | 1496 TRACE_EVENT0("cc", "LayerTreeHostImpl::animateLayers"); |
| 1497 | 1497 |
| 1498 m_lastAnimationTime = wallClockTime; | 1498 m_lastAnimationTime = wallClockTime; |
| 1499 double monotonicSeconds = (monotonicTime - base::TimeTicks()).InSecondsF(); | 1499 double monotonicSeconds = (monotonicTime - base::TimeTicks()).InSecondsF(); |
| 1500 | 1500 |
| 1501 AnimationRegistrar::AnimationControllerMap copy = m_animationRegistrar->acti
ve_animation_controllers(); | 1501 AnimationRegistrar::AnimationControllerMap copy = m_animationRegistrar->acti
ve_animation_controllers(); |
| 1502 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(
); iter != copy.end(); ++iter) | 1502 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(
); iter != copy.end(); ++iter) |
| 1503 (*iter).second->animate(monotonicSeconds); | 1503 (*iter).second->Animate(monotonicSeconds); |
| 1504 | 1504 |
| 1505 m_client->setNeedsRedrawOnImplThread(); | 1505 m_client->setNeedsRedrawOnImplThread(); |
| 1506 setBackgroundTickingEnabled(!m_visible && !m_animationRegistrar->active_anim
ation_controllers().empty()); | 1506 setBackgroundTickingEnabled(!m_visible && !m_animationRegistrar->active_anim
ation_controllers().empty()); |
| 1507 } | 1507 } |
| 1508 | 1508 |
| 1509 void LayerTreeHostImpl::updateAnimationState() | 1509 void LayerTreeHostImpl::updateAnimationState() |
| 1510 { | 1510 { |
| 1511 if (!m_settings.acceleratedAnimationEnabled || m_animationRegistrar->active_
animation_controllers().empty() || !rootLayer()) | 1511 if (!m_settings.acceleratedAnimationEnabled || m_animationRegistrar->active_
animation_controllers().empty() || !rootLayer()) |
| 1512 return; | 1512 return; |
| 1513 | 1513 |
| 1514 TRACE_EVENT0("cc", "LayerTreeHostImpl::updateAnimationState"); | 1514 TRACE_EVENT0("cc", "LayerTreeHostImpl::updateAnimationState"); |
| 1515 scoped_ptr<AnimationEventsVector> events(make_scoped_ptr(new AnimationEvents
Vector)); | 1515 scoped_ptr<AnimationEventsVector> events(make_scoped_ptr(new AnimationEvents
Vector)); |
| 1516 AnimationRegistrar::AnimationControllerMap copy = m_animationRegistrar->acti
ve_animation_controllers(); | 1516 AnimationRegistrar::AnimationControllerMap copy = m_animationRegistrar->acti
ve_animation_controllers(); |
| 1517 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(
); iter != copy.end(); ++iter) | 1517 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(
); iter != copy.end(); ++iter) |
| 1518 (*iter).second->updateState(events.get()); | 1518 (*iter).second->UpdateState(events.get()); |
| 1519 | 1519 |
| 1520 if (!events->empty()) | 1520 if (!events->empty()) |
| 1521 m_client->postAnimationEventsToMainThreadOnImplThread(events.Pass(), m_l
astAnimationTime); | 1521 m_client->postAnimationEventsToMainThreadOnImplThread(events.Pass(), m_l
astAnimationTime); |
| 1522 } | 1522 } |
| 1523 | 1523 |
| 1524 base::TimeDelta LayerTreeHostImpl::lowFrequencyAnimationInterval() const | 1524 base::TimeDelta LayerTreeHostImpl::lowFrequencyAnimationInterval() const |
| 1525 { | 1525 { |
| 1526 return base::TimeDelta::FromSeconds(1); | 1526 return base::TimeDelta::FromSeconds(1); |
| 1527 } | 1527 } |
| 1528 | 1528 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1730 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats
()); | 1730 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats
()); |
| 1731 } | 1731 } |
| 1732 | 1732 |
| 1733 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime, int
commitNumber) | 1733 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime, int
commitNumber) |
| 1734 { | 1734 { |
| 1735 DCHECK(m_debugState.continuousPainting); | 1735 DCHECK(m_debugState.continuousPainting); |
| 1736 m_paintTimeCounter->SavePaintTime(totalPaintTime, commitNumber); | 1736 m_paintTimeCounter->SavePaintTime(totalPaintTime, commitNumber); |
| 1737 } | 1737 } |
| 1738 | 1738 |
| 1739 } // namespace cc | 1739 } // namespace cc |
| OLD | NEW |