[CSS Shaders] Implement CSS Animations and Transitions for CSS Shaders
authorachicu@adobe.com <achicu@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Apr 2012 20:30:40 +0000 (20:30 +0000)
committerachicu@adobe.com <achicu@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Apr 2012 20:30:40 +0000 (20:30 +0000)
commit458ba2f279253a0f3aa8538f951675526a555687
treeadc0e371f739966ee9306b57f3d9e9dcea6c2e3b
parent5147c31c39fd7dce5f09fbd3a94dd1f916d878e7
[CSS Shaders] Implement CSS Animations and Transitions for CSS Shaders
https://bugs.webkit.org/show_bug.cgi?id=71406

Reviewed by Dean Jackson.

Source/WebCore:

I've implemented the blend function for the CustomFilterOperation. This should enable animations for CSS Shaders.
Currently, just floats are implemented. If any of the filter attributes like shader, mesh size or box mode are different,
the fallback is to use the "to" part of the animation instead. If other shader parameters do not match, it will merge the parameter values
between the "from" and "to" states.

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

* platform/graphics/filters/CustomFilterNumberParameter.h:
(WebCore::CustomFilterNumberParameter::blend):
(CustomFilterNumberParameter):
(WebCore::CustomFilterNumberParameter::operator==):
* platform/graphics/filters/CustomFilterOperation.cpp:
(WebCore::equalCustomFilterParameters):
(WebCore):
(WebCore::checkCustomFilterParametersOrder):
(WebCore::blendCustomFilterParameters):
(WebCore::CustomFilterOperation::CustomFilterOperation):
(WebCore::CustomFilterOperation::blend):
* platform/graphics/filters/CustomFilterOperation.h:
(WebCore):
(CustomFilterOperation):
(WebCore::CustomFilterOperation::operator==):
(WebCore::CustomFilterOperation::operator!=):
* platform/graphics/filters/CustomFilterParameter.h:
(CustomFilterParameter):
(WebCore::CustomFilterParameter::isSameType):
(WebCore::CustomFilterParameter::operator==):
(WebCore::CustomFilterParameter::operator!=):
* platform/graphics/filters/CustomFilterProgram.h:
* rendering/style/StyleCustomFilterProgram.h:
(StyleCustomFilterProgram):
(WebCore::StyleCustomFilterProgram::cachedVertexShader):
(WebCore::StyleCustomFilterProgram::cachedFragmentShader):
(WebCore::StyleCustomFilterProgram::operator==):

LayoutTests:

* animations/resources/animation-test-helpers.js: Added a check for the "custom" function and used the parser in custom-filter-parser.js instead.
(getFilterParameters):
(filterParametersMatch):
* css3/filters/custom/custom-filter-animation-expected.txt: Added.
* css3/filters/custom/custom-filter-animation.html: Added.
* css3/filters/resources/custom-filter-parser.js: Added a simple parser for the "custom" function, so that multiple types can be checked correctly.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/animations/resources/animation-test-helpers.js
LayoutTests/css3/filters/custom/custom-filter-animation-expected.txt [new file with mode: 0644]
LayoutTests/css3/filters/custom/custom-filter-animation.html [new file with mode: 0644]
LayoutTests/css3/filters/resources/custom-filter-parser.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/filters/CustomFilterNumberParameter.h
Source/WebCore/platform/graphics/filters/CustomFilterOperation.cpp
Source/WebCore/platform/graphics/filters/CustomFilterOperation.h
Source/WebCore/platform/graphics/filters/CustomFilterParameter.h
Source/WebCore/platform/graphics/filters/CustomFilterProgram.h
Source/WebCore/rendering/style/StyleCustomFilterProgram.h