Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upReduce glyph key to 32 bits #2894
Conversation
I'm not sure this is a valid change - I think the index value for a glyph can make use of the full 32 bit range on some fonts / platforms? |
|
I double checked our |
|
In practice, glyph ids in faces will probably never exceed a u16, though the types allow for it. One idea in the worst case for GlyphKey would be to encode everything in a u32 bitfield. 28 bits for index, 2 bits for subpixel X, bits for subpixel Y, since the subpixel offset only requires 2 bits per field? Then you basically wouldn't have any issues fitting large fonts? |
|
@lsalzman ok, good, thanks for the confirmation!
Funny thing is that this PR does exactly that. I just made a mistake somewhere, probably. |
|
Alright, this should be fixed now. Got bitten by the operator precedence, ouch. |
|
@kvark If mac and windows platforms use a u16, then it's probably reasonable to assume the same on unix platforms. So r=me on this - my only question is whether we need a try run first? |
|
I'll make one tomorrow @gw3583 . Thanks for taking a look! |
|
There appear to be a bunch of intermittent timeouts, but I don't see anything related to the PR. Am I using the wrong try settings, or just an unlucky base revision? cc @staktrace |
|
Looks like unlucky base revision. I'd do another try push on m-c tip just to make sure. |
|
The new try push looks better. |
|
|
Reduce glyph key to 32 bits Related to #2890. As we do quite a few hashmap accesses (at least one per frame per glyph) by this key, reducing its size should help. r? anyone <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2894) <!-- Reviewable:end -->
|
|
kvark commentedJul 13, 2018
•
edited by larsbergstrom
Related to #2890.
As we do quite a few hashmap accesses (at least one per frame per glyph) by this key, reducing its size should help.
r? anyone
This change is