Index: Source/core/svg/SVGFEBlendElement.cpp |
diff --git a/Source/core/svg/SVGFEBlendElement.cpp b/Source/core/svg/SVGFEBlendElement.cpp |
index 7075f6e7ebf2befc68cb9c4f09052f65c9db7270..3033feea749c95c133a9b4d4322f8bc198213aea 100644 |
--- a/Source/core/svg/SVGFEBlendElement.cpp |
+++ b/Source/core/svg/SVGFEBlendElement.cpp |
@@ -31,21 +31,32 @@ namespace blink { |
static WebBlendMode toWebBlendMode(SVGFEBlendElement::Mode mode) |
{ |
+#define MAP_BLEND_MODE(MODENAME) \ |
+ case SVGFEBlendElement::Mode##MODENAME: \ |
+ return WebBlendMode##MODENAME |
+ |
switch (mode) { |
- case SVGFEBlendElement::ModeNormal: |
- return WebBlendModeNormal; |
- case SVGFEBlendElement::ModeMultiply: |
- return WebBlendModeMultiply; |
- case SVGFEBlendElement::ModeScreen: |
- return WebBlendModeScreen; |
- case SVGFEBlendElement::ModeDarken: |
- return WebBlendModeDarken; |
- case SVGFEBlendElement::ModeLighten: |
- return WebBlendModeLighten; |
+ MAP_BLEND_MODE(Normal); |
+ MAP_BLEND_MODE(Multiply); |
+ MAP_BLEND_MODE(Screen); |
+ MAP_BLEND_MODE(Darken); |
+ MAP_BLEND_MODE(Lighten); |
+ MAP_BLEND_MODE(Overlay); |
+ MAP_BLEND_MODE(ColorDodge); |
+ MAP_BLEND_MODE(ColorBurn); |
+ MAP_BLEND_MODE(HardLight); |
+ MAP_BLEND_MODE(SoftLight); |
+ MAP_BLEND_MODE(Difference); |
+ MAP_BLEND_MODE(Exclusion); |
+ MAP_BLEND_MODE(Hue); |
+ MAP_BLEND_MODE(Saturation); |
+ MAP_BLEND_MODE(Color); |
+ MAP_BLEND_MODE(Luminosity); |
default: |
ASSERT_NOT_REACHED(); |
return WebBlendModeNormal; |
} |
+#undef MAP_BLEND_MODE |
} |
template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGFEBlendElement::Mode>() |
@@ -57,10 +68,26 @@ template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGFEBlendE |
entries.append(std::make_pair(SVGFEBlendElement::ModeScreen, "screen")); |
entries.append(std::make_pair(SVGFEBlendElement::ModeDarken, "darken")); |
entries.append(std::make_pair(SVGFEBlendElement::ModeLighten, "lighten")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeOverlay, "overlay")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeColorDodge, "color-dodge")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeColorBurn, "color-burn")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeHardLight, "hard-light")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeSoftLight, "soft-light")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeDifference, "difference")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeExclusion, "exclusion")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeHue, "hue")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeSaturation, "saturation")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeColor, "color")); |
+ entries.append(std::make_pair(SVGFEBlendElement::ModeLuminosity, "luminosity")); |
} |
return entries; |
} |
+template<> unsigned short getMaxExposedEnumValue<SVGFEBlendElement::Mode>() |
+{ |
+ return SVGFEBlendElement::ModeLighten; |
+} |
+ |
inline SVGFEBlendElement::SVGFEBlendElement(Document& document) |
: SVGFilterPrimitiveStandardAttributes(SVGNames::feBlendTag, document) |
, m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create())) |