Bug 215685

Summary: CTFontGetPhysicalSymbolicTraits() is faster than CTFontCopyPhysicalFont()/CTFontGetSymbolicTraits()
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: TextAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, darin, ews-watchlist, mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 215684    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
darin: review+
Patch for committing none

Description Myles C. Maxfield 2020-08-19 20:45:27 PDT
We can take a shortcut.
Comment 1 Myles C. Maxfield 2020-08-19 20:55:30 PDT
Created attachment 406910 [details]
Patch
Comment 2 Myles C. Maxfield 2020-08-19 21:43:18 PDT
This patch needs to modify CoreTextSPI.h.
Comment 3 Myles C. Maxfield 2020-08-19 21:52:14 PDT
<rdar://problem/51631817>
Comment 4 Myles C. Maxfield 2020-09-06 15:31:26 PDT
Created attachment 408142 [details]
Patch
Comment 5 Darin Adler 2020-09-06 16:50:02 PDT
Comment on attachment 408142 [details]
Patch

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

> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:858
> +            RetainPtr<CTFontRef> fontForSynthesisComputation = font;

auto fontForSynthesisComputation = retainPtr(font);

> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h:57
> +enum class ShouldComputePhysicalTraits : uint8_t {
> +    Yes,
> +    No
> +};

I suggest bool instead of uint8_t, No before Yes, and putting this on a single line instead of vertically on 4 lines.
Comment 6 Myles C. Maxfield 2020-09-06 17:15:32 PDT
Created attachment 408153 [details]
Patch for committing
Comment 7 EWS 2020-09-06 18:33:35 PDT
Committed r266690: <https://trac.webkit.org/changeset/266690>

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