Closed Bug 1380014 Opened 3 years ago Closed 2 years ago

Share fonts between BlobImage and WebRender

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox56 --- unaffected
firefox57 --- unaffected
firefox58 --- fixed

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

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

Attachments

(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
Status: NEW → ASSIGNED
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 jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/630968b6201e
Expose GetFontKeyForUnscaledFont. r=lsalzman
https://hg.mozilla.org/integration/mozilla-inbound/rev/006a45a50d90
Add the ability to record UnscaledFonts by index. r=lsalzman
https://hg.mozilla.org/integration/mozilla-inbound/rev/2a824a8a2277
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: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5640a62bc5b1a7535f21691ba2afb83e6ff97d7a
The changes that show up in the regen'd file as a result of this: https://hg.mozilla.org/try/rev/4f965e0ad18da6125afd0886a5784e2b4970169e
Flags: needinfo?(jmuizelaar)
Looking...
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.