Implement animation for color-filter
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Apr 2018 00:27:29 +0000 (00:27 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Apr 2018 00:27:29 +0000 (00:27 +0000)
commitdbffca6090fc4f1176e46901243f1c64351466d6
treee4c54d08ebadf550ccb7ac16566d9582d2b306e5
parent9c5fb2b379e64dab3bfaf6d6536405d23a3036c3
Implement animation for color-filter
https://bugs.webkit.org/show_bug.cgi?id=185092
rdar://problem/39773810

Reviewed by Tim Horton.

Source/WebCore:

Implement animation of color-filter.

This requires tracking whether the color-filter function lists match for both old and new
animation code paths.

The filter-related ProperyWappers in CSSPropertyAnimation are cleaned up to use a single wrapper,
which has to pass the propertyID to the blend function so we know which "lists match" to check.
This wrapper reports that its accelerated for filter and backdrop-filter, but not color-filter.

Test: css3/color-filters/color-filter-animation.html

* animation/CSSPropertyBlendingClient.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
* animation/KeyframeEffectReadOnly.h:
* page/animation/AnimationBase.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::PropertyWrapperFilter::PropertyWrapperFilter):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
(WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): Deleted.
(WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Deleted.
(WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated const): Deleted.
(WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const): Deleted.
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::reset):
(WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
* page/animation/KeyframeAnimation.h:

LayoutTests:

Fix the testing to recognize unprefixed filter, and color-filter.

Add a color-filter animation test.

* animations/resources/animation-test-helpers.js:
(getPropertyValue):
(comparePropertyValue):
* css3/color-filters/color-filter-animation-expected.txt: Added.
* css3/color-filters/color-filter-animation.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/animations/resources/animation-test-helpers.js
LayoutTests/css3/color-filters/color-filter-animation-expected.txt [new file with mode: 0644]
LayoutTests/css3/color-filters/color-filter-animation.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/animation/CSSPropertyBlendingClient.h
Source/WebCore/animation/KeyframeEffectReadOnly.cpp
Source/WebCore/animation/KeyframeEffectReadOnly.h
Source/WebCore/page/animation/AnimationBase.h
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/page/animation/ImplicitAnimation.cpp
Source/WebCore/page/animation/ImplicitAnimation.h
Source/WebCore/page/animation/KeyframeAnimation.cpp
Source/WebCore/page/animation/KeyframeAnimation.h