Closed Bug 1380014 Opened 3 years ago Closed 2 years ago

Share fonts between BlobImage and WebRender


(Core :: Graphics: WebRender, enhancement, P1)




Tracking Status
firefox56 --- unaffected
firefox57 --- unaffected
firefox58 --- fixed


(Reporter: jrmuizel, Assigned: jrmuizel)



(Keywords: stale-bug, Whiteboard: [wr-mvp])


(5 files, 4 obsolete files)

We can use FontKeys to share Fonts across the process boundary and avoid duplicating the data with WebRender.
Assignee: nobody → jmuizelaar
This doesn't retain the UnscaledFonts between paints which causes a bunch of overhead because the situation with FreeType is not thread safe. However it gets rid of the serialization.
Depends on: 1381949
Attached patch V2 (obsolete) — Splinter Review
Attachment #8886668 - Attachment is obsolete: true
This is probably going to be a nightly blocker.
Blocks: stage-wr-nightly
No longer blocks: stage-wr-trains
Priority: P3 → P1
Whiteboard: [wr-mvp]
Target Milestone: --- → mozilla57
Attached patch Expose GetFontKeyForUnscaledFont (obsolete) — Splinter Review
We'll use this to share fonts with BlobImages
Attachment #8891054 - Attachment is obsolete: true
Attachment #8922393 - Flags: review?(lsalzman)
This changes the serialization format a little bit. We now have an index at the end of the blob. This is currently used to store a list of the used font keys. In the future we'll add rects and can use it for invalidation.
Attachment #8922396 - Flags: review?(lsalzman)
Comment on attachment 8922393 [details] [diff] [review]
Expose GetFontKeyForUnscaledFont

You should make sure you bail out inside GetFontKeyForScaledFont if GetFontKeyForUnscaledFont returns a null FontKey, instead of proceeding to create a FontInstanceKey with the null FontKey.
Attachment #8922394 - Flags: review?(lsalzman) → review+
Comment on attachment 8922396 [details] [diff] [review]
Share fonts with WebRender

In answer to the query in the patch, Linux always used FontType::FONTCONFIG. Only Android uses FontType::FREETYPE.
Attachment #8922396 - Flags: review?(lsalzman) → review+
Attachment #8922393 - Attachment is obsolete: true
Attachment #8922393 - Flags: review?(lsalzman)
Attachment #8922435 - Flags: review?(lsalzman)
Attachment #8922435 - Flags: review?(lsalzman) → review+
Pushed by
Expose GetFontKeyForUnscaledFont. r=lsalzman
Add the ability to record UnscaledFonts by index. r=lsalzman
Share fonts with WebRender. r=lsalzman
Attachment #8923050 - Flags: review?(lsalzman)
Attachment #8923050 - Flags: review?(lsalzman) → review+
These patches changed webrender_bindings but didn't regen the ffi header. Now my WR update try pushes are failing because the regen'd header doesn't compile.

Try push:
The changes that show up in the regen'd file as a result of this:
Flags: needinfo?(jmuizelaar)
Flags: needinfo?(jmuizelaar)
If you like this you can land it if you want it earlier than I get around to landing it. (I'm going to be out for most of day)
Attachment #8923095 - Flags: review?(bugmail)
Attachment #8923095 - Attachment is patch: true
Attachment #8923095 - Flags: review?(bugmail) → review+
Depends on: 1412565
Depends on: 1412848
Depends on: 1436375
You need to log in before you can comment on or make changes to this bug.