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