Use arrays in shaders
authormichelangelo@webkit.org <michelangelo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Sep 2012 17:17:58 +0000 (17:17 +0000)
committermichelangelo@webkit.org <michelangelo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Sep 2012 17:17:58 +0000 (17:17 +0000)
commitdfea42f737d7261f240aaf92d344545080e4aed1
tree48685ed517bd38820078bb15894f884c346c0504
parent583061bcd406de8f430638c4eafaae697fb46495
Use arrays in shaders
https://bugs.webkit.org/show_bug.cgi?id=95223

Reviewed by Dean Jackson.

Source/WebCore:

Custom Filters' support for array() is introduced. Values within
the array() function will be passed as uniforms to shaders.

Values within array() are comma-separated; the specification will be
updated accordingly: https://www.w3.org/Bugs/Public/show_bug.cgi?id=18839

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

* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForCustomFilterArrayParameter):
(WebCore):
(WebCore::valueForCustomFilterParameter):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList):
* css/StyleResolver.h:
(StyleResolver):
* platform/graphics/filters/CustomFilterArrayParameter.h: Container for array()
parameter values.
(WebCore):
(CustomFilterArrayParameter):
(WebCore::CustomFilterArrayParameter::create):
(WebCore::CustomFilterArrayParameter::size):
(WebCore::CustomFilterArrayParameter::valueAt):
(WebCore::CustomFilterArrayParameter::addValue):
(WebCore::CustomFilterArrayParameter::blend):
(WebCore::CustomFilterArrayParameter::operator==):
(WebCore::CustomFilterArrayParameter::CustomFilterArrayParameter):
* platform/graphics/filters/CustomFilterParameter.h:
* platform/graphics/filters/FECustomFilter.cpp:
(WebCore::FECustomFilter::bindProgramArrayParameters):
(WebCore):
(WebCore::FECustomFilter::bindProgramParameters):
* platform/graphics/filters/FECustomFilter.h:
(WebCore):
(FECustomFilter):

LayoutTests:

New tests have been added for checking the correctness of array()
within shaders.

* css3/filters/custom/custom-filter-array-expected.html: Added.
* css3/filters/custom/custom-filter-array.html: Added.
* css3/filters/custom/custom-filter-property-computed-style-expected.txt:
* css3/filters/custom/custom-filter-property-parsing-invalid-expected.txt:
* css3/filters/resources/fragment-color.fs: Added.
* css3/filters/script-tests/custom-filter-property-computed-style.js:
* css3/filters/script-tests/custom-filter-property-parsing-invalid.js:
* platform/chromium/css3/filters/custom/custom-filter-property-computed-style-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/filters/custom/custom-filter-array-expected.html [new file with mode: 0644]
LayoutTests/css3/filters/custom/custom-filter-array.html [new file with mode: 0644]
LayoutTests/css3/filters/custom/custom-filter-property-computed-style-expected.txt
LayoutTests/css3/filters/custom/custom-filter-property-parsing-invalid-expected.txt
LayoutTests/css3/filters/resources/fragment-color.fs [new file with mode: 0644]
LayoutTests/css3/filters/script-tests/custom-filter-property-computed-style.js
LayoutTests/css3/filters/script-tests/custom-filter-property-parsing-invalid.js
LayoutTests/platform/chromium/css3/filters/custom/custom-filter-property-computed-style-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/platform/graphics/filters/CustomFilterArrayParameter.h [new file with mode: 0644]
Source/WebCore/platform/graphics/filters/CustomFilterParameter.h
Source/WebCore/platform/graphics/filters/FECustomFilter.cpp
Source/WebCore/platform/graphics/filters/FECustomFilter.h