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 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 { | 869 { |
870 if (!m_settings.acceleratedAnimationEnabled || m_animationRegistrar->active_
animation_controllers().empty()) | 870 if (!m_settings.acceleratedAnimationEnabled || m_animationRegistrar->active_
animation_controllers().empty()) |
871 return; | 871 return; |
872 | 872 |
873 TRACE_EVENT0("cc", "LayerTreeHostImpl::animateLayers"); | 873 TRACE_EVENT0("cc", "LayerTreeHostImpl::animateLayers"); |
874 | 874 |
875 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 875 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
876 | 876 |
877 AnimationRegistrar::AnimationControllerMap copy = m_animationRegistrar->acti
ve_animation_controllers(); | 877 AnimationRegistrar::AnimationControllerMap copy = m_animationRegistrar->acti
ve_animation_controllers(); |
878 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(
); iter != copy.end(); ++iter) { | 878 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(
); iter != copy.end(); ++iter) { |
879 (*iter).second->animate(monotonicTime); | 879 (*iter).second->Animate(monotonicTime); |
880 (*iter).second->updateState(0); | 880 (*iter).second->UpdateState(NULL); |
881 } | 881 } |
882 } | 882 } |
883 | 883 |
884 void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& eve
nts, Layer* layer, base::Time wallClockTime) | 884 void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& eve
nts, Layer* layer, base::Time wallClockTime) |
885 { | 885 { |
886 if (!layer) | 886 if (!layer) |
887 return; | 887 return; |
888 | 888 |
889 for (size_t eventIndex = 0; eventIndex < events.size(); ++eventIndex) { | 889 for (size_t eventIndex = 0; eventIndex < events.size(); ++eventIndex) { |
890 if (layer->id() == events[eventIndex].layerId) { | 890 if (layer->id() == events[eventIndex].layer_id) { |
891 switch (events[eventIndex].type) { | 891 switch (events[eventIndex].type) { |
892 case AnimationEvent::Started: | 892 case AnimationEvent::Started: |
893 layer->notifyAnimationStarted(events[eventIndex], wallClockTime.
ToDoubleT()); | 893 layer->notifyAnimationStarted(events[eventIndex], wallClockTime.
ToDoubleT()); |
894 break; | 894 break; |
895 | 895 |
896 case AnimationEvent::Finished: | 896 case AnimationEvent::Finished: |
897 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); | 897 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); |
898 break; | 898 break; |
899 | 899 |
900 case AnimationEvent::PropertyUpdate: | 900 case AnimationEvent::PropertyUpdate: |
901 layer->notifyAnimationPropertyUpdate(events[eventIndex]); | 901 layer->notifyAnimationPropertyUpdate(events[eventIndex]); |
902 break; | 902 break; |
903 | 903 |
904 default: | 904 default: |
905 NOTREACHED(); | 905 NOTREACHED(); |
906 } | 906 } |
907 } | 907 } |
908 } | 908 } |
909 | 909 |
910 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 910 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
911 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 911 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
912 } | 912 } |
913 | 913 |
914 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() | 914 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() |
915 { | 915 { |
916 return m_proxy->CapturePicture(); | 916 return m_proxy->CapturePicture(); |
917 } | 917 } |
918 | 918 |
919 } // namespace cc | 919 } // namespace cc |
OLD | NEW |