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:Michael Ludwig <michaelludwig@google.com> Commit-Queue: Kyle Charbonneau <kylechar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1161969}
Loading
Please register or sign in to comment