Index: cc/layer_tree_host.cc |
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc |
index 91276deb8ad5bcb005ec733ce1713e3e0f543d63..a4c3cdc580652e65c36bb483f2c0ffead641c245 100644 |
--- a/cc/layer_tree_host.cc |
+++ b/cc/layer_tree_host.cc |
@@ -23,6 +23,8 @@ |
#include "cc/math_util.h" |
#include "cc/occlusion_tracker.h" |
#include "cc/overdraw_metrics.h" |
+#include "cc/picture_layer.h" |
+#include "cc/picture_pile_impl.h" |
#include "cc/single_thread_proxy.h" |
#include "cc/switches.h" |
#include "cc/thread.h" |
@@ -900,4 +902,38 @@ void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& eve |
setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); |
} |
+Layer* LayerTreeHost::getNonCompositedContentRootLayer() const |
+{ |
+ // Non-composited content root is the first drawable layer we find |
+ // in a breadth-first exploration from the root. |
enne (OOO)
2013/01/02 19:35:22
Can you not just use an in-order traversal instead
Leandro Graciá Gil
2013/01/02 19:50:46
How is this in-order traversal defined given that
enne (OOO)
2013/01/02 20:16:57
Yeah, that's exactly what I was trying to say.
Leandro Graciá Gil
2013/01/03 20:32:10
Done.
|
+ std::queue<Layer*> layers; |
+ layers.push(m_rootLayer.get()); |
+ |
+ while (!layers.empty()) { |
+ Layer* layer = layers.front(); |
+ layers.pop(); |
+ |
+ if (!layer) |
+ return NULL; |
+ |
+ if (layer->isDrawable() && layer->isPictureLayer()) |
enne (OOO)
2013/01/02 19:35:22
This is only going to be true if impl-side paintin
Leandro Graciá Gil
2013/01/02 19:50:46
This is ok for our use case as we'll always use im
enne (OOO)
2013/01/02 20:16:57
I think the right answer is to just not expose thi
Leandro Graciá Gil
2013/01/03 20:32:10
Done.
|
+ return layer; |
+ |
+ for (LayerList::const_iterator it = layer->children().begin(); |
+ it != layer->children().end(); ++it) { |
+ layers.push(it->get()); |
+ } |
+ } |
+ |
+ return NULL; |
+} |
+ |
+scoped_refptr<PicturePileImpl> LayerTreeHost::capturePicturePile(const Layer* layer) |
+{ |
+ if (!layer || !layer->isPictureLayer()) |
+ return scoped_refptr<PicturePileImpl>(); |
+ |
+ return m_proxy->capturePicturePile(static_cast<const PictureLayer*>(layer)); |
+} |
+ |
} // namespace cc |