Bug 202460
Summary: | imageSmoothingEnabled = false works with stroke() and createPattern() | ||
---|---|---|---|
Product: | WebKit | Reporter: | Chris Lord <clord> |
Component: | Canvas | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ahmad.saleem792, dino, karlcow, sabouhallawa, simon.fraser, webkit-bug-importer |
Priority: | P2 | Keywords: | BrowserCompat, InRadar, WPTImpact |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | https://wpt.live/html/canvas/element/manual/image-smoothing/imagesmoothing.html | ||
Bug Depends on: | 179191 | ||
Bug Blocks: |
Chris Lord
This test passes on iOS, but fails on Mac, Windows and Linux (WPE and GTK) with:
FAIL Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with fillRect and createPattern(). assert_array_equals: property 0, expected 0 but got 178
FAIL Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with fill() and createPattern(). assert_array_equals: property 0, expected 0 but got 178
FAIL Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with stroke() and createPattern(). assert_array_equals: property 0, expected 0 but got 178
Note, the 178 is 176 on Windows/Linux (presumably because they share the Cairo graphics backend?)
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/104292106>
Karl Dubost
https://wpt.live/html/canvas/element/manual/image-smoothing/imagesmoothing.html
https://wpt.fyi/html/canvas/element/manual/image-smoothing/imagesmoothing.html
The tests are failing on most recent builds on both macOS and iOS.
Ahmad Saleem
Web-Spec:
If the original image data is a bitmap image, then the value painted at a point in the area of the repetitions is computed by filtering the original image data. When scaling up, if the imageSmoothingEnabled attribute is set to false, then the image must be rendered using nearest-neighbor interpolation. Otherwise, the user agent may use any filtering algorithm (for example bilinear interpolation or nearest-neighbor). User agents which support multiple filtering algorithms may use the value of the imageSmoothingQuality attribute to guide the choice of filtering algorithm. When such a filtering algorithm requires a pixel value from outside the original image data, it must instead use the value from wrapping the pixel's coordinates to the original image's dimensions. (That is, the filter uses 'repeat' behavior, regardless of the value of the pattern's repetition behavior.)
https://html.spec.whatwg.org/multipage/canvas.html#dom-canvaspattern-settransform (Bullet 2).