Bug 223005 - [BigSur arm64] 4 canvas-color-fonts tests consistently failing
Summary: [BigSur arm64] 4 canvas-color-fonts tests consistently failing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-09 15:57 PST by Ryan Haddad
Modified: 2021-06-28 18:10 PDT (History)
7 users (show)

See Also:


Attachments
Patch (4.92 KB, patch)
2021-06-27 16:31 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch (4.96 KB, patch)
2021-06-27 18:51 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Radar WebKit Bug Importer 2021-03-09 15:57:33 PST
<rdar://problem/75239330>
Comment 2 Ryan Haddad 2021-03-09 16:57:40 PST
Marked tests as failing in https://trac.webkit.org/changeset/274188/webkit
Comment 3 Cameron McCormack (:heycam) 2021-06-27 16:31:54 PDT
Created attachment 432357 [details]
Patch
Comment 4 Cameron McCormack (:heycam) 2021-06-27 18:51:20 PDT
Created attachment 432362 [details]
Patch
Comment 5 Simon Fraser (smfr) 2021-06-28 09:13:11 PDT
Comment on attachment 432362 [details]
Patch

How did they pass before?
Comment 6 Cameron McCormack (:heycam) 2021-06-28 14:50:18 PDT
(In reply to Simon Fraser (smfr) from comment #5)
> How did they pass before?

Because there are bugs stroking text with anti-aliasing turned off when accelerated canvas drawing is enabled on macOS.  There are two bugs I've noticed -- one is that on ARM anti-aliasing is unexpectedly used, which is the reason these tests were marked as failing on ARM originally.  The other is that on Intel, requests to stroke at 1px end up being stroked at 2px.  I'll file some bugs here to track.

(These tests don't run on platforms that don't support color fonts.)
Comment 7 Cameron McCormack (:heycam) 2021-06-28 15:28:00 PDT
(In reply to Cameron McCormack (:heycam) from comment #6)
> Because there are bugs stroking text with anti-aliasing turned off when
> accelerated canvas drawing is enabled on macOS.  There are two bugs I've
> noticed -- one is that on ARM anti-aliasing is unexpectedly used, which is
> the reason these tests were marked as failing on ARM originally.

Filed bug 227465 for that.

> The other is that on Intel, requests to stroke at 1px end up being stroked
> at 2px.

This I'm not sure whether it's a bug.  I think we end up with a 2px thick stroke because the 1px stroke straddles pixel boundaries, and the non-anti-aliased stroke covers both pixels.  Maybe that's the correct thing to do.  Though it is a difference from the non-accelerated canvas rendering behavior.
Comment 8 Cameron McCormack (:heycam) 2021-06-28 15:35:41 PDT
(In reply to Cameron McCormack (:heycam) from comment #7)
> This I'm not sure whether it's a bug.  I think we end up with a 2px thick
> stroke because the 1px stroke straddles pixel boundaries, and the
> non-anti-aliased stroke covers both pixels.

And by "think" I mean I tried changing the test to render the text at a 0.5px offset and the result was a 1px thick stroke.
Comment 9 EWS 2021-06-28 18:10:42 PDT
Committed r279356 (239224@main): <https://commits.webkit.org/239224@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 432362 [details].