OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 return false; | 1790 return false; |
1791 | 1791 |
1792 bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity); | 1792 bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity); |
1793 bool hasFilter = keyframes.containsProperty(CSSPropertyWebkitFilter); | 1793 bool hasFilter = keyframes.containsProperty(CSSPropertyWebkitFilter); |
1794 int animationId = m_animationProvider->getWebAnimationId(keyframes.animation
Name()); | 1794 int animationId = m_animationProvider->getWebAnimationId(keyframes.animation
Name()); |
1795 | 1795 |
1796 // Animating only some properties of the animation is not supported. So if t
he | 1796 // Animating only some properties of the animation is not supported. So if t
he |
1797 // GraphicsLayer rejects any property of the animation, we have to remove th
e | 1797 // GraphicsLayer rejects any property of the animation, we have to remove th
e |
1798 // animation and return false to indicate un-accelerated animation is requir
ed. | 1798 // animation and return false to indicate un-accelerated animation is requir
ed. |
1799 if (hasTransform) { | 1799 if (hasTransform) { |
1800 if (!animations.m_transformAnimation || !m_graphicsLayer->addAnimation(a
nimations.m_transformAnimation.get())) | 1800 if (!animations.m_transformAnimation || !m_graphicsLayer->addAnimation(a
nimations.m_transformAnimation.release())) |
1801 return false; | 1801 return false; |
1802 } | 1802 } |
1803 if (hasOpacity) { | 1803 if (hasOpacity) { |
1804 if (!animations.m_opacityAnimation || !m_graphicsLayer->addAnimation(ani
mations.m_opacityAnimation.get())) { | 1804 if (!animations.m_opacityAnimation || !m_graphicsLayer->addAnimation(ani
mations.m_opacityAnimation.release())) { |
1805 if (hasTransform) | 1805 if (hasTransform) |
1806 m_graphicsLayer->removeAnimation(animationId); | 1806 m_graphicsLayer->removeAnimation(animationId); |
1807 return false; | 1807 return false; |
1808 } | 1808 } |
1809 } | 1809 } |
1810 if (hasFilter) { | 1810 if (hasFilter) { |
1811 if (!animations.m_filterAnimation || !m_graphicsLayer->addAnimation(anim
ations.m_filterAnimation.get())) { | 1811 if (!animations.m_filterAnimation || !m_graphicsLayer->addAnimation(anim
ations.m_filterAnimation.release())) { |
1812 if (hasTransform || hasOpacity) | 1812 if (hasTransform || hasOpacity) |
1813 m_graphicsLayer->removeAnimation(animationId); | 1813 m_graphicsLayer->removeAnimation(animationId); |
1814 return false; | 1814 return false; |
1815 } | 1815 } |
1816 } | 1816 } |
1817 return true; | 1817 return true; |
1818 } | 1818 } |
1819 | 1819 |
1820 void CompositedLayerMapping::animationPaused(double timeOffset, const String& an
imationName) | 1820 void CompositedLayerMapping::animationPaused(double timeOffset, const String& an
imationName) |
1821 { | 1821 { |
(...skipping 20 matching lines...) Expand all Loading... |
1842 float fromOpacity = 0; | 1842 float fromOpacity = 0; |
1843 float toOpacity = 0; | 1843 float toOpacity = 0; |
1844 if (property == CSSPropertyOpacity) { | 1844 if (property == CSSPropertyOpacity) { |
1845 fromOpacity = compositingOpacity(fromStyle->opacity()); | 1845 fromOpacity = compositingOpacity(fromStyle->opacity()); |
1846 toOpacity = compositingOpacity(toStyle->opacity()); | 1846 toOpacity = compositingOpacity(toStyle->opacity()); |
1847 } | 1847 } |
1848 | 1848 |
1849 // Although KeyframeAnimation can have multiple properties of the animation,
ImplicitAnimation (= Transition) has only one animation property. | 1849 // Although KeyframeAnimation can have multiple properties of the animation,
ImplicitAnimation (= Transition) has only one animation property. |
1850 WebAnimations animations(m_animationProvider->startTransition(timeOffset, pr
operty, fromStyle, | 1850 WebAnimations animations(m_animationProvider->startTransition(timeOffset, pr
operty, fromStyle, |
1851 toStyle, m_owningLayer->hasTransform(), m_owningLayer->hasFilter(), boxS
ize, fromOpacity, toOpacity)); | 1851 toStyle, m_owningLayer->hasTransform(), m_owningLayer->hasFilter(), boxS
ize, fromOpacity, toOpacity)); |
1852 if (animations.m_transformAnimation && m_graphicsLayer->addAnimation(animati
ons.m_transformAnimation.get())) { | 1852 if (animations.m_transformAnimation && m_graphicsLayer->addAnimation(animati
ons.m_transformAnimation.release())) { |
1853 // To ensure that the correct transform is visible when the animation en
ds, also set the final transform. | 1853 // To ensure that the correct transform is visible when the animation en
ds, also set the final transform. |
1854 updateTransform(toStyle); | 1854 updateTransform(toStyle); |
1855 return true; | 1855 return true; |
1856 } | 1856 } |
1857 if (animations.m_opacityAnimation && m_graphicsLayer->addAnimation(animation
s.m_opacityAnimation.get())) { | 1857 if (animations.m_opacityAnimation && m_graphicsLayer->addAnimation(animation
s.m_opacityAnimation.release())) { |
1858 // To ensure that the correct opacity is visible when the animation ends
, also set the final opacity. | 1858 // To ensure that the correct opacity is visible when the animation ends
, also set the final opacity. |
1859 updateOpacity(toStyle); | 1859 updateOpacity(toStyle); |
1860 return true; | 1860 return true; |
1861 } | 1861 } |
1862 if (animations.m_filterAnimation && m_graphicsLayer->addAnimation(animations
.m_filterAnimation.get())) { | 1862 if (animations.m_filterAnimation && m_graphicsLayer->addAnimation(animations
.m_filterAnimation.release())) { |
1863 // To ensure that the correct filter is visible when the animation ends,
also set the final filter. | 1863 // To ensure that the correct filter is visible when the animation ends,
also set the final filter. |
1864 updateFilters(toStyle); | 1864 updateFilters(toStyle); |
1865 ASSERT_NOT_REACHED(); // Chromium compositor cannot accelerate filter ye
t. | 1865 ASSERT_NOT_REACHED(); // Chromium compositor cannot accelerate filter ye
t. |
1866 return false; | 1866 return false; |
1867 } | 1867 } |
1868 | 1868 |
1869 return false; | 1869 return false; |
1870 } | 1870 } |
1871 | 1871 |
1872 void CompositedLayerMapping::transitionPaused(double timeOffset, CSSPropertyID p
roperty) | 1872 void CompositedLayerMapping::transitionPaused(double timeOffset, CSSPropertyID p
roperty) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 1971 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
1972 name = "Scrolling Contents Layer"; | 1972 name = "Scrolling Contents Layer"; |
1973 } else { | 1973 } else { |
1974 ASSERT_NOT_REACHED(); | 1974 ASSERT_NOT_REACHED(); |
1975 } | 1975 } |
1976 | 1976 |
1977 return name; | 1977 return name; |
1978 } | 1978 } |
1979 | 1979 |
1980 } // namespace WebCore | 1980 } // namespace WebCore |
OLD | NEW |