Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3683)

Unified Diff: Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp

Issue 89283002: Merge two determineFilterPrimitiveSubregion implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix final nit Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp b/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
index 18cc67a61e755dea79ca5ed57ace64806e794cf5..e34449d35eaaedcb4080832d671d31327d580323 100644
--- a/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
@@ -55,47 +55,4 @@ void RenderSVGResourceFilterPrimitive::styleDidChange(StyleDifference diff, cons
}
}
-FloatRect RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(FilterEffect* effect)
-{
- SVGFilter* filter = static_cast<SVGFilter*>(effect->filter());
- ASSERT(filter);
-
- // FETile, FETurbulence, FEFlood don't have input effects, take the filter region as unite rect.
- FloatRect subregion;
- if (unsigned numberOfInputEffects = effect->inputEffects().size()) {
- subregion = determineFilterPrimitiveSubregion(effect->inputEffect(0));
- for (unsigned i = 1; i < numberOfInputEffects; ++i)
- subregion.unite(determineFilterPrimitiveSubregion(effect->inputEffect(i)));
- } else
- subregion = filter->filterRegion();
-
- // After calling determineFilterPrimitiveSubregion on the target effect, reset the subregion again for <feTile>.
- if (effect->filterEffectType() == FilterEffectTypeTile)
- subregion = filter->filterRegion();
-
- FloatRect effectBoundaries = effect->effectBoundaries();
- if (effect->hasX())
- subregion.setX(effectBoundaries.x());
- if (effect->hasY())
- subregion.setY(effectBoundaries.y());
- if (effect->hasWidth())
- subregion.setWidth(effectBoundaries.width());
- if (effect->hasHeight())
- subregion.setHeight(effectBoundaries.height());
-
- effect->setFilterPrimitiveSubregion(subregion);
-
- FloatRect absoluteSubregion = filter->absoluteTransform().mapRect(subregion);
- FloatSize filterResolution = filter->filterResolution();
- absoluteSubregion.scale(filterResolution.width(), filterResolution.height());
-
- // Clip every filter effect to the filter region.
- FloatRect absoluteScaledFilterRegion = filter->absoluteFilterRegion();
- absoluteScaledFilterRegion.scale(filterResolution.width(), filterResolution.height());
- absoluteSubregion.intersect(absoluteScaledFilterRegion);
-
- effect->setMaxEffectRect(absoluteSubregion);
- return subregion;
-}
-
} // namespace WebCore
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698