Connect FontCache to font unique name matching
Create an abstraction for platform specific font unique name matching and provide an implementation for Android that connect to the FontUniqueNameLookup service in RenderProcessHost, and retrieves a shared memory readonly region with a font lookup table. The font lookup table comes in the form of a protobuf that can be parsed using a library shared between content/browser and blink. On the first @font-face declaration that contains a src: local() value and is used in the text, connect to the service, and parse the lookup table, perform a lookup. Subsequent lookups will reuse the same table. After an Android firmware update which triggers a font rescan on the browser side service side, on a Nexus 6, rebuilding the index takes about 45ms. This is a one-time cost. After that, until the next firmware update, the browser process only needs to read the index file back from disk. On the renderer side, for the first font-face that uses src: local(), there is an initial IPC cost for retrieving the shared memory region and parsing the protobuf. Measurements on the previous implementation indicate that this takes less than 6ms. After that for the first and subsequent src: local() lookups, the cost is only the search through the in-memory list. Design doc in https://crbug.com/828317 Bug: 870223 Change-Id: I0bb200235dd7a9f29f3a5165a31e3c5c0cb7527e Reviewed-on: https://chromium-review.googlesource.com/1162166 Commit-Queue: Dominik Röttsches <drott@chromium.org> Reviewed-by:Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#584429}
Showing
Please register or sign in to comment