Bug 236924

Summary: [GPU Process] Text filled with pattern sometimes draw with incorrect color
Product: WebKit Reporter: Jon Lee <jonlee>
Component: WebKit Process ModelAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: hi, mmaxfield, sabouhallawa, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=237728
Bug Depends on:    
Bug Blocks: 233914, 236508    
Attachments:
Description Flags
Patch
none
Patch
mmaxfield: review+
Patch none

Description Jon Lee 2022-02-19 22:00:55 PST
imported/mozilla/svg/linearGradient-basic-03.svg [ ImageOnlyFailure ]
imported/mozilla/svg/pattern-transformed-01.svg [ ImageOnlyFailure ]
svg/gradients/gradient-flipped-start-end-points.svg [ ImageOnlyFailure ]
svg/gradients/spreadMethod.svg [ ImageOnlyFailure ]
svg/gradients/spreadMethodAlpha.svg [ ImageOnlyFailure ]
svg/gradients/spreadMethodDiagonal.svg [ ImageOnlyFailure ]
svg/gradients/spreadMethodDiagonal2.svg [ ImageOnlyFailure ]
svg/gradients/spreadMethodDiagonal3.svg [ ImageOnlyFailure ]
svg/gradients/spreadMethodDiagonal4.svg [ ImageOnlyFailure ]
svg/gradients/spreadMethodDuplicateStop.svg [ ImageOnlyFailure ]
svg/gradients/spreadMethodReversed.svg [ ImageOnlyFailure ]
svg/gradients/stopAlpha.svg [ ImageOnlyFailure ]
svg/transforms/transformed-text-fill-gradient.html [ ImageOnlyFailure ]
svg/transforms/transformed-text-fill-pattern.html [ ImageOnlyFailure ]
Comment 1 Radar WebKit Bug Importer 2022-02-19 22:01:15 PST
<rdar://problem/89196811>
Comment 2 Jon Lee 2022-03-14 23:33:48 PDT
The patch for bug 237728 resolves imported/mozilla/svg/linearGradient-basic-03.svg and svg/gradients/gradient-flipped-start-end-points.svg, and svg/transforms/transformed-text-fill-pattern.html turns into a crash.
Comment 3 Said Abou-Hallawa 2022-03-29 14:56:16 PDT
Created attachment 456066 [details]
Patch
Comment 4 Said Abou-Hallawa 2022-04-04 11:40:32 PDT
Created attachment 456596 [details]
Patch
Comment 5 Myles C. Maxfield 2022-04-05 13:18:22 PDT
Comment on attachment 456596 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=456596&action=review

> Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:152
> +        return;

Can we at least set it to a hardcoded color in this case? So it doesn't get filled with some random previously-used color?

> Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:164
> +        return;

Ditto.
Comment 6 Myles C. Maxfield 2022-04-05 13:20:44 PDT
Comment on attachment 456596 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=456596&action=review

>> Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:152
>> +        return;
> 
> Can we at least set it to a hardcoded color in this case? So it doesn't get filled with some random previously-used color?

Actually, maybe it's better to ASSERT() the return of CGColorGetPattern() is equal to the pattern that was set on the context before recording any glyphs.
Comment 7 Said Abou-Hallawa 2022-04-06 01:08:01 PDT
Created attachment 456788 [details]
Patch
Comment 8 EWS 2022-04-06 10:58:45 PDT
Committed r292478 (249329@main): <https://commits.webkit.org/249329@main>

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