Chromium Code Reviews| Index: Source/core/rendering/FilterEffectRenderer.cpp |
| diff --git a/Source/core/rendering/FilterEffectRenderer.cpp b/Source/core/rendering/FilterEffectRenderer.cpp |
| index 992fb55066cabc2d9d8110e42375c9fe7a393c18..df4fef70b06fdfc965efccc31378b7bb729b821e 100644 |
| --- a/Source/core/rendering/FilterEffectRenderer.cpp |
| +++ b/Source/core/rendering/FilterEffectRenderer.cpp |
| @@ -50,6 +50,7 @@ |
| #include "core/rendering/RenderView.h" |
| #if ENABLE(SVG) |
| +#include "SVGNames.h" |
| #include "core/loader/cache/CachedSVGDocument.h" |
| #include "core/loader/cache/CachedSVGDocumentReference.h" |
| #include "core/platform/graphics/filters/SourceAlpha.h" |
| @@ -143,6 +144,11 @@ PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderObject |
| return 0; |
| } |
| + if (!filter->hasTagName(SVGNames::filterTag)) |
| + return 0; |
| + |
| + SVGFilterElement* filterElement = static_cast<SVGFilterElement*>(filter); |
|
Stephen Chennney
2013/05/02 16:53:55
To we have a "toSVGFilterElement" method to avoid
|
| + |
| RefPtr<FilterEffect> effect; |
| // FIXME: Figure out what to do with SourceAlpha. Right now, we're |
| @@ -152,7 +158,7 @@ PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderObject |
| // This may need a spec clarification. |
| RefPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create(previousEffect, SourceAlpha::create(this)); |
| - for (Node* node = filter->firstChild(); node; node = node->nextSibling()) { |
| + for (Node* node = filterElement->firstChild(); node; node = node->nextSibling()) { |
| if (!node->isSVGElement()) |
| continue; |
| @@ -167,6 +173,7 @@ PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderObject |
| continue; |
| effectElement->setStandardAttributes(effect.get()); |
| + effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(effectElement, filterElement->primitiveUnits(), sourceImageRect())); |
| builder->add(effectElement->result(), effect); |
| m_effects.append(effect); |
| } |
| @@ -351,11 +358,11 @@ bool FilterEffectRenderer::build(RenderObject* renderer, const FilterOperations& |
| } |
| if (effect) { |
| - // Unlike SVG, filters applied here should not clip to their primitive subregions. |
| - effect->setClipsToBounds(false); |
| effect->setOperatingColorSpace(ColorSpaceDeviceRGB); |
| if (filterOperation->getOperationType() != FilterOperation::REFERENCE) { |
| + // Unlike SVG, filters applied here should not clip to their primitive subregions. |
| + effect->setClipsToBounds(false); |
| effect->inputEffects().append(previousEffect); |
| m_effects.append(effect); |
| } |
| @@ -367,8 +374,9 @@ bool FilterEffectRenderer::build(RenderObject* renderer, const FilterOperations& |
| if (!m_effects.size()) |
| return false; |
| - setMaxEffectRects(m_sourceDrawingRegion); |
| - |
| + if (previousEffect) |
| + previousEffect->determineFilterPrimitiveSubregion(); |
| + |
| return true; |
| } |