Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11731002: Implement a method to access the non-composited content root layer picture pile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698