| Index: cc/output/filter_operation.cc
|
| diff --git a/cc/output/filter_operation.cc b/cc/output/filter_operation.cc
|
| index 78588748ba59d63c5d68bd35e1df56cba76f0d22..c7eae994fc66150a06ad6c8903f52c0956578d95 100644
|
| --- a/cc/output/filter_operation.cc
|
| +++ b/cc/output/filter_operation.cc
|
| @@ -352,4 +352,34 @@ gfx::Rect FilterOperation::MapRect(const gfx::Rect& rect,
|
| }
|
| }
|
|
|
| +gfx::Rect FilterOperation::MapRectReverse(const gfx::Rect& rect,
|
| + const SkMatrix& matrix) const {
|
| + switch (type_) {
|
| + case FilterOperation::BLUR: {
|
| + SkVector spread = MapStdDeviation(amount(), matrix);
|
| + gfx::Rect result = rect;
|
| + result.Inset(-spread.x(), -spread.y(), -spread.x(), -spread.y());
|
| + return result;
|
| + }
|
| + case FilterOperation::DROP_SHADOW: {
|
| + SkVector spread = MapStdDeviation(amount(), matrix);
|
| + gfx::Rect result = rect;
|
| + result.Inset(-spread.x(), -spread.y(), -spread.x(), -spread.y());
|
| + result -= drop_shadow_offset().OffsetFromOrigin();
|
| + result.Union(rect);
|
| + return result;
|
| + }
|
| + case FilterOperation::REFERENCE: {
|
| + if (!image_filter())
|
| + return rect;
|
| + SkIRect in_rect = gfx::RectToSkIRect(rect);
|
| + SkIRect out_rect = image_filter()->filterBounds(
|
| + in_rect, matrix, SkImageFilter::kReverse_MapDirection);
|
| + return gfx::SkIRectToRect(out_rect);
|
| + }
|
| + default:
|
| + return rect;
|
| + }
|
| +}
|
| +
|
| } // namespace cc
|
|
|