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 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 | 1702 |
1703 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); | 1703 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); |
1704 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1704 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
1705 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1705 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1706 m_client->setNeedsRedrawOnImplThread(); | 1706 m_client->setNeedsRedrawOnImplThread(); |
1707 | 1707 |
1708 for (size_t i = 0; i < layer->children().size(); ++i) | 1708 for (size_t i = 0; i < layer->children().size(); ++i) |
1709 animateScrollbarsRecursive(layer->children()[i], time); | 1709 animateScrollbarsRecursive(layer->children()[i], time); |
1710 } | 1710 } |
1711 | 1711 |
| 1712 // static |
| 1713 LayerImpl* LayerTreeHostImpl::getNonCompositedContentLayerRecursive(LayerImpl* l
ayer) |
| 1714 { |
| 1715 if (!layer) |
| 1716 return NULL; |
| 1717 |
| 1718 if (layer->drawsContent()) |
| 1719 return layer; |
| 1720 |
| 1721 for (LayerImpl::LayerList::const_iterator it = layer->children().begin(); |
| 1722 it != layer->children().end(); ++it) { |
| 1723 LayerImpl* nccr = getNonCompositedContentLayerRecursive(*it); |
| 1724 if (nccr) |
| 1725 return nccr; |
| 1726 } |
| 1727 |
| 1728 return NULL; |
| 1729 } |
| 1730 |
| 1731 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() |
| 1732 { |
| 1733 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); |
| 1734 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); |
| 1735 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); |
| 1736 } |
| 1737 |
1712 } // namespace cc | 1738 } // namespace cc |
OLD | NEW |