Combine the getPathJs and hasBuiltPath methods in the CompiledFont class#21599
Conversation
…nt` class This avoids duplicating the charCode/glyphId lookup, and (slightly) shortens the code. In particular: - Given that the path-data is returned as a TypedArray, it's easy enough to instead return `null` to indicate that the glyph was previously compiled. - The charCode-cache can be changed into a Set, since we only need to track the "seen" charCodes and not their relation to the glyphIds. - The `compileFontPathInfo` call is moved into `CompiledFont` class, since that simplifies the `src/core/evaluator.js` code a tiny bit.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21599 +/- ##
==========================================
- Coverage 89.85% 89.78% -0.08%
==========================================
Files 263 263
Lines 66757 66757
==========================================
- Hits 59983 59935 -48
- Misses 6774 6822 +48
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/botio browsertest |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/158be0e6cf202df/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/19b32afc06f1c35/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/19b32afc06f1c35/output.txt Total script time: 19.17 mins
Image differences available at: http://54.241.84.105:8877/19b32afc06f1c35/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/158be0e6cf202df/output.txt Total script time: 25.54 mins
|
|
Looks simpler indeed; thanks! |
This avoids duplicating the charCode/glyphId lookup, and (slightly) shortens the code. In particular:
Given that the path-data is returned as a TypedArray, it's easy enough to instead return
nullto indicate that the glyph was previously compiled.The charCode-cache can be changed into a Set, since we only need to track the "seen" charCodes and not their relation to the glyphIds.
The
compileFontPathInfocall is moved intoCompiledFontclass, since that simplifies thesrc/core/evaluator.jscode a tiny bit.