[CSS Shaders] Add CustomFilterProgramType to CustomFilterProgramInfo
authormichelangelo <michelangelo@webkit.org>
Mon, 15 Oct 2012 21:23:53 +0000 (21:23 +0000)
committermichelangelo <michelangelo@webkit.org>
Mon, 15 Oct 2012 21:23:53 +0000 (21:23 +0000)
commitdaa5bf865689d954004096f0f48be6702d8b8243
treef776eb17b18281fb965acc8f7e9fb9c754f6e5a7
parente719ff048b74e10dc2daac5e0066735715238595
[CSS Shaders] Add CustomFilterProgramType to CustomFilterProgramInfo
https://bugs.webkit.org/show_bug.cgi?id=96448

Reviewed by Kenneth Rohde Christiansen.

CustomFilterProgramInfo has been refactored to decouple the CustomFilterProgramType from
the CustomFilterProgramMixSetting: m_mixSettings.enabled was redundant in light of the fact
that m_programType encoded the very same information. Dependencies have been updated to reflect
this change.

Current tests already cover this code.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::valueForFilter): The check for mixSettings.enabled has been replaced
by an explicit check for PROGRAM_TYPE_BLENDS_ELEMENT_TEXTURE program type.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::createCustomFilterOperation): Setting the program type explicitly while creating a
new filter program.
* platform/graphics/filters/CustomFilterProgram.cpp:
(WebCore::CustomFilterProgram::CustomFilterProgram): CustomFilterProgram's constructor has been updated to
reflect the need of setting the program type explicitly.
(WebCore::CustomFilterProgram::programInfo): Updated to create new CustomFilterProgramInfo setting the program
type explicitly.
* platform/graphics/filters/CustomFilterProgram.h:
* platform/graphics/filters/CustomFilterProgramInfo.cpp:
(WebCore::CustomFilterProgramInfo::CustomFilterProgramInfo): Added m_programType and udpated the related getter.
(WebCore::CustomFilterProgramInfo::hash): ditto
(WebCore::CustomFilterProgramInfo::operator==): MixSettings' equality check is being performed only whether
the CustomFilterProgramInfo's program type is PROGRAM_TYPE_BLENDS_ELEMENT_TEXTURE.
* platform/graphics/filters/CustomFilterProgramInfo.h:
(WebCore::CustomFilterProgramMixSettings::CustomFilterProgramMixSettings): Got rid of the redundant enabled flag.
(WebCore::CustomFilterProgramMixSettings::operator==): ditto
(CustomFilterProgramInfo):
(WebCore::CustomFilterProgramInfo::programType):
* platform/graphics/filters/CustomFilterValidatedProgram.cpp: The right shader validator is now being
created according to the program type.
(WebCore::CustomFilterValidatedProgram::CustomFilterValidatedProgram):
(WebCore::CustomFilterValidatedProgram::rewriteMixVertexShader): The reference to MixSettings' enabled flag
has been replaced with a check for the program type.
(WebCore::CustomFilterValidatedProgram::rewriteMixFragmentShader): ditto
* rendering/style/StyleCustomFilterProgram.h:
(WebCore::StyleCustomFilterProgram::create): Updated to be aware of the program type.
(WebCore::StyleCustomFilterProgram::StyleCustomFilterProgram): ditto

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/platform/graphics/filters/CustomFilterProgram.cpp
Source/WebCore/platform/graphics/filters/CustomFilterProgram.h
Source/WebCore/platform/graphics/filters/CustomFilterProgramInfo.cpp
Source/WebCore/platform/graphics/filters/CustomFilterProgramInfo.h
Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp
Source/WebCore/rendering/style/StyleCustomFilterProgram.h