Chromium Code Reviews| Index: Source/core/platform/graphics/filters/FilterEffect.cpp |
| diff --git a/Source/core/platform/graphics/filters/FilterEffect.cpp b/Source/core/platform/graphics/filters/FilterEffect.cpp |
| index 01e4b0a6278d5a66915688a0e6a3713d52a18670..aece491731aefd3038bae8ef622470ed1f8cde36 100644 |
| --- a/Source/core/platform/graphics/filters/FilterEffect.cpp |
| +++ b/Source/core/platform/graphics/filters/FilterEffect.cpp |
| @@ -481,4 +481,21 @@ PassRefPtr<SkImageFilter> FilterEffect::createImageFilter(SkiaImageFilterBuilder |
| return 0; |
| } |
| +SkIRect FilterEffect::getCropRect(const FloatSize& cropOffset) const |
| +{ |
| + SkIRect rect = SkIRect::MakeLargest(); |
|
f(malita)
2013/09/09 21:37:43
Hmm, starting off with SkIRect::MakeLargest() does
Stephen White
2013/09/10 14:43:41
When omitted, filter primitive subregion is suppos
f(malita)
2013/09/10 15:37:10
Sounds good, thanks for the explanation.
|
| + FloatRect boundaries = effectBoundaries(); |
| + FloatSize resolution = filter()->filterResolution(); |
| + boundaries.scale(resolution.width(), resolution.height()); |
| + if (hasX()) |
| + rect.fLeft = static_cast<int>(boundaries.x()) + cropOffset.width(); |
| + if (hasY()) |
| + rect.fTop = static_cast<int>(boundaries.y()) + cropOffset.height(); |
| + if (hasWidth()) |
| + rect.fRight = rect.fLeft + static_cast<int>(boundaries.width()); |
| + if (hasHeight()) |
| + rect.fBottom = rect.fTop + static_cast<int>(boundaries.height()); |
|
f(malita)
2013/09/09 21:37:43
Selectively overwriting edges like this seems prob
Stephen White
2013/09/10 14:43:41
You're right. (I knew there was a reason I didn't
|
| + return rect; |
| +} |
| + |
| } // namespace WebCore |