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 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 return client ? client->isTrackingRepaints() : false; | 1734 return client ? client->isTrackingRepaints() : false; |
1735 } | 1735 } |
1736 | 1736 |
1737 #ifndef NDEBUG | 1737 #ifndef NDEBUG |
1738 void RenderLayerBacking::verifyNotPainting() | 1738 void RenderLayerBacking::verifyNotPainting() |
1739 { | 1739 { |
1740 ASSERT(!renderer()->frame()->page() || !renderer()->frame()->page()->isPaint
ing()); | 1740 ASSERT(!renderer()->frame()->page() || !renderer()->frame()->page()->isPaint
ing()); |
1741 } | 1741 } |
1742 #endif | 1742 #endif |
1743 | 1743 |
1744 bool RenderLayerBacking::startAnimation(double timeOffset, const Animation* anim
, const KeyframeList& keyframes) | 1744 bool RenderLayerBacking::startAnimation(double timeOffset, const PrimitiveAnimat
ion* anim, const KeyframeList& keyframes) |
1745 { | 1745 { |
1746 bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity); | 1746 bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity); |
1747 bool hasTransform = renderer()->isBox() && keyframes.containsProperty(CSSPro
pertyWebkitTransform); | 1747 bool hasTransform = renderer()->isBox() && keyframes.containsProperty(CSSPro
pertyWebkitTransform); |
1748 bool hasFilter = keyframes.containsProperty(CSSPropertyWebkitFilter); | 1748 bool hasFilter = keyframes.containsProperty(CSSPropertyWebkitFilter); |
1749 | 1749 |
1750 if (!hasOpacity && !hasTransform && !hasFilter) | 1750 if (!hasOpacity && !hasTransform && !hasFilter) |
1751 return false; | 1751 return false; |
1752 | 1752 |
1753 KeyframeValueList transformVector(AnimatedPropertyWebkitTransform); | 1753 KeyframeValueList transformVector(AnimatedPropertyWebkitTransform); |
1754 KeyframeValueList opacityVector(AnimatedPropertyOpacity); | 1754 KeyframeValueList opacityVector(AnimatedPropertyOpacity); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 | 1805 |
1806 bool RenderLayerBacking::startTransition(double timeOffset, CSSPropertyID proper
ty, const RenderStyle* fromStyle, const RenderStyle* toStyle) | 1806 bool RenderLayerBacking::startTransition(double timeOffset, CSSPropertyID proper
ty, const RenderStyle* fromStyle, const RenderStyle* toStyle) |
1807 { | 1807 { |
1808 bool didAnimateOpacity = false; | 1808 bool didAnimateOpacity = false; |
1809 bool didAnimateTransform = false; | 1809 bool didAnimateTransform = false; |
1810 bool didAnimateFilter = false; | 1810 bool didAnimateFilter = false; |
1811 | 1811 |
1812 ASSERT(property != CSSPropertyInvalid); | 1812 ASSERT(property != CSSPropertyInvalid); |
1813 | 1813 |
1814 if (property == CSSPropertyOpacity) { | 1814 if (property == CSSPropertyOpacity) { |
1815 const Animation* opacityAnim = toStyle->transitionForProperty(CSSPropert
yOpacity); | 1815 const PrimitiveAnimation* opacityAnim = toStyle->transitionForProperty(C
SSPropertyOpacity); |
1816 if (opacityAnim && !opacityAnim->isEmptyOrZeroDuration()) { | 1816 if (opacityAnim && !opacityAnim->isEmptyOrZeroDuration()) { |
1817 KeyframeValueList opacityVector(AnimatedPropertyOpacity); | 1817 KeyframeValueList opacityVector(AnimatedPropertyOpacity); |
1818 opacityVector.insert(new FloatAnimationValue(0, compositingOpacity(f
romStyle->opacity()))); | 1818 opacityVector.insert(new FloatAnimationValue(0, compositingOpacity(f
romStyle->opacity()))); |
1819 opacityVector.insert(new FloatAnimationValue(1, compositingOpacity(t
oStyle->opacity()))); | 1819 opacityVector.insert(new FloatAnimationValue(1, compositingOpacity(t
oStyle->opacity()))); |
1820 // The boxSize param is only used for transform animations (which ca
n only run on RenderBoxes), so we pass an empty size here. | 1820 // The boxSize param is only used for transform animations (which ca
n only run on RenderBoxes), so we pass an empty size here. |
1821 if (m_graphicsLayer->addAnimation(opacityVector, IntSize(), opacityA
nim, GraphicsLayer::animationNameForTransition(AnimatedPropertyOpacity), timeOff
set)) { | 1821 if (m_graphicsLayer->addAnimation(opacityVector, IntSize(), opacityA
nim, GraphicsLayer::animationNameForTransition(AnimatedPropertyOpacity), timeOff
set)) { |
1822 // To ensure that the correct opacity is visible when the animat
ion ends, also set the final opacity. | 1822 // To ensure that the correct opacity is visible when the animat
ion ends, also set the final opacity. |
1823 updateOpacity(toStyle); | 1823 updateOpacity(toStyle); |
1824 didAnimateOpacity = true; | 1824 didAnimateOpacity = true; |
1825 } | 1825 } |
1826 } | 1826 } |
1827 } | 1827 } |
1828 | 1828 |
1829 if (property == CSSPropertyWebkitTransform && m_owningLayer->hasTransform())
{ | 1829 if (property == CSSPropertyWebkitTransform && m_owningLayer->hasTransform())
{ |
1830 const Animation* transformAnim = toStyle->transitionForProperty(CSSPrope
rtyWebkitTransform); | 1830 const PrimitiveAnimation* transformAnim = toStyle->transitionForProperty
(CSSPropertyWebkitTransform); |
1831 if (transformAnim && !transformAnim->isEmptyOrZeroDuration()) { | 1831 if (transformAnim && !transformAnim->isEmptyOrZeroDuration()) { |
1832 KeyframeValueList transformVector(AnimatedPropertyWebkitTransform); | 1832 KeyframeValueList transformVector(AnimatedPropertyWebkitTransform); |
1833 transformVector.insert(new TransformAnimationValue(0, &fromStyle->tr
ansform())); | 1833 transformVector.insert(new TransformAnimationValue(0, &fromStyle->tr
ansform())); |
1834 transformVector.insert(new TransformAnimationValue(1, &toStyle->tran
sform())); | 1834 transformVector.insert(new TransformAnimationValue(1, &toStyle->tran
sform())); |
1835 if (m_graphicsLayer->addAnimation(transformVector, toRenderBox(rende
rer())->pixelSnappedBorderBoxRect().size(), transformAnim, GraphicsLayer::animat
ionNameForTransition(AnimatedPropertyWebkitTransform), timeOffset)) { | 1835 if (m_graphicsLayer->addAnimation(transformVector, toRenderBox(rende
rer())->pixelSnappedBorderBoxRect().size(), transformAnim, GraphicsLayer::animat
ionNameForTransition(AnimatedPropertyWebkitTransform), timeOffset)) { |
1836 // To ensure that the correct transform is visible when the anim
ation ends, also set the final transform. | 1836 // To ensure that the correct transform is visible when the anim
ation ends, also set the final transform. |
1837 updateTransform(toStyle); | 1837 updateTransform(toStyle); |
1838 didAnimateTransform = true; | 1838 didAnimateTransform = true; |
1839 } | 1839 } |
1840 } | 1840 } |
1841 } | 1841 } |
1842 | 1842 |
1843 if (property == CSSPropertyWebkitFilter && m_owningLayer->hasFilter()) { | 1843 if (property == CSSPropertyWebkitFilter && m_owningLayer->hasFilter()) { |
1844 const Animation* filterAnim = toStyle->transitionForProperty(CSSProperty
WebkitFilter); | 1844 const PrimitiveAnimation* filterAnim = toStyle->transitionForProperty(CS
SPropertyWebkitFilter); |
1845 if (filterAnim && !filterAnim->isEmptyOrZeroDuration()) { | 1845 if (filterAnim && !filterAnim->isEmptyOrZeroDuration()) { |
1846 KeyframeValueList filterVector(AnimatedPropertyWebkitFilter); | 1846 KeyframeValueList filterVector(AnimatedPropertyWebkitFilter); |
1847 filterVector.insert(new FilterAnimationValue(0, &fromStyle->filter()
)); | 1847 filterVector.insert(new FilterAnimationValue(0, &fromStyle->filter()
)); |
1848 filterVector.insert(new FilterAnimationValue(1, &toStyle->filter()))
; | 1848 filterVector.insert(new FilterAnimationValue(1, &toStyle->filter()))
; |
1849 if (m_graphicsLayer->addAnimation(filterVector, IntSize(), filterAni
m, GraphicsLayer::animationNameForTransition(AnimatedPropertyWebkitFilter), time
Offset)) { | 1849 if (m_graphicsLayer->addAnimation(filterVector, IntSize(), filterAni
m, GraphicsLayer::animationNameForTransition(AnimatedPropertyWebkitFilter), time
Offset)) { |
1850 // To ensure that the correct filter is visible when the animati
on ends, also set the final filter. | 1850 // To ensure that the correct filter is visible when the animati
on ends, also set the final filter. |
1851 updateFilters(toStyle); | 1851 updateFilters(toStyle); |
1852 didAnimateFilter = true; | 1852 didAnimateFilter = true; |
1853 } | 1853 } |
1854 } | 1854 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1988 info.addMember(m_childContainmentLayer, "childContainmentLayer"); | 1988 info.addMember(m_childContainmentLayer, "childContainmentLayer"); |
1989 info.addMember(m_maskLayer, "maskLayer"); | 1989 info.addMember(m_maskLayer, "maskLayer"); |
1990 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar")
; | 1990 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar")
; |
1991 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); | 1991 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); |
1992 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); | 1992 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); |
1993 info.addMember(m_scrollingLayer, "scrollingLayer"); | 1993 info.addMember(m_scrollingLayer, "scrollingLayer"); |
1994 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); | 1994 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); |
1995 } | 1995 } |
1996 | 1996 |
1997 } // namespace WebCore | 1997 } // namespace WebCore |
OLD | NEW |