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 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 return false; | 1787 return false; |
1788 | 1788 |
1789 bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity); | 1789 bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity); |
1790 bool hasFilter = keyframes.containsProperty(CSSPropertyWebkitFilter); | 1790 bool hasFilter = keyframes.containsProperty(CSSPropertyWebkitFilter); |
1791 int animationId = m_animationProvider->getWebAnimationId(keyframes.animation
Name()); | 1791 int animationId = m_animationProvider->getWebAnimationId(keyframes.animation
Name()); |
1792 | 1792 |
1793 // Animating only some properties of the animation is not supported. So if t
he | 1793 // Animating only some properties of the animation is not supported. So if t
he |
1794 // GraphicsLayer rejects any property of the animation, we have to remove th
e | 1794 // GraphicsLayer rejects any property of the animation, we have to remove th
e |
1795 // animation and return false to indicate un-accelerated animation is requir
ed. | 1795 // animation and return false to indicate un-accelerated animation is requir
ed. |
1796 if (hasTransform) { | 1796 if (hasTransform) { |
1797 if (!animations.m_transformAnimation || !m_graphicsLayer->addAnimation(a
nimations.m_transformAnimation.get())) | 1797 if (!animations.m_transformAnimation || !m_graphicsLayer->addAnimation(a
nimations.m_transformAnimation.release())) |
1798 return false; | 1798 return false; |
1799 } | 1799 } |
1800 if (hasOpacity) { | 1800 if (hasOpacity) { |
1801 if (!animations.m_opacityAnimation || !m_graphicsLayer->addAnimation(ani
mations.m_opacityAnimation.get())) { | 1801 if (!animations.m_opacityAnimation || !m_graphicsLayer->addAnimation(ani
mations.m_opacityAnimation.release())) { |
1802 if (hasTransform) | 1802 if (hasTransform) |
1803 m_graphicsLayer->removeAnimation(animationId); | 1803 m_graphicsLayer->removeAnimation(animationId); |
1804 return false; | 1804 return false; |
1805 } | 1805 } |
1806 } | 1806 } |
1807 if (hasFilter) { | 1807 if (hasFilter) { |
1808 if (!animations.m_filterAnimation || !m_graphicsLayer->addAnimation(anim
ations.m_filterAnimation.get())) { | 1808 if (!animations.m_filterAnimation || !m_graphicsLayer->addAnimation(anim
ations.m_filterAnimation.release())) { |
1809 if (hasTransform || hasOpacity) | 1809 if (hasTransform || hasOpacity) |
1810 m_graphicsLayer->removeAnimation(animationId); | 1810 m_graphicsLayer->removeAnimation(animationId); |
1811 return false; | 1811 return false; |
1812 } | 1812 } |
1813 } | 1813 } |
1814 return true; | 1814 return true; |
1815 } | 1815 } |
1816 | 1816 |
1817 void CompositedLayerMapping::animationPaused(double timeOffset, const String& an
imationName) | 1817 void CompositedLayerMapping::animationPaused(double timeOffset, const String& an
imationName) |
1818 { | 1818 { |
(...skipping 20 matching lines...) Expand all Loading... |
1839 float fromOpacity = 0; | 1839 float fromOpacity = 0; |
1840 float toOpacity = 0; | 1840 float toOpacity = 0; |
1841 if (property == CSSPropertyOpacity) { | 1841 if (property == CSSPropertyOpacity) { |
1842 fromOpacity = compositingOpacity(fromStyle->opacity()); | 1842 fromOpacity = compositingOpacity(fromStyle->opacity()); |
1843 toOpacity = compositingOpacity(toStyle->opacity()); | 1843 toOpacity = compositingOpacity(toStyle->opacity()); |
1844 } | 1844 } |
1845 | 1845 |
1846 // Although KeyframeAnimation can have multiple properties of the animation,
ImplicitAnimation (= Transition) has only one animation property. | 1846 // Although KeyframeAnimation can have multiple properties of the animation,
ImplicitAnimation (= Transition) has only one animation property. |
1847 WebAnimations animations(m_animationProvider->startTransition(timeOffset, pr
operty, fromStyle, | 1847 WebAnimations animations(m_animationProvider->startTransition(timeOffset, pr
operty, fromStyle, |
1848 toStyle, m_owningLayer->hasTransform(), m_owningLayer->hasFilter(), boxS
ize, fromOpacity, toOpacity)); | 1848 toStyle, m_owningLayer->hasTransform(), m_owningLayer->hasFilter(), boxS
ize, fromOpacity, toOpacity)); |
1849 if (animations.m_transformAnimation && m_graphicsLayer->addAnimation(animati
ons.m_transformAnimation.get())) { | 1849 if (animations.m_transformAnimation && m_graphicsLayer->addAnimation(animati
ons.m_transformAnimation.release())) { |
1850 // To ensure that the correct transform is visible when the animation en
ds, also set the final transform. | 1850 // To ensure that the correct transform is visible when the animation en
ds, also set the final transform. |
1851 updateTransform(toStyle); | 1851 updateTransform(toStyle); |
1852 return true; | 1852 return true; |
1853 } | 1853 } |
1854 if (animations.m_opacityAnimation && m_graphicsLayer->addAnimation(animation
s.m_opacityAnimation.get())) { | 1854 if (animations.m_opacityAnimation && m_graphicsLayer->addAnimation(animation
s.m_opacityAnimation.release())) { |
1855 // To ensure that the correct opacity is visible when the animation ends
, also set the final opacity. | 1855 // To ensure that the correct opacity is visible when the animation ends
, also set the final opacity. |
1856 updateOpacity(toStyle); | 1856 updateOpacity(toStyle); |
1857 return true; | 1857 return true; |
1858 } | 1858 } |
1859 if (animations.m_filterAnimation && m_graphicsLayer->addAnimation(animations
.m_filterAnimation.get())) { | 1859 if (animations.m_filterAnimation && m_graphicsLayer->addAnimation(animations
.m_filterAnimation.release())) { |
1860 // To ensure that the correct filter is visible when the animation ends,
also set the final filter. | 1860 // To ensure that the correct filter is visible when the animation ends,
also set the final filter. |
1861 updateFilters(toStyle); | 1861 updateFilters(toStyle); |
1862 ASSERT_NOT_REACHED(); // Chromium compositor cannot accelerate filter ye
t. | 1862 ASSERT_NOT_REACHED(); // Chromium compositor cannot accelerate filter ye
t. |
1863 return false; | 1863 return false; |
1864 } | 1864 } |
1865 | 1865 |
1866 return false; | 1866 return false; |
1867 } | 1867 } |
1868 | 1868 |
1869 void CompositedLayerMapping::transitionPaused(double timeOffset, CSSPropertyID p
roperty) | 1869 void CompositedLayerMapping::transitionPaused(double timeOffset, CSSPropertyID p
roperty) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1973 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 1973 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
1974 name = "Scrolling Contents Layer"; | 1974 name = "Scrolling Contents Layer"; |
1975 } else { | 1975 } else { |
1976 ASSERT_NOT_REACHED(); | 1976 ASSERT_NOT_REACHED(); |
1977 } | 1977 } |
1978 | 1978 |
1979 return name; | 1979 return name; |
1980 } | 1980 } |
1981 | 1981 |
1982 } // namespace WebCore | 1982 } // namespace WebCore |
OLD | NEW |