Closed
Bug 1480615
Opened 6 years ago
Closed 6 years ago
Reuse scaled fonts across blob item recordings
Categories
(Core :: Graphics: WebRender, enhancement, P3)
Tracking
()
RESOLVED
FIXED
mozilla64
People
(Reporter: jrmuizel, Assigned: lsalzman)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [gfx-noted])
Attachments
(1 file)
(deleted),
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
For each piece of SVG text we record a new scaled font. This can be quite wasteful in recording size and time.
Reporter | ||
Comment 1•6 years ago
|
||
An idea of how to do this is to add a shared section to blob recordings. This could contain all of the scaled fonts, unscaled fonts and even source surfaces. Items would include a list of all the shared items that they depend on and the blob merging would only copy over the dependencies needed.
Updated•6 years ago
|
Priority: -- → P3
Whiteboard: [gfx-noted]
Comment 2•6 years ago
|
||
I would prefer if we could somehow hook into wr's "native" font management since this has historically been messy and bug-ridden.
Blocks: stage-wr-backlog
Reporter | ||
Comment 3•6 years ago
|
||
(In reply to Alexis Beingessner [:Gankro] from comment #2)
> I would prefer if we could somehow hook into wr's "native" font management
> since this has historically been messy and bug-ridden.
Note this is not about sharing fonts between blobs. Just between the different recordings in the same blob.
Assignee | ||
Comment 4•6 years ago
|
||
I have an idea for how to make sharing work even across separate blobs. I will try to implement it and see if it turns into something worth committing.
Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•6 years ago
|
||
Added a query for getting font instance data out of WR in PR https://github.com/servo/webrender/pull/3002
This will be used later for solving this.
See Also: → https://github.com/servo/webrender/pull/3002
Assignee | ||
Comment 6•6 years ago
|
||
The kernel idea here is that we send over all ScaledFonts used in a blob images as WR FontInstances. Then all the blob image has to do is query that FontInstance data to recreate a ScaledFont if necessary, which will stick around for the rest of the lifetime of the FontInstance. This allows the ScaledFont to not only be reused across recordings within a blob image, but across any number of blob images that share the same ScaledFont.
The advantage of this approach is that creation/deletion of these ScaledFonts are properly synchronized with blob image creation/deletion, because it all gets processed on the WR thread with normal FontInstance management. We don't have to add any extra bookkeeping on the content side to track lifetimes either because all our existing FontInstance handling takes care of that.
Attachment #9005666 -
Flags: review?(jmuizelaar)
Reporter | ||
Comment 7•6 years ago
|
||
Comment on attachment 9005666 [details] [diff] [review]
reuse scaled fonts across blob image recordings
Review of attachment 9005666 [details] [diff] [review]:
-----------------------------------------------------------------
I like it.
Attachment #9005666 -
Flags: review?(jmuizelaar) → review+
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ada6c9fc290c
reuse scaled fonts across blob image recordings. r=jrmuizel
Comment 9•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Updated•6 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•