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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 9d42698bae2a192a8e6884cd6011c818bd8040d1..9c217b0dd0f63b9be06658ebc36defa46c291f30 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -1709,4 +1709,30 @@ void LayerTreeHostImpl::animateScrollbarsRecursive(LayerImpl* layer, base::TimeT
animateScrollbarsRecursive(layer->children()[i], time);
}
+// static
+LayerImpl* LayerTreeHostImpl::getNonCompositedContentLayerRecursive(LayerImpl* layer)
+{
+ if (!layer)
+ return NULL;
+
+ if (layer->drawsContent())
+ return layer;
+
+ for (LayerImpl::LayerList::const_iterator it = layer->children().begin();
+ it != layer->children().end(); ++it) {
+ LayerImpl* nccr = getNonCompositedContentLayerRecursive(*it);
+ if (nccr)
+ return nccr;
+ }
+
+ return NULL;
+}
+
+skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture()
+{
+ LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree();
+ LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer());
+ return layer ? layer->getPicture() : skia::RefPtr<SkPicture>();
+}
+
} // namespace cc
« 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