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

Unified Diff: cc/layer_tree_host.cc

Issue 11659004: Add support for tagging layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exposing enum in cc. Created 8 years 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.h ('k') | webkit/compositor_bindings/web_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host.cc
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
index 91276deb8ad5bcb005ec733ce1713e3e0f543d63..ca6d2633b517b429d1a32482b863e6a93d01c7e2 100644
--- a/cc/layer_tree_host.cc
+++ b/cc/layer_tree_host.cc
@@ -900,4 +900,28 @@ void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& eve
setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime);
}
+Layer* LayerTreeHost::getFirstLayerWithTags(unsigned int tags) const
+{
+ std::queue<Layer*> layers;
+ layers.push(m_rootLayer.get());
+
+ while (!layers.empty()) {
+ Layer* layer = layers.front();
+ layers.pop();
+
+ if (!layer)
+ return NULL;
+
+ if (layer->getTags() & tags)
+ return layer;
+
+ for (LayerList::const_iterator it = layer->children().begin();
+ it != layer->children().end(); ++it) {
+ layers.push(it->get());
+ }
+ }
+
+ return NULL;
+}
+
} // namespace cc
« no previous file with comments | « cc/layer_tree_host.h ('k') | webkit/compositor_bindings/web_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698