Make FontCascade::setShouldUseSmoothing/shouldUseSmoothing thread safe
Created attachment 446301 [details] Patch
Comment on attachment 446301 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446301&action=review > Source/WebCore/ChangeLog:11 > + same time from the main thread. This setting is only changed from > + Internals and WebView and at WebProcess initilization, but should WebKitLegacy and WebKit have SPI for this: + (void)_setShouldUseFontSmoothing:(BOOL)f { WebCore::FontCascade::setShouldUseSmoothing(f); } void WKContextSetShouldUseFontSmoothing(WKContextRef contextRef, bool useFontSmoothing) { WebKit::toImpl(contextRef)->setShouldUseFontSmoothing(useFontSmoothing); } > Source/WebCore/platform/graphics/FontCascade.cpp:442 > +static std::atomic<bool> shouldUseFontSmoothing = true; Is it possible to make this no longer a global? I think that would be a better solution than this.
<rdar://problem/86506527>
(In reply to Myles C. Maxfield from comment #2) > > > Source/WebCore/platform/graphics/FontCascade.cpp:442 > > +static std::atomic<bool> shouldUseFontSmoothing = true; > > Is it possible to make this no longer a global? I think that would be a > better solution than this. We could store this on the per-thread FontCache instances, but that then makes it harder to mutate with the SPI, since we'd have to dispatch it to all threads that have a FontCache initialised.
(In reply to Matt Woodrow from comment #4) > (In reply to Myles C. Maxfield from comment #2) > > > > > Source/WebCore/platform/graphics/FontCascade.cpp:442 > > > +static std::atomic<bool> shouldUseFontSmoothing = true; > > > > Is it possible to make this no longer a global? I think that would be a > > better solution than this. > > We could store this on the per-thread FontCache instances, but that then > makes it harder to mutate with the SPI, since we'd have to dispatch it to > all threads that have a FontCache initialised. I guess I still think that's a better solution than a global :/
Alternatively, we could try to find all callers of the SPI and see if we can remove it.
Pull request: https://github.com/WebKit/WebKit/pull/4240
Committed 254500@main (eb547e04a187): <https://commits.webkit.org/254500@main> Reviewed commits have been landed. Closing PR #4240 and removing active labels.