| 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 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 return fpsCounter()->currentFrameNumber(); | 1607 return fpsCounter()->currentFrameNumber(); |
| 1608 } | 1608 } |
| 1609 | 1609 |
| 1610 void LayerTreeHostImpl::renderingStats(RenderingStats* stats) const | 1610 void LayerTreeHostImpl::renderingStats(RenderingStats* stats) const |
| 1611 { | 1611 { |
| 1612 stats->numFramesSentToScreen = fpsCounter()->currentFrameNumber(); | 1612 stats->numFramesSentToScreen = fpsCounter()->currentFrameNumber(); |
| 1613 stats->droppedFrameCount = fpsCounter()->droppedFrameCount(); | 1613 stats->droppedFrameCount = fpsCounter()->droppedFrameCount(); |
| 1614 stats->numImplThreadScrolls = m_numImplThreadScrolls; | 1614 stats->numImplThreadScrolls = m_numImplThreadScrolls; |
| 1615 stats->numMainThreadScrolls = m_numMainThreadScrolls; | 1615 stats->numMainThreadScrolls = m_numMainThreadScrolls; |
| 1616 stats->numLayersInLayerTree = m_cumulativeNumLayersInLayerTree; | 1616 stats->numLayersInLayerTree = m_cumulativeNumLayersInLayerTree; |
| 1617 |
| 1618 if (m_tileManager) |
| 1619 m_tileManager->renderingStats(stats); |
| 1617 } | 1620 } |
| 1618 | 1621 |
| 1619 void LayerTreeHostImpl::animateScrollbars(base::TimeTicks time) | 1622 void LayerTreeHostImpl::animateScrollbars(base::TimeTicks time) |
| 1620 { | 1623 { |
| 1621 animateScrollbarsRecursive(m_rootLayerImpl.get(), time); | 1624 animateScrollbarsRecursive(m_rootLayerImpl.get(), time); |
| 1622 } | 1625 } |
| 1623 | 1626 |
| 1624 void LayerTreeHostImpl::animateScrollbarsRecursive(LayerImpl* layer, base::TimeT
icks time) | 1627 void LayerTreeHostImpl::animateScrollbarsRecursive(LayerImpl* layer, base::TimeT
icks time) |
| 1625 { | 1628 { |
| 1626 if (!layer) | 1629 if (!layer) |
| 1627 return; | 1630 return; |
| 1628 | 1631 |
| 1629 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); | 1632 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); |
| 1630 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1633 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
| 1631 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1634 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
| 1632 m_client->setNeedsRedrawOnImplThread(); | 1635 m_client->setNeedsRedrawOnImplThread(); |
| 1633 | 1636 |
| 1634 for (size_t i = 0; i < layer->children().size(); ++i) | 1637 for (size_t i = 0; i < layer->children().size(); ++i) |
| 1635 animateScrollbarsRecursive(layer->children()[i], time); | 1638 animateScrollbarsRecursive(layer->children()[i], time); |
| 1636 } | 1639 } |
| 1637 | 1640 |
| 1638 } // namespace cc | 1641 } // namespace cc |
| OLD | NEW |