Skip to content
Commit 9ef226f2 authored by kylechar's avatar kylechar Committed by Chromium LUCI CQ
Browse files

Improve ExpandRectForPixelMovement()

Make FilterOperations::ExpandRectForPixelMovement() use MapRect()
internally. MapRect() exists to expand rects for filters when drawing
them so it can be reused to expand rects for filters in damage
calculations as well.

This can result in the expanded rect being larger in some cases where it
was too small before. MapRect() can handle arbitrary combinations of
filters where FilterOperations::MaxPixelMovement() only returned the
largest pixel movement for any individual filter. This can also result
in expansion being smaller when:

1. There is non-uniform pixel movement, eg. drop shadow.
2. The result was wrong before, eg. zoom filter, which doesn't move
   pixels outside of the source rect.
3. The result was a place holder, eg. reference filter, which just
   expanded the source rect by 100 pixels in all directions.

Bug: 1444408
Change-Id: I2068721a1570215f92bd91e4b322b643e2687512
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4519140


Reviewed-by: default avatarMichael Ludwig <michaelludwig@google.com>
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1161969}
parent 82e70778
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment