Bug 233981 - Make Windows font smoothing variables thread safe
Summary: Make Windows font smoothing variables thread safe
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks: 233488
  Show dependency treegraph
 
Reported: 2021-12-07 22:43 PST by Cameron McCormack (:heycam)
Modified: 2021-12-14 22:43 PST (History)
6 users (show)

See Also:


Attachments
Patch (5.56 KB, patch)
2021-12-07 22:51 PST, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch (5.56 KB, patch)
2021-12-08 15:35 PST, Cameron McCormack (:heycam)
mmaxfield: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2021-12-07 22:43:00 PST
Make Windows font smoothing variables thread safe
Comment 1 Cameron McCormack (:heycam) 2021-12-07 22:51:39 PST
Created attachment 446306 [details]
Patch
Comment 2 Cameron McCormack (:heycam) 2021-12-08 15:35:26 PST
Created attachment 446440 [details]
Patch
Comment 3 Cameron McCormack (:heycam) 2021-12-08 15:36:14 PST
Note that I've added WTF_GUARDED_BY_LOCK attributes but this is Windows code, and MSVC doesn't support those, so it's more like documentation.
Comment 4 Myles C. Maxfield 2021-12-08 21:11:17 PST
Comment on attachment 446440 [details]
Patch

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

> Source/WebCore/ChangeLog:3
> +        Make Windows font smoothing variables thread safe

Is Fujii in the process of deleting these? https://bugs.webkit.org/show_bug.cgi?id=206273
Comment 5 Fujii Hironori 2021-12-09 22:07:55 PST
Comment on attachment 446440 [details]
Patch

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

>> Source/WebCore/ChangeLog:3
>> +        Make Windows font smoothing variables thread safe
> 
> Is Fujii in the process of deleting these? https://bugs.webkit.org/show_bug.cgi?id=206273

I don't think so. Bug 206273 seems irrelevant.
Comment 6 Myles C. Maxfield 2021-12-10 15:35:52 PST
Comment on attachment 446440 [details]
Patch

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

I assume you grepped to find all uses?

> Source/WebCore/platform/graphics/FontCascade.h:330
> +    static Lock s_fontSmoothingLock;
> +    static double s_fontSmoothingContrast WTF_GUARDED_BY_LOCK(s_fontSmoothingLock);
> +    static uint32_t s_fontSmoothingType WTF_GUARDED_BY_LOCK(s_fontSmoothingLock);
> +    static int s_fontSmoothingLevel WTF_GUARDED_BY_LOCK(s_fontSmoothingLock);
> +    static uint32_t s_systemFontSmoothingType WTF_GUARDED_BY_LOCK(s_fontSmoothingLock);
> +    static bool s_systemFontSmoothingSet WTF_GUARDED_BY_LOCK(s_fontSmoothingLock);
> +    static bool s_systemFontSmoothingEnabled WTF_GUARDED_BY_LOCK(s_fontSmoothingLock);

I kind of think this is a poor design and these shouldn't be statics in the first place ...
Comment 7 Radar WebKit Bug Importer 2021-12-14 22:43:17 PST
<rdar://problem/86507092>