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 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1717 | 1717 |
1718 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); | 1718 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); |
1719 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1719 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
1720 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1720 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1721 m_client->setNeedsRedrawOnImplThread(); | 1721 m_client->setNeedsRedrawOnImplThread(); |
1722 | 1722 |
1723 for (size_t i = 0; i < layer->children().size(); ++i) | 1723 for (size_t i = 0; i < layer->children().size(); ++i) |
1724 animateScrollbarsRecursive(layer->children()[i], time); | 1724 animateScrollbarsRecursive(layer->children()[i], time); |
1725 } | 1725 } |
1726 | 1726 |
1727 // static | |
1728 LayerImpl* LayerTreeHostImpl::getNonCompositedContentRootLayerRecursive(LayerImp l* layer) | |
1729 { | |
1730 if (!layer) | |
1731 return NULL; | |
1732 | |
1733 if (layer->drawsContent()) | |
1734 return layer; | |
1735 | |
1736 for (LayerImpl::LayerList::const_iterator it = layer->children().begin(); | |
1737 it != layer->children().end(); ++it) { | |
1738 LayerImpl* nccr = getNonCompositedContentRootLayerRecursive(*it); | |
1739 if (nccr) | |
1740 return nccr; | |
1741 } | |
1742 | |
1743 return NULL; | |
1744 } | |
1745 | |
1746 scoped_refptr<PicturePileImpl> LayerTreeHostImpl::capturePicturePile() | |
1747 { | |
1748 // Non-composited content root is the first drawable picture layer we find | |
danakj
2013/01/04 18:10:01
nit: This comment seems misplaced or out of date.
Leandro GraciĆ” Gil
2013/01/04 20:40:15
Done.
| |
1749 // in a depth-first exploration from the root. | |
1750 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); | |
1751 const LayerImpl* layer = getNonCompositedContentRootLayerRecursive(tree->Roo tLayer()); | |
1752 return layer ? layer->GetPicturePileClone() : scoped_refptr<PicturePileImpl> (); | |
1753 } | |
1754 | |
1727 } // namespace cc | 1755 } // namespace cc |
OLD | NEW |