OLD | NEW |
---|---|
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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
880 } | 880 } |
881 } | 881 } |
882 | 882 |
883 void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& eve nts, Layer* layer, base::Time wallClockTime) | 883 void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& eve nts, Layer* layer, base::Time wallClockTime) |
884 { | 884 { |
885 if (!layer) | 885 if (!layer) |
886 return; | 886 return; |
887 | 887 |
888 for (size_t eventIndex = 0; eventIndex < events.size(); ++eventIndex) { | 888 for (size_t eventIndex = 0; eventIndex < events.size(); ++eventIndex) { |
889 if (layer->id() == events[eventIndex].layerId) { | 889 if (layer->id() == events[eventIndex].layerId) { |
890 if (events[eventIndex].type == AnimationEvent::Started) | 890 switch (events[eventIndex].type) { |
891 case AnimationEvent::Started : | |
Ian Vollick
2013/03/06 23:29:45
nit: no space between the enumerators and the colo
wjmaclean
2013/03/07 13:49:29
Done.
| |
891 layer->notifyAnimationStarted(events[eventIndex], wallClockTime. ToDoubleT()); | 892 layer->notifyAnimationStarted(events[eventIndex], wallClockTime. ToDoubleT()); |
892 else | 893 break; |
894 | |
895 case AnimationEvent::Finished : | |
893 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); | 896 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); |
897 break; | |
898 | |
899 case AnimationEvent::PropertyUpdate : | |
900 layer->notifyAnimationPropertyUpdate(events[eventIndex]); | |
901 break; | |
902 | |
903 default: | |
904 NOTREACHED(); | |
905 } | |
894 } | 906 } |
895 } | 907 } |
896 | 908 |
897 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) | 909 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) |
898 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); | 910 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); |
899 } | 911 } |
900 | 912 |
901 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() | 913 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() |
902 { | 914 { |
903 return m_proxy->capturePicture(); | 915 return m_proxy->capturePicture(); |
904 } | 916 } |
905 | 917 |
906 } // namespace cc | 918 } // namespace cc |
OLD | NEW |