OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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.h" | 5 #include "cc/layer.h" |
6 | 6 |
7 #include "cc/animation.h" | 7 #include "cc/animation.h" |
8 #include "cc/animation_events.h" | 8 #include "cc/animation_events.h" |
9 #include "cc/layer_animation_controller.h" | 9 #include "cc/layer_animation_controller.h" |
10 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 if (m_layerAnimationDelegate) | 867 if (m_layerAnimationDelegate) |
868 m_layerAnimationDelegate->notifyAnimationStarted(wallClockTime); | 868 m_layerAnimationDelegate->notifyAnimationStarted(wallClockTime); |
869 } | 869 } |
870 | 870 |
871 void Layer::notifyAnimationFinished(double wallClockTime) | 871 void Layer::notifyAnimationFinished(double wallClockTime) |
872 { | 872 { |
873 if (m_layerAnimationDelegate) | 873 if (m_layerAnimationDelegate) |
874 m_layerAnimationDelegate->notifyAnimationFinished(wallClockTime); | 874 m_layerAnimationDelegate->notifyAnimationFinished(wallClockTime); |
875 } | 875 } |
876 | 876 |
| 877 void Layer::notifyAnimationPropertyUpdate(const AnimationEvent& event) |
| 878 { |
| 879 if (event.targetProperty == Animation::Opacity) |
| 880 setOpacity(event.opacity); |
| 881 else |
| 882 setTransform(event.transform); |
| 883 } |
| 884 |
877 void Layer::addLayerAnimationEventObserver(LayerAnimationEventObserver* animatio
nObserver) | 885 void Layer::addLayerAnimationEventObserver(LayerAnimationEventObserver* animatio
nObserver) |
878 { | 886 { |
879 if (!m_layerAnimationObservers.HasObserver(animationObserver)) | 887 if (!m_layerAnimationObservers.HasObserver(animationObserver)) |
880 m_layerAnimationObservers.AddObserver(animationObserver); | 888 m_layerAnimationObservers.AddObserver(animationObserver); |
881 } | 889 } |
882 | 890 |
883 void Layer::removeLayerAnimationEventObserver(LayerAnimationEventObserver* anima
tionObserver) | 891 void Layer::removeLayerAnimationEventObserver(LayerAnimationEventObserver* anima
tionObserver) |
884 { | 892 { |
885 m_layerAnimationObservers.RemoveObserver(animationObserver); | 893 m_layerAnimationObservers.RemoveObserver(animationObserver); |
886 } | 894 } |
887 | 895 |
888 Region Layer::visibleContentOpaqueRegion() const | 896 Region Layer::visibleContentOpaqueRegion() const |
889 { | 897 { |
890 if (contentsOpaque()) | 898 if (contentsOpaque()) |
891 return visibleContentRect(); | 899 return visibleContentRect(); |
892 return Region(); | 900 return Region(); |
893 } | 901 } |
894 | 902 |
895 ScrollbarLayer* Layer::toScrollbarLayer() | 903 ScrollbarLayer* Layer::toScrollbarLayer() |
896 { | 904 { |
897 return 0; | 905 return 0; |
898 } | 906 } |
899 | 907 |
900 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) | 908 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) |
901 { | 909 { |
902 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. | 910 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. |
903 } | 911 } |
904 | 912 |
905 } // namespace cc | 913 } // namespace cc |
OLD | NEW |