Changeset 83821 in webkit
- Timestamp:
- Apr 14, 2011 12:14:57 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 20 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r83820 r83821 1 2011-04-14 Renata Hodovan <reni@webkit.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 CSS related SVG*Element changes doesn't require relayout 6 https://bugs.webkit.org/show_bug.cgi?id=56906 7 8 Testing inherited CSS related SVG property changes by FEFlood, FESpecularLighting and FEDiffuseLighing filters. 9 Adding a missing test to check the dynamic update of lighting-color property of FESpecularLighting. 10 All the other modifications are covered by the existing dyanmic-update tests. 11 12 * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-inherit-lighting-color-css-prop-expected.checksum: Added. 13 * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-inherit-lighting-color-css-prop-expected.png: Added. 14 * platform/mac/svg/dynamic-updates/SVGFEFloodElement-inherit-flood-color-expected.checksum: Added. 15 * platform/mac/svg/dynamic-updates/SVGFEFloodElement-inherit-flood-color-expected.png: Added. 16 * platform/mac/svg/dynamic-updates/SVGFESpecularLightingElement-inherit-lighting-color-css-prop-expected.checksum: Added. 17 * platform/mac/svg/dynamic-updates/SVGFESpecularLightingElement-inherit-lighting-color-css-prop-expected.png: Added. 18 * platform/mac/svg/dynamic-updates/SVGFESpecularLightingElement-lighting-color-css-prop-expected.checksum: Added. 19 * platform/mac/svg/dynamic-updates/SVGFESpecularLightingElement-lighting-color-css-prop-expected.png: Added. 20 * svg/dynamic-updates/SVGFEDiffuseLightingElement-inherit-lighting-color-css-prop-expected.txt: Added. 21 * svg/dynamic-updates/SVGFEDiffuseLightingElement-inherit-lighting-color-css-prop.html: Added. 22 * svg/dynamic-updates/SVGFEFloodElement-inherit-flood-color-expected.txt: Added. 23 * svg/dynamic-updates/SVGFEFloodElement-inherit-flood-color.html: Added. 24 * svg/dynamic-updates/SVGFESpecularLightingElement-inherit-lighting-color-css-prop-expected.txt: Added. 25 * svg/dynamic-updates/SVGFESpecularLightingElement-inherit-lighting-color-css-prop.html: Added. 26 * svg/dynamic-updates/SVGFESpecularLightingElement-lighting-color-css-prop-expected.txt: Added. 27 * svg/dynamic-updates/SVGFESpecularLightingElement-lighting-color-css-prop.html: Added. 28 * svg/dynamic-updates/script-tests/SVGFEDiffuseLightingElement-inherit-lighting-color-css-prop.js: Added. 29 (executeTest): 30 * svg/dynamic-updates/script-tests/SVGFEFloodElement-inherit-flood-color-css-prop.js: Added. 31 (executeTest): 32 * svg/dynamic-updates/script-tests/SVGFESpecularLightingElement-inherit-lighting-color-css-prop.js: Added. 33 (executeTest): 34 * svg/dynamic-updates/script-tests/SVGFESpecularLightingElement-lighting-color-css-prop.js: Added. 35 (executeTest): 36 1 37 2011-04-13 James Robinson <jamesr@chromium.org> 2 38 -
trunk/Source/WebCore/ChangeLog
r83820 r83821 1 2011-04-14 Renata Hodovan <reni@webkit.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 CSS related SVG*Element changes doesn't require relayout 6 https://bugs.webkit.org/show_bug.cgi?id=56906 7 8 The changes of some CSS related SVGFilter properties e.g. lighting_color, flood_color, flood_opacity 9 need only repaint. To avoid the default invalidation of filters in SVGResourceCache::clientStyleChange() 10 we need an early return. So RenderSVGResourceFilterPrimitive::styleDidChange() can handle these properties 11 via RenderSVGResourceFilter::primitiveAttributeChanged() the same way like we do it for the other SVGAttributes. 12 13 Tests: svg/dynamic-updates/SVGFEDiffuseLightingElement-inherit-lighting-color-css-prop.html 14 svg/dynamic-updates/SVGFEFloodElement-inherit-flood-color.html 15 svg/dynamic-updates/SVGFESpecularLightingElement-inherit-lighting-color-css-prop.html 16 svg/dynamic-updates/SVGFESpecularLightingElement-lighting-color-css-prop.html 17 18 * platform/graphics/filters/FEFlood.cpp: 19 (WebCore::FEFlood::setFloodColor): 20 (WebCore::FEFlood::setFloodOpacity): 21 * platform/graphics/filters/FEFlood.h: 22 * platform/graphics/filters/FESpecularLighting.cpp: 23 (WebCore::FESpecularLighting::setLightingColor): 24 * platform/graphics/filters/FESpecularLighting.h: 25 * rendering/svg/RenderSVGResourceFilterPrimitive.cpp: 26 (WebCore::RenderSVGResourceFilterPrimitive::styleDidChange): 27 * rendering/svg/RenderSVGResourceFilterPrimitive.h: 28 * rendering/svg/SVGResourcesCache.cpp: 29 (WebCore::SVGResourcesCache::clientStyleChanged): 30 * svg/SVGFEDiffuseLightingElement.cpp: 31 (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute): 32 * svg/SVGFEFloodElement.cpp: 33 (WebCore::SVGFEFloodElement::setFilterEffectAttribute): 34 * svg/SVGFEFloodElement.h: 35 * svg/SVGFESpecularLightingElement.cpp: 36 (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute): 37 1 38 2011-04-13 James Robinson <jamesr@chromium.org> 2 39 -
trunk/Source/WebCore/platform/graphics/filters/FEFlood.cpp
r82571 r83821 50 50 } 51 51 52 voidFEFlood::setFloodColor(const Color& color)52 bool FEFlood::setFloodColor(const Color& color) 53 53 { 54 if (m_floodColor == color) 55 return false; 54 56 m_floodColor = color; 57 return true; 55 58 } 56 59 … … 60 63 } 61 64 62 voidFEFlood::setFloodOpacity(float floodOpacity)65 bool FEFlood::setFloodOpacity(float floodOpacity) 63 66 { 67 if (m_floodOpacity == floodOpacity) 68 return false; 64 69 m_floodOpacity = floodOpacity; 70 return true; 65 71 } 66 72 -
trunk/Source/WebCore/platform/graphics/filters/FEFlood.h
r82571 r83821 35 35 36 36 Color floodColor() const; 37 voidsetFloodColor(const Color &);37 bool setFloodColor(const Color &); 38 38 39 39 float floodOpacity() const; 40 voidsetFloodOpacity(float);40 bool setFloodOpacity(float); 41 41 42 42 virtual void apply(); -
trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp
r82571 r83821 55 55 } 56 56 57 voidFESpecularLighting::setLightingColor(const Color& lightingColor)57 bool FESpecularLighting::setLightingColor(const Color& lightingColor) 58 58 { 59 if (m_lightingColor == lightingColor) 60 return false; 59 61 m_lightingColor = lightingColor; 62 return true; 60 63 } 61 64 -
trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.h
r82571 r83821 35 35 36 36 Color lightingColor() const; 37 voidsetLightingColor(const Color&);37 bool setLightingColor(const Color&); 38 38 39 39 float surfaceScale() const; -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
r82571 r83821 2 2 * Copyright (C) 2010 University of Szeged 3 3 * Copyright (C) 2010 Zoltan Herczeg 4 * Copyright (C) 2011 Renata Hodovan (reni@webkit.org) 4 5 * 5 6 * Redistribution and use in source and binary forms, with or without … … 33 34 #include "SVGFEImage.h" 34 35 #include "SVGFilter.h" 36 #include "SVGNames.h" 35 37 36 38 namespace WebCore { 39 40 41 void RenderSVGResourceFilterPrimitive::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 42 { 43 RenderSVGHiddenContainer::styleDidChange(diff, oldStyle); 44 45 RenderObject* filter = parent(); 46 if (!filter) 47 return; 48 ASSERT(filter->isSVGResourceFilter()); 49 50 if (diff == StyleDifferenceEqual || !oldStyle) 51 return; 52 53 const SVGRenderStyle* newStyle = this->style()->svgStyle(); 54 if (node()->hasTagName(SVGNames::feFloodTag)) { 55 if (newStyle->floodColor() != oldStyle->svgStyle()->floodColor()) 56 static_cast<RenderSVGResourceFilter*>(filter)->primitiveAttributeChanged(this, SVGNames::flood_colorAttr); 57 if (newStyle->floodOpacity() != oldStyle->svgStyle()->floodOpacity()) 58 static_cast<RenderSVGResourceFilter*>(filter)->primitiveAttributeChanged(this, SVGNames::flood_opacityAttr); 59 } else if (node()->hasTagName(SVGNames::feDiffuseLightingTag) || node()->hasTagName(SVGNames::feSpecularLightingTag)) { 60 if (newStyle->lightingColor() != oldStyle->svgStyle()->lightingColor()) 61 static_cast<RenderSVGResourceFilter*>(filter)->primitiveAttributeChanged(this, SVGNames::lighting_colorAttr); 62 } 63 } 37 64 38 65 FloatRect RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(FilterEffect* effect) -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.h
r82571 r83821 44 44 } 45 45 46 virtual void styleDidChange(StyleDifference, const RenderStyle*); 47 46 48 virtual const char* renderName() const { return "RenderSVGResourceFilterPrimitive"; } 47 49 virtual bool isSVGResourceFilterPrimitive() const { return true; } -
trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp
r82571 r83821 127 127 return; 128 128 129 // In this case the proper SVGFE*Element will imply whether the modifided CSS properties implies a relayout or repaint. 130 if (renderer->isSVGResourceFilterPrimitive() && diff == StyleDifferenceRepaint) 131 return; 132 129 133 clientUpdatedFromElement(renderer, newStyle); 130 134 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false); -
trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
r82571 r83821 88 88 { 89 89 FEDiffuseLighting* diffuseLighting = static_cast<FEDiffuseLighting*>(effect); 90 91 if (attrName == SVGNames::lighting_colorAttr) { 92 RenderObject* renderer = this->renderer(); 93 ASSERT(renderer); 94 ASSERT(renderer->style()); 95 return diffuseLighting->setLightingColor(renderer->style()->svgStyle()->lightingColor()); 96 } 90 97 if (attrName == SVGNames::surfaceScaleAttr) 91 98 return diffuseLighting->setSurfaceScale(surfaceScale()); 92 99 if (attrName == SVGNames::diffuseConstantAttr) 93 100 return diffuseLighting->setDiffuseConstant(diffuseConstant()); 94 if (attrName == SVGNames::lighting_colorAttr) {95 RefPtr<RenderStyle> filterStyle = styleForRenderer();96 return diffuseLighting->setLightingColor(filterStyle->svgStyle()->lightingColor());97 }98 101 99 102 LightSource* lightSource = const_cast<LightSource*>(diffuseLighting->lightSource()); -
trunk/Source/WebCore/svg/SVGFEFloodElement.cpp
r82571 r83821 26 26 #include "Attribute.h" 27 27 #include "RenderStyle.h" 28 #include "SVGNames.h" 28 29 #include "SVGRenderStyle.h" 29 30 … … 38 39 { 39 40 return adoptRef(new SVGFEFloodElement(tagName, document)); 41 } 42 43 44 bool SVGFEFloodElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) 45 { 46 RenderObject* renderer = this->renderer(); 47 ASSERT(renderer); 48 RenderStyle* style = renderer->style(); 49 ASSERT(style); 50 FEFlood* flood = static_cast<FEFlood*>(effect); 51 52 if (attrName == SVGNames::flood_colorAttr) 53 return flood->setFloodColor(style->svgStyle()->floodColor()); 54 if (attrName == SVGNames::flood_opacityAttr) 55 return flood->setFloodOpacity(style->svgStyle()->floodOpacity()); 56 57 ASSERT_NOT_REACHED(); 58 return false; 40 59 } 41 60 -
trunk/Source/WebCore/svg/SVGFEFloodElement.h
r82571 r83821 37 37 virtual void fillAttributeToPropertyTypeMap(); 38 38 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap(); 39 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName); 39 40 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*); 40 41 }; -
trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp
r82571 r83821 93 93 { 94 94 FESpecularLighting* specularLighting = static_cast<FESpecularLighting*>(effect); 95 96 if (attrName == SVGNames::lighting_colorAttr) { 97 RenderObject* renderer = this->renderer(); 98 ASSERT(renderer); 99 ASSERT(renderer->style()); 100 return specularLighting->setLightingColor(renderer->style()->svgStyle()->lightingColor()); 101 } 95 102 if (attrName == SVGNames::surfaceScaleAttr) 96 103 return specularLighting->setSurfaceScale(surfaceScale());
Note: See TracChangeset
for help on using the changeset viewer.