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

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: fix windows bots. Created 7 years, 12 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
Index: cc/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 55f6452ded8bc55344b72f71dc08478de00335a7..be3498294da112e531ed055a9e1787ff27afebf0 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -1724,4 +1724,32 @@ void LayerTreeHostImpl::animateScrollbarsRecursive(LayerImpl* layer, base::TimeT
animateScrollbarsRecursive(layer->children()[i], time);
}
+// static
+LayerImpl* LayerTreeHostImpl::getNonCompositedContentRootLayerRecursive(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 = getNonCompositedContentRootLayerRecursive(*it);
+ if (nccr)
+ return nccr;
+ }
+
+ return NULL;
+}
+
+scoped_refptr<PicturePileImpl> LayerTreeHostImpl::capturePicturePile()
+{
+ // 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.
+ // in a depth-first exploration from the root.
+ LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree();
+ const LayerImpl* layer = getNonCompositedContentRootLayerRecursive(tree->RootLayer());
+ return layer ? layer->GetPicturePileClone() : scoped_refptr<PicturePileImpl>();
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698