| Index: third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp b/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp
|
| index ef6fc81000b28690c7575c2992ed67f8a2a341bf..ed1fd3784a719cd43cc847a21bb50d2c15510ed0 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp
|
| @@ -135,6 +135,19 @@ TextStream& FilterEffect::externalRepresentation(TextStream& ts, int) const
|
| return ts;
|
| }
|
|
|
| +void FilterEffect::applyEffectBoundaries(FloatRect& rect) const
|
| +{
|
| + const FloatRect boundaries = effectBoundaries();
|
| + if (hasX())
|
| + rect.setX(boundaries.x());
|
| + if (hasY())
|
| + rect.setY(boundaries.y());
|
| + if (hasWidth())
|
| + rect.setWidth(boundaries.width());
|
| + if (hasHeight())
|
| + rect.setHeight(boundaries.height());
|
| +}
|
| +
|
| FloatRect FilterEffect::determineFilterPrimitiveSubregion(DetermineSubregionFlags flags)
|
| {
|
| Filter* filter = this->filter();
|
| @@ -160,15 +173,7 @@ FloatRect FilterEffect::determineFilterPrimitiveSubregion(DetermineSubregionFlag
|
| filter->mapLocalRectToAbsoluteRect(subregion)));
|
| }
|
|
|
| - FloatRect boundaries = effectBoundaries();
|
| - if (hasX())
|
| - subregion.setX(boundaries.x());
|
| - if (hasY())
|
| - subregion.setY(boundaries.y());
|
| - if (hasWidth())
|
| - subregion.setWidth(boundaries.width());
|
| - if (hasHeight())
|
| - subregion.setHeight(boundaries.height());
|
| + applyEffectBoundaries(subregion);
|
|
|
| setFilterPrimitiveSubregion(subregion);
|
|
|
| @@ -217,27 +222,18 @@ SkImageFilter::CropRect FilterEffect::getCropRect(const FloatSize& cropOffset) c
|
| if (!hasConnectedInput() && !filter()->filterRegion().isEmpty()) {
|
| rect = filter()->filterRegion();
|
| flags = SkImageFilter::CropRect::kHasAll_CropEdge;
|
| - rect.move(cropOffset);
|
| - }
|
| - FloatRect boundaries = effectBoundaries();
|
| - boundaries.move(cropOffset);
|
| - if (hasX()) {
|
| - rect.setX(boundaries.x());
|
| - flags |= SkImageFilter::CropRect::kHasLeft_CropEdge;
|
| - }
|
| - if (hasY()) {
|
| - rect.setY(boundaries.y());
|
| - flags |= SkImageFilter::CropRect::kHasTop_CropEdge;
|
| - }
|
| - if (hasWidth()) {
|
| - rect.setWidth(boundaries.width());
|
| - flags |= SkImageFilter::CropRect::kHasWidth_CropEdge;
|
| - }
|
| - if (hasHeight()) {
|
| - rect.setHeight(boundaries.height());
|
| - flags |= SkImageFilter::CropRect::kHasHeight_CropEdge;
|
| }
|
| +
|
| + applyEffectBoundaries(rect);
|
| +
|
| + rect.move(cropOffset);
|
| rect.scale(filter()->scale());
|
| +
|
| + flags |= hasX() ? SkImageFilter::CropRect::kHasLeft_CropEdge : 0;
|
| + flags |= hasY() ? SkImageFilter::CropRect::kHasTop_CropEdge : 0;
|
| + flags |= hasWidth() ? SkImageFilter::CropRect::kHasWidth_CropEdge : 0;
|
| + flags |= hasHeight() ? SkImageFilter::CropRect::kHasHeight_CropEdge : 0;
|
| +
|
| return SkImageFilter::CropRect(rect, flags);
|
| }
|
|
|
|
|