Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Issue 1943993003: Cache hb_font_t and the user data container instead of hb_face_t (Closed)

Created:
4 years, 7 months ago by drott
Modified:
4 years, 7 months ago
Reviewers:
eae, behdad
CC:
blink-reviews, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), jbroman, Justin Novosad, kinuko+watch, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Cache hb_font_t and the user data container instead of hb_face_t Previously, we did cache the hb_face_t but not the hb_font_t, and instead generated an hb_font_t for each HarfBuzzFace object, outside of the cache. In the prepareHarfBuzzFontData() function, we also reset the font functions on the newly created hb_font_t. So in the HarfBuzzFace constructor and in each created HarfBuzzFace object, we would create hb_font_t and reset it, instead of reusing this from the cache, too. This lead to HarfBuzz reloading font tables for each FontPlatformData instance, instead of using the per-unique-typeface caching mechanism. This should address the memory regression we have been observing on Android. BUG=577306 R=behdad,eae

Patch Set 1 #

Total comments: 1

Patch Set 2 : Bug filed for FIXME #

Patch Set 3 : Attempt to fix windows by rounding scale factor #

Patch Set 4 : Additional paint setup instead of rounding #

Patch Set 5 : Reset paint flags properly #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -81 lines) Patch
M third_party/WebKit/Source/platform/fonts/FontPlatformData.cpp View 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/opentype/OpenTypeCapsSupportMPL.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h View 3 chunks +13 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp View 1 2 3 4 4 chunks +75 lines, -70 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 34 (15 generated)
drott
4 years, 7 months ago (2016-05-04 12:43:22 UTC) #1
eae
https://codereview.chromium.org/1943993003/diff/1/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp File third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp (right): https://codereview.chromium.org/1943993003/diff/1/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp#newcode80 third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp:80: // independet of size, then consider using this here. ...
4 years, 7 months ago (2016-05-04 12:46:03 UTC) #2
behdad
lgtm Great! I tested this in Content Shell on Android and indeed it reduces the ...
4 years, 7 months ago (2016-05-04 12:47:13 UTC) #3
drott
Bug filed for FIXME
4 years, 7 months ago (2016-05-04 12:54:00 UTC) #4
eae
LGTM, thank you!
4 years, 7 months ago (2016-05-04 12:54:48 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1943993003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1943993003/20001
4 years, 7 months ago (2016-05-04 12:55:07 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1943993003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1943993003/20001
4 years, 7 months ago (2016-05-04 14:59:10 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/216167)
4 years, 7 months ago (2016-05-04 16:38:13 UTC) #14
drott
Attempt to fix windows by rounding scale factor
4 years, 7 months ago (2016-05-04 17:57:50 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1943993003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1943993003/40001
4 years, 7 months ago (2016-05-04 17:58:29 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1943993003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1943993003/40001
4 years, 7 months ago (2016-05-04 17:59:03 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/216399)
4 years, 7 months ago (2016-05-04 22:39:39 UTC) #23
drott
Additional paint setup instead of rounding
4 years, 7 months ago (2016-05-05 10:40:47 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1943993003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1943993003/60001
4 years, 7 months ago (2016-05-05 10:40:52 UTC) #26
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-05 12:24:36 UTC) #28
drott
Reset paint flegs properly
4 years, 7 months ago (2016-05-05 14:38:58 UTC) #30
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1943993003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1943993003/80001
4 years, 7 months ago (2016-05-05 14:39:12 UTC) #31
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-05 15:44:51 UTC) #33
drott
4 years, 7 months ago (2016-05-06 11:59:26 UTC) #34
Message was sent while issue was closed.
We landed the other version, with the Windows change separately.

Powered by Google App Engine
This is Rietveld 408576698