haikuwebkit/LayoutTests/css3/filters/filter-animation-from-none-...

153 lines
4.2 KiB
HTML
Raw Permalink Normal View History

[Web Animations] Turn Web Animations with CSS integration on https://bugs.webkit.org/show_bug.cgi?id=184819 <rdar://problem/39597337> Reviewed by Dean Jackson. LayoutTests/imported/mozilla: * css-animations/test_animation-cancel.html: * css-animations/test_animation-computed-timing.html: * css-animations/test_animation-currenttime.html: * css-animations/test_animation-finish.html: * css-animations/test_animation-finished.html: * css-animations/test_animation-id.html: * css-animations/test_animation-pausing.html: * css-animations/test_animation-playstate.html: * css-animations/test_animation-ready.html: * css-animations/test_animation-reverse.html: * css-animations/test_animation-starttime.html: * css-animations/test_animations-dynamic-changes.html: * css-animations/test_cssanimation-animationname.html: * css-animations/test_document-get-animations.html: * css-animations/test_effect-target.html: * css-animations/test_element-get-animations.html: * css-animations/test_event-dispatch.html: * css-animations/test_event-order.html: * css-animations/test_keyframeeffect-getkeyframes.html: * css-animations/test_pseudoElement-get-animations.html: * css-animations/test_setting-effect.html: * css-transitions/test_animation-cancel.html: * css-transitions/test_animation-computed-timing.html: * css-transitions/test_animation-currenttime.html: * css-transitions/test_animation-finished.html: * css-transitions/test_animation-pausing.html: * css-transitions/test_animation-ready.html: * css-transitions/test_animation-starttime.html: * css-transitions/test_csstransition-transitionproperty.html: * css-transitions/test_document-get-animations.html: * css-transitions/test_effect-target.html: * css-transitions/test_element-get-animations.html: * css-transitions/test_event-dispatch.html: * css-transitions/test_keyframeeffect-getkeyframes.html: * css-transitions/test_pseudoElement-get-animations.html: * css-transitions/test_setting-effect.html: LayoutTests/imported/w3c: * web-platform-tests/css-timing-1/frames-timing-functions-output.html: * web-platform-tests/css/css-logical/animation-003.tentative.html: * web-platform-tests/css/css-scoping/keyframes-001.html: * web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context.html: * web-platform-tests/web-animations/interfaces/Animatable/animate.html: * web-platform-tests/web-animations/timing-model/animations/current-time.html: Source/WebCore: * page/RuntimeEnabledFeatures.h: Source/WebKit: * Shared/WebPreferences.yaml: Source/WebKitLegacy/mac: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): Source/WebKitLegacy/win: * WebPreferences.cpp: (WebPreferences::initializeDefaultSettings): Tools: * DumpRenderTree/TestOptions.h: LayoutTests: * TestExpectations: * animations/3d/matrix-transform-type-animation.html: * animations/3d/replace-filling-transform.html: * animations/3d/transform-origin-vs-functions.html: * animations/3d/transform-perspective.html: * animations/additive-transform-animations.html: * animations/animation-border-overflow.html: * animations/animation-callback-timestamp.html: * animations/animation-controller-drt-api.html: * animations/animation-direction-alternate-reverse-expected.txt: * animations/animation-direction-alternate-reverse.html: * animations/animation-direction-reverse-fill-mode-hardware.html: * animations/animation-direction-reverse-hardware-opacity.html: * animations/animation-direction-reverse-hardware.html: * animations/animation-direction-reverse-non-hardware.html: * animations/animation-direction-reverse-timing-functions-hardware.html: * animations/animation-direction-reverse-timing-functions.html: * animations/animation-direction.html: * animations/animation-followed-by-transition.html: * animations/animation-hit-test-transform.html: * animations/animation-hit-test.html: * animations/animation-internals-api-expected.txt: Removed. * animations/animation-internals-api-multiple-keyframes-expected.txt: Removed. * animations/animation-internals-api-multiple-keyframes.html: Removed. * animations/animation-internals-api.html: Removed. * animations/animation-offscreen-to-onscreen.html: * animations/animation-playstate-paused-style-resolution.html: * animations/big-rotation-expected.txt: * animations/big-rotation.html: * animations/change-completed-animation-transform.html: * animations/change-keyframes.html: * animations/combo-transform-rotate+scale.html: * animations/cross-fade-background-image.html: * animations/cross-fade-border-image-source.html: * animations/cross-fade-list-style-image.html: * animations/cross-fade-webkit-mask-box-image.html: * animations/duplicate-keys-expected.html: * animations/duplicate-keys.html: * animations/duplicated-keyframes-name.html: * animations/fill-forwards-end-state.html: * animations/fill-mode-forwards-zero-duration-expected.txt: * animations/fill-mode-forwards-zero-duration.html: * animations/fill-mode-removed.html: * animations/font-variations/font-stretch.html: * animations/font-variations/font-style.html: * animations/font-variations/font-variation-settings-order.html: * animations/font-variations/font-variation-settings-unlike.html: * animations/font-variations/font-variation-settings.html: * animations/font-variations/font-weight.html: * animations/generic-from-to.html: * animations/import.html: * animations/keyframe-multiple-timing-functions-transform.html: * animations/keyframe-timing-functions-transform.html: * animations/keyframe-timing-functions.html: * animations/keyframe-timing-functions2.html: * animations/keyframes-comma-separated.html: * animations/keyframes-dynamic.html: * animations/keyframes-infinite-iterations.html: * animations/keyframes-invalid-keys.html: * animations/keyframes-out-of-order.html: * animations/keyframes.html: * animations/leak-document-with-css-animation.html: * animations/lineheight-animation.html: * animations/longhand-timing-function.html: * animations/matrix-anim.html: * animations/missing-from-to-transforms.html: * animations/missing-from-to.html: * animations/missing-keyframe-properties-repeating.html: * animations/missing-keyframe-properties-timing-function.html: * animations/missing-keyframe-properties.html: * animations/missing-values-first-keyframe.html: * animations/missing-values-last-keyframe.html: * animations/multiple-animations-timing-function.html: * animations/multiple-animations.html: * animations/multiple-keyframes.html: * animations/negative-delay.html: * animations/pause-crash.html: * animations/play-state-start-paused.html: * animations/resources/animation-leak-iframe.html: * animations/simultaneous-start-left.html: * animations/simultaneous-start-transform.html: * animations/spring-function.html: * animations/stacking-context-unchanged-while-running.html: * animations/stop-animation-on-suspend.html: * animations/suspend-resume-animation-events.html: * animations/timing-functions.html: * animations/transition-and-animation-1.html: * animations/transition-and-animation-2.html: * animations/transition-and-animation-3.html: * animations/trigger-container-scroll-boundaries.html: * animations/trigger-container-scroll-empty.html: * animations/trigger-container-scroll-simple.html: * animations/unanimated-style.html: * animations/unprefixed-keyframes.html: * animations/width-using-ems.html: * compositing/animation/animated-composited-inside-hidden.html: * compositing/animation/computed-style-during-delay.html: * compositing/animation/layer-for-filling-animation.html: * compositing/backing/backface-visibility-flip.html: * compositing/backing/transform-transition-from-outside-view.html: * compositing/contents-scale/animating.html: * compositing/layer-creation/animation-overlap-with-children.html: * compositing/layer-creation/mismatched-rotated-transform-animation-overlap.html: * compositing/layer-creation/mismatched-rotated-transform-transition-overlap.html: * compositing/layer-creation/mismatched-transform-transition-overlap.html: * compositing/layer-creation/multiple-keyframes-animation-overlap.html: * compositing/layer-creation/overlap-animation-clipping.html: * compositing/layer-creation/overlap-animation-container.html: * compositing/layer-creation/overlap-animation.html: * compositing/layer-creation/scale-rotation-animation-overlap.html: * compositing/layer-creation/scale-rotation-transition-overlap.html: * compositing/layer-creation/translate-animation-overlap.html: * compositing/layer-creation/translate-scale-animation-overlap.html: * compositing/layer-creation/translate-scale-transition-overlap.html: * compositing/layer-creation/translate-transition-overlap.html: * compositing/overflow/overflow-positioning.html: * compositing/reflections/animation-inside-reflection.html: * compositing/reflections/nested-reflection-animated.html: * compositing/reflections/nested-reflection-transition.html: * compositing/scrolling/touch-scroll-to-clip.html: * compositing/transitions/scale-transition-no-start.html: * compositing/transitions/singular-scale-transition.html: * compositing/visible-rect/animated-from-none.html: * compositing/visible-rect/animated.html: * css3/calc/transitions-dependent.html: * css3/calc/transitions.html: * css3/filters/backdrop/animation.html: * css3/filters/composited-during-animation.html: * css3/filters/filter-animation-from-none-hw.html: * css3/filters/filter-animation-from-none-multi-hw.html: * css3/filters/filter-animation-from-none-multi.html: * css3/filters/filter-animation-from-none.html: * css3/filters/filter-animation-hw.html: * css3/filters/filter-animation-multi-hw.html: * css3/filters/filter-animation-multi.html: * css3/filters/filter-animation.html: * css3/masking/clip-path-animation.html: * fast/animation/css-animation-resuming-when-visible-with-style-change.html: * fast/animation/css-animation-resuming-when-visible-with-style-change2.html: * fast/animation/css-animation-resuming-when-visible.html: * fast/animation/css-animation-throttling-lowPowerMode.html: * fast/animation/height-auto-transition-computed-value.html: * fast/css-generated-content/pseudo-animation.html: * fast/css-generated-content/pseudo-transition.html: * fast/filter-image/filter-image-animation.html: * fast/shapes/shape-outside-floats/shape-outside-animation.html: * fast/shapes/shape-outside-floats/shape-outside-shape-image-threshold-animation.html: * fast/shapes/shape-outside-floats/shape-outside-shape-margin-animation.html: * http/wpt/css/css-animations/start-animation-001.html: * imported/blink/transitions/transition-not-interpolable.html: * imported/blink/transitions/unprefixed-transform.html: * platform/ios/TestExpectations: * platform/win/TestExpectations: * transitions/remove-transition-style.html: * transitions/transition-drt-api-delay-expected.txt: Removed. * transitions/transition-drt-api-delay.html: Removed. * transitions/transition-drt-api-expected.txt: Removed. * transitions/transition-drt-api.html: Removed. * transitions/zero-duration-with-non-zero-delay-end.html: Canonical link: https://commits.webkit.org/204981@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236541 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-27 09:49:52 +00:00
<!DOCTYPE html>
Implement hardware animation of CSS filters https://bugs.webkit.org/show_bug.cgi?id=78155 Source/WebCore: Added logic to PlatformCAAnimation to return enough information to GraphicsLayerCA to be able to construct a keyPath animation for each filter property. Some filters need to animate multiple properties per filter, so PlatformCAAnimation also returns the number of properties per filter and then an animation is constructed for each one. Also added all the support logic to handle hardware filter animation in the higher level logic, just like we do for transforms and opacity. Also stubbed out new PlatformCAAnimation functions for Windows. We don't yet support hardware filters on Windows. Reviewed by Dean Jackson. Tests: css3/filters/filter-animation-from-none-hw.html css3/filters/filter-animation-from-none-multi-hw.html css3/filters/filter-animation-from-none-multi.html css3/filters/filter-animation-hw.html css3/filters/filter-animation-multi-hw.html css3/filters/filter-animation-multi.html * page/animation/AnimationBase.cpp: (WebCore): (PropertyWrapperAcceleratedFilter): (WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): (WebCore::PropertyWrapperAcceleratedFilter::animationIsAccelerated): (WebCore::PropertyWrapperAcceleratedFilter::blend): (WebCore::AnimationBase::ensurePropertyMap): * platform/graphics/GraphicsLayer.cpp: (WebCore): (WebCore::filterOperationsAt): (WebCore::GraphicsLayer::validateFilterOperations): * platform/graphics/GraphicsLayer.h: (WebCore): (FilterAnimationValue): (WebCore::FilterAnimationValue::FilterAnimationValue): (WebCore::FilterAnimationValue::clone): (WebCore::FilterAnimationValue::value): (GraphicsLayer): * platform/graphics/GraphicsLayerClient.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::propertyIdToString): (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::addAnimation): (WebCore::GraphicsLayerCA::ensureStructuralLayer): (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore): (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes): (WebCore::GraphicsLayerCA::createBasicAnimation): (WebCore::GraphicsLayerCA::createKeyframeAnimation): (WebCore::GraphicsLayerCA::setFilterAnimationEndpoints): (WebCore::GraphicsLayerCA::setFilterAnimationKeyframes): (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): (WebCore::GraphicsLayerCA::cloneLayer): * platform/graphics/ca/GraphicsLayerCA.h: (GraphicsLayerCA): * platform/graphics/ca/PlatformCAAnimation.h: (PlatformCAAnimation): * platform/graphics/ca/mac/PlatformCAAnimationMac.mm: (PlatformCAAnimation::setFromValue): (PlatformCAAnimation::setToValue): (PlatformCAAnimation::setValues): (PlatformCAAnimation::numAnimatedFilterProperties): (PlatformCAAnimation::animatedFilterPropertyName): * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: (PlatformCAAnimation::setFromValue): (PlatformCAAnimation::setToValue): (PlatformCAAnimation::setValues): (PlatformCAAnimation::numAnimatedFilterProperties): (PlatformCAAnimation::animatedFilterPropertyName): * platform/graphics/filters/FilterOperation.h: (FilterOperation): (WebCore::FilterOperation::isDefault): (DefaultFilterOperation): (WebCore::DefaultFilterOperation::create): (WebCore::DefaultFilterOperation::operator==): (WebCore::DefaultFilterOperation::isDefault): (WebCore::DefaultFilterOperation::DefaultFilterOperation): (WebCore): * rendering/RenderLayer.h: (WebCore::RenderLayer::hasFilter): (RenderLayer): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::startAnimation): (WebCore::RenderLayerBacking::startTransition): (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty): (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty): LayoutTests: New tests for hardware animated filters, cribbed from software animation tests. Also added a -multi test, which uses 3 keyframes for each filter. Hardware animations use the same logic for 2 keyframe animations and transitions, so this exercises the other logic path. Reviewed by Dean Jackson. * css3/filters/filter-animation-from-none-hw-expected.txt: Added. * css3/filters/filter-animation-from-none-hw.html: Added. * css3/filters/filter-animation-from-none-multi-expected.txt: Added. * css3/filters/filter-animation-from-none-multi-hw-expected.txt: Added. * css3/filters/filter-animation-from-none-multi-hw.html: Added. * css3/filters/filter-animation-from-none-multi.html: Added. * css3/filters/filter-animation-hw-expected.txt: Added. * css3/filters/filter-animation-hw.html: Added. * css3/filters/filter-animation-multi-expected.txt: Added. * css3/filters/filter-animation-multi-hw-expected.txt: Added. * css3/filters/filter-animation-multi-hw.html: Added. * css3/filters/filter-animation-multi.html: Added. Canonical link: https://commits.webkit.org/95288@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-10 19:41:35 +00:00
<html>
<head>
<style>
.box {
height: 100px;
width: 100px;
margin: 10px;
background-color: blue;
display: inline-block;
-webkit-transform:translateZ(0);
}
#grayscale-box {
-webkit-animation: grayscale-anim 2s linear
}
#sepia-box {
-webkit-animation: sepia-anim 2s linear
}
#saturate-box {
-webkit-animation: saturate-anim 2s linear
}
#huerotate-box {
-webkit-animation: huerotate-anim 2s linear
}
#invert-box {
-webkit-animation: invert-anim 2s linear
}
#opacity-box {
-webkit-animation: opacity-anim 2s linear
}
#brightness-box {
-webkit-animation: brightness-anim 2s linear
}
#contrast-box {
-webkit-animation: contrast-anim 2s linear
}
#blur-box {
-webkit-animation: blur-anim 2s linear
}
#dropshadow-box {
-webkit-animation: dropshadow-anim 2s linear
}
@-webkit-keyframes grayscale-anim {
from { }
50% { -webkit-filter: grayscale(0.5); }
to { -webkit-filter: grayscale(1); }
}
@-webkit-keyframes sepia-anim {
from { }
50% { -webkit-filter: sepia(0.5); }
to { -webkit-filter: sepia(1); }
}
@-webkit-keyframes saturate-anim {
from { }
50% { -webkit-filter: saturate(0.5); }
to { -webkit-filter: saturate(1); }
}
@-webkit-keyframes huerotate-anim {
from { }
50% { -webkit-filter: hue-rotate(90deg); }
to { -webkit-filter: hue-rotate(180deg); }
}
@-webkit-keyframes invert-anim {
from { }
50% { -webkit-filter: invert(0.5); }
to { -webkit-filter: invert(1); }
}
@-webkit-keyframes opacity-anim {
from { }
50% { -webkit-filter: opacity(0.5); }
to { -webkit-filter: opacity(0); }
}
@-webkit-keyframes brightness-anim {
from { }
50% { -webkit-filter: brightness(0.5); }
to { -webkit-filter: brightness(0); }
}
@-webkit-keyframes contrast-anim {
from { }
50% { -webkit-filter: contrast(0.5); }
to { -webkit-filter: contrast(0); }
}
@-webkit-keyframes blur-anim {
from { }
50% { -webkit-filter: blur(10px); }
to { -webkit-filter: blur(20px); }
}
@-webkit-keyframes dropshadow-anim {
from { }
50% { -webkit-filter: grayscale(10px 15px 5px rgba(128, 128, 128, 0.5); }
to { -webkit-filter: drop-shadow(20px 30px 10px black)); }
}
</style>
<script src="../../animations/resources/animation-test-helpers.js"></script>
<script type="text/javascript">
const expectedValues = [
// [animation-name, time, element-id, property, expected-value, tolerance]
["grayscale-anim", 0.5, "grayscale-box", "webkitFilter", 'grayscale(0.25)', 0.05],
["sepia-anim", 0.5, "sepia-box", "webkitFilter", 'sepia(0.25)', 0.05],
["saturate-anim", 0.5, "saturate-box", "webkitFilter", 'saturate(0.75)', 0.05],
Animate CSS Image filter() function https://bugs.webkit.org/show_bug.cgi?id=119938 Reviewed by Simon Fraser. Source/WebCore: With this patch, the new introduced CSS Image function filter() can be animated. According to the spec, just filter functions can be interpolated. The patch also prepares StyleImage blending for interpolation of other generated images like gradients or cross-fade(). http://dev.w3.org/fxtf/filters/#interpolating-filter-image Test: fast/filter-image/filter-image-animation.html * css/CSSComputedStyleDeclaration.cpp: Reuse the code that creates a CSSValueList from ComputeStyle logic. (WebCore::valueForPixel): For StyleRules we want to have not-adjusted length values. (WebCore::ComputedStyleExtractor::valueForShadow): Add argument to switch between adjusted and not-adjusted length. (WebCore::ComputedStyleExtractor::valueForFilter): Ditto. (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSComputedStyleDeclaration.h: * css/CSSFilterImageValue.h: Add helper functions for animating filters. We need to pass the FilterOperations for the image generation and the CSSValueList for StyleRule. (WebCore::CSSFilterImageValue::filterOperations): (WebCore::CSSFilterImageValue::setFilterOperations): (WebCore::CSSFilterImageValue::cachedImage): * page/animation/CSSPropertyAnimation.cpp: Add animation code to support animations between two filter() function values. (WebCore::blendFilterOperations): (WebCore::blendFunc): (WebCore::filterBlend): * rendering/style/StyleGeneratedImage.h: Add helper functions. (WebCore::CSSFilterImageValue::imageValue): LayoutTests: Add tests to test animation between two filter() function values. Furthermore, extended animation-test-helpers.js to parse all kind of CSS image function where we support animations. CSS Image function can be deeply nested as well now: -wekit-filter(-webkit-cross-fade(url(a.png), url(b.png), 50%), sepia(0.5)) Even the 50% can now be checked with a tolerance. If we should ever support animations on nested CSS Images, the new code in animation-test-helpers.js is prepared for it. Fixed a bunch of tests that passed by accident or needed an update to the new infrastructure. * animations/resources/animation-test-helpers.js: (parseCSSImage): For parsing of all kind of supported CSS Image functions. Currently supported: -webkit-cross-fade, -webkit-filter, url, none Still missing: linear and radial gradients (can not be animated yet). CSS Image functions are allowed to be nested as deep JS allows. (parseCrossFade): Add parsing of input CSS images. (parseFilterImage): Parse -webkit-filter image function as well as input images. (parseFilterFunctionList): Parse filter function list. We now parse the function name as well. Added rudimentary support for drop-shadow and url. (parseDeprecatedCustomFilterFunction): Special case old syntax of custom filter function. Shall be removed in the future. (compareCSSImages): Compares all kind (even deep nested) CSS images. (compareFilterFunctions): Now compare filter function names as well. (comparePropertyValue): Use new compareCSSImages function. * fast/filter-image/filter-image-animation-expected.txt: Added. * fast/filter-image/filter-image-animation.html: Added. Canonical link: https://commits.webkit.org/138534@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-30 19:29:03 +00:00
["huerotate-anim", 0.5, "huerotate-box", "webkitFilter", 'hue-rotate(45deg)', 3],
Implement hardware animation of CSS filters https://bugs.webkit.org/show_bug.cgi?id=78155 Source/WebCore: Added logic to PlatformCAAnimation to return enough information to GraphicsLayerCA to be able to construct a keyPath animation for each filter property. Some filters need to animate multiple properties per filter, so PlatformCAAnimation also returns the number of properties per filter and then an animation is constructed for each one. Also added all the support logic to handle hardware filter animation in the higher level logic, just like we do for transforms and opacity. Also stubbed out new PlatformCAAnimation functions for Windows. We don't yet support hardware filters on Windows. Reviewed by Dean Jackson. Tests: css3/filters/filter-animation-from-none-hw.html css3/filters/filter-animation-from-none-multi-hw.html css3/filters/filter-animation-from-none-multi.html css3/filters/filter-animation-hw.html css3/filters/filter-animation-multi-hw.html css3/filters/filter-animation-multi.html * page/animation/AnimationBase.cpp: (WebCore): (PropertyWrapperAcceleratedFilter): (WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): (WebCore::PropertyWrapperAcceleratedFilter::animationIsAccelerated): (WebCore::PropertyWrapperAcceleratedFilter::blend): (WebCore::AnimationBase::ensurePropertyMap): * platform/graphics/GraphicsLayer.cpp: (WebCore): (WebCore::filterOperationsAt): (WebCore::GraphicsLayer::validateFilterOperations): * platform/graphics/GraphicsLayer.h: (WebCore): (FilterAnimationValue): (WebCore::FilterAnimationValue::FilterAnimationValue): (WebCore::FilterAnimationValue::clone): (WebCore::FilterAnimationValue::value): (GraphicsLayer): * platform/graphics/GraphicsLayerClient.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::propertyIdToString): (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::addAnimation): (WebCore::GraphicsLayerCA::ensureStructuralLayer): (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore): (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes): (WebCore::GraphicsLayerCA::createBasicAnimation): (WebCore::GraphicsLayerCA::createKeyframeAnimation): (WebCore::GraphicsLayerCA::setFilterAnimationEndpoints): (WebCore::GraphicsLayerCA::setFilterAnimationKeyframes): (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): (WebCore::GraphicsLayerCA::cloneLayer): * platform/graphics/ca/GraphicsLayerCA.h: (GraphicsLayerCA): * platform/graphics/ca/PlatformCAAnimation.h: (PlatformCAAnimation): * platform/graphics/ca/mac/PlatformCAAnimationMac.mm: (PlatformCAAnimation::setFromValue): (PlatformCAAnimation::setToValue): (PlatformCAAnimation::setValues): (PlatformCAAnimation::numAnimatedFilterProperties): (PlatformCAAnimation::animatedFilterPropertyName): * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: (PlatformCAAnimation::setFromValue): (PlatformCAAnimation::setToValue): (PlatformCAAnimation::setValues): (PlatformCAAnimation::numAnimatedFilterProperties): (PlatformCAAnimation::animatedFilterPropertyName): * platform/graphics/filters/FilterOperation.h: (FilterOperation): (WebCore::FilterOperation::isDefault): (DefaultFilterOperation): (WebCore::DefaultFilterOperation::create): (WebCore::DefaultFilterOperation::operator==): (WebCore::DefaultFilterOperation::isDefault): (WebCore::DefaultFilterOperation::DefaultFilterOperation): (WebCore): * rendering/RenderLayer.h: (WebCore::RenderLayer::hasFilter): (RenderLayer): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::startAnimation): (WebCore::RenderLayerBacking::startTransition): (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty): (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty): LayoutTests: New tests for hardware animated filters, cribbed from software animation tests. Also added a -multi test, which uses 3 keyframes for each filter. Hardware animations use the same logic for 2 keyframe animations and transitions, so this exercises the other logic path. Reviewed by Dean Jackson. * css3/filters/filter-animation-from-none-hw-expected.txt: Added. * css3/filters/filter-animation-from-none-hw.html: Added. * css3/filters/filter-animation-from-none-multi-expected.txt: Added. * css3/filters/filter-animation-from-none-multi-hw-expected.txt: Added. * css3/filters/filter-animation-from-none-multi-hw.html: Added. * css3/filters/filter-animation-from-none-multi.html: Added. * css3/filters/filter-animation-hw-expected.txt: Added. * css3/filters/filter-animation-hw.html: Added. * css3/filters/filter-animation-multi-expected.txt: Added. * css3/filters/filter-animation-multi-hw-expected.txt: Added. * css3/filters/filter-animation-multi-hw.html: Added. * css3/filters/filter-animation-multi.html: Added. Canonical link: https://commits.webkit.org/95288@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-10 19:41:35 +00:00
["invert-anim", 0.5, "invert-box", "webkitFilter", 'invert(0.25)', 0.05],
["opacity-anim", 0.5, "opacity-box", "webkitFilter", 'opacity(0.75)', 0.05],
["brightness-anim", 0.5, "brightness-box", "webkitFilter", 'brightness(0.75)', 0.05],
["contrast-anim", 0.5, "contrast-box", "webkitFilter", 'contrast(0.75)', 0.05],
["blur-anim", 0.5, "blur-box", "webkitFilter", 'blur(5px)', 1],
// FIXME when we implement computed filter style for drop-shadow.
// ["dropshadow-anim", 1, "dropshadow-box", "webkitFilter", 'drop-shadow(rgba(0, 0, 0, 0.25) 5px 8px 3px )', 2],
];
runAnimationTest(expectedValues);
</script>
</head>
<body>
<div class="box" id="grayscale-box"></div>
<div class="box" id="sepia-box"></div>
<div class="box" id="saturate-box"></div>
<div class="box" id="huerotate-box"></div>
<div class="box" id="invert-box"></div>
<div class="box" id="opacity-box"></div>
<div class="box" id="brightness-box"></div>
<div class="box" id="contrast-box"></div>
<div class="box" id="blur-box"></div>
<!-- <div class="box" id="dropshadow-box"></div> -->
<div id="result">
</div>
</body>
</html>