WebKit
WebKit copied to clipboard
Account for CTM scale when deciding the image resampling algorithm
Account for CTM scale when deciding the image resampling algorithm https://bugs.webkit.org/show_bug.cgi?id=115158 Reviewed by NOBODY (OOPS!). Merge - https://chromium.googlesource.com/chromium/blink/+/b772b4d7c24b66bebba703fd2ef89fbe73ea1935 ImageQualityController considers the image size and layout size when computing which resampling algorithm to use, but did not account for the current transform. This was noticeable as 'bouncing' when scaling an image directly with a transform. This patch incorporates the context's CTM (which includes scale but not zoom) into the resampling calculation. Because the ImageQualityController runs on a 500ms timer, a manual test has been added. * Source/WebCore/rendering/ImageQualityController.cpp (ImageQualityController::interpolationQuality): Rename "size" to "layoutSize (ImageQualityController::chooseInterpolationQuality): (1) Move "unzoomed" image below (2) Moved up "AffineTransform" and "contextIsScaled" before resizing condition (3) Introduced "scaledImageSize" and "scaledLayoutSize" and replace usage of "size" with "scaleLayoutSize" (4) Replace use of 'size' with 'scaledLayoutSize' * ManualTests/image-resampling-with-scale.html: Added Test
https://github.com/WebKit/WebKit/commit/caea033889bc1e428d9934547ddf514179eb877c
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/4f56e8a733fb1dccef83c8b44be7214f8d93454d)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/795174230a4402292aafe8c93bdcc98e34c757d0)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/76b0345681cfa92b3ed6c2c604b05faa1f5a3870)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/07c7b6f9e5e02d5ac4fa6b247f6cfe21961cd226)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/2397aafc45dfd6e4fde8821023b4a81a2564840e)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/d54fb283a50efb88efedff1fc596d51b794877a4)
EWS run on current version of this PR (hash https://github.com/WebKit/WebKit/commit/caea033889bc1e428d9934547ddf514179eb877c)
So this optimization was removed later - https://chromium.googlesource.com/chromium/blink/+/59209c03f1ef165ca73f12f0527a0819309daefd%5E%21/#F0