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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host.h ('k') | webkit/compositor_bindings/web_layer_impl.h » ('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.h" 5 #include "cc/layer_tree_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 layer->notifyAnimationStarted(events[eventIndex], wallClockTime. ToDoubleT()); 893 layer->notifyAnimationStarted(events[eventIndex], wallClockTime. ToDoubleT());
894 else 894 else
895 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); 895 layer->notifyAnimationFinished(wallClockTime.ToDoubleT());
896 } 896 }
897 } 897 }
898 898
899 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) 899 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex)
900 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); 900 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime);
901 } 901 }
902 902
903 Layer* LayerTreeHost::getFirstLayerWithTags(unsigned int tags) const
904 {
905 std::queue<Layer*> layers;
906 layers.push(m_rootLayer.get());
907
908 while (!layers.empty()) {
909 Layer* layer = layers.front();
910 layers.pop();
911
912 if (!layer)
913 return NULL;
914
915 if (layer->getTags() & tags)
916 return layer;
917
918 for (LayerList::const_iterator it = layer->children().begin();
919 it != layer->children().end(); ++it) {
920 layers.push(it->get());
921 }
922 }
923
924 return NULL;
925 }
926
903 } // namespace cc 927 } // namespace cc
OLDNEW
« 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