New issue
Advanced search Search tips

Issue 870223 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocked on:
issue 868366

Blocking:
issue 828317



Sign in to add a comment

Connect Blink Font Cache to unique font name lookup service on Android

Project Member Reported by drott@chromium.org, Aug 2

Issue description

After we have a lookup service in place, connect Blink's font cache to it so that we can perform src: local() lookups when creating font faces. Do this on Android for now as that is the first platform where we have the lookup in place.

 
Preview of the wip implementation...
src_local_selection.png
251 KB View Download
Cc: js...@chromium.org
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6116f2969e1f844153e043ddbf8dee2d6ab40b34

commit 6116f2969e1f844153e043ddbf8dee2d6ab40b34
Author: Dominik Röttsches <drott@chromium.org>
Date: Wed Aug 15 17:07:26 2018

Move shared unique_font_lookup files to blink/common

Preparation for hooking up Blink on Android to the font unique name
matching service in RenderProcessHost.

Bug:  870223 
Change-Id: I89bd326e78dbd1bdf989265ca6f8820f8d242621
Reviewed-on: https://chromium-review.googlesource.com/1160648
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583288}
[modify] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/content/browser/BUILD.gn
[delete] https://crrev.com/4df313f35745a6d1ad95589ee328cf893aaab4d0/content/browser/font_unique_name_lookup/BUILD.gn
[modify] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/content/browser/font_unique_name_lookup/font_unique_name_lookup.cc
[modify] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/content/browser/font_unique_name_lookup/font_unique_name_lookup.h
[modify] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/content/browser/font_unique_name_lookup/font_unique_name_lookup_unittest.cc
[delete] https://crrev.com/4df313f35745a6d1ad95589ee328cf893aaab4d0/content/browser/font_unique_name_lookup/icu_fold_case_util.h
[modify] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/content/test/BUILD.gn
[modify] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/common/BUILD.gn
[modify] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/common/DEPS
[rename] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/common/font_unique_name_lookup/font_table_matcher.cc
[rename] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/common/font_unique_name_lookup/font_table_matcher_unittest.cc
[rename] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/common/font_unique_name_lookup/icu_fold_case_util.cc
[rename] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/common/font_unique_name_lookup/icu_fold_case_util_unittest.cc
[modify] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/public/BUILD.gn
[modify] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/public/common/BUILD.gn
[rename] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h
[rename] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/public/common/font_unique_name_lookup/font_unique_name_table.proto
[add] https://crrev.com/6116f2969e1f844153e043ddbf8dee2d6ab40b34/third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/84f31be16a7f127f560dffa033effec536b18335

commit 84f31be16a7f127f560dffa033effec536b18335
Author: Dominik Röttsches <drott@chromium.org>
Date: Mon Aug 20 13:56:15 2018

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}
[modify] https://crrev.com/84f31be16a7f127f560dffa033effec536b18335/third_party/blink/renderer/core/css/style_engine_test.cc
[modify] https://crrev.com/84f31be16a7f127f560dffa033effec536b18335/third_party/blink/renderer/platform/BUILD.gn
[add] https://crrev.com/84f31be16a7f127f560dffa033effec536b18335/third_party/blink/renderer/platform/fonts/android/font_unique_name_lookup_android.cc
[add] https://crrev.com/84f31be16a7f127f560dffa033effec536b18335/third_party/blink/renderer/platform/fonts/android/font_unique_name_lookup_android.h
[modify] https://crrev.com/84f31be16a7f127f560dffa033effec536b18335/third_party/blink/renderer/platform/fonts/font_global_context.cc
[modify] https://crrev.com/84f31be16a7f127f560dffa033effec536b18335/third_party/blink/renderer/platform/fonts/font_global_context.h
[add] https://crrev.com/84f31be16a7f127f560dffa033effec536b18335/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.cc
[add] https://crrev.com/84f31be16a7f127f560dffa033effec536b18335/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h
[modify] https://crrev.com/84f31be16a7f127f560dffa033effec536b18335/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc

Status: Fixed (was: Started)

Sign in to add a comment