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

Issue 1525993005: Change CachingWordShapeIterator to delimit CJK characters (Closed)

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

Description

Change CachingWordShapeIterator to delimit CJK characters This patch changes CachingWordShapeIterator to handle one CJK character as a word for the caching purpose. Since these scripts do not delimit words by spaces, text in these scripts do not perform well with the CachingWordShaper. However, since these scripts have break opportunities between almost every character, and since the line breaker, the most performance critical user of CachingWordShaper, splits text at break opportunities, this characteristic is not critical for the layout purpose. There are, however, other cases where this characteristic hits the performance negatively. The <select> element measures the width of all text in its <option> elements to determine its width, and since each <option> usually has unique text, this characteristic of CachingWordShaper slows it down significantly for CJK text. A benchmark of 2352 option elements with CJK text was slower than ASCII by 6-7 times. This patch improves it to 10-20% slower than ASCII on debug builds. There are other callers of HarfBuzzShaper with long text, such as paint, and this patch improves all of them for CJK scripts. BUG=565902, 570229 Committed: https://crrev.com/1494aab723061f943998a92653c41b6f7f8fa01f Cr-Commit-Position: refs/heads/master@{#366421}

Patch Set 1 #

Patch Set 2 : Fix allowTabs case #

Patch Set 3 : Avoid split before COMMON/INHERITED #

Patch Set 4 : Some fixes, cleanup, and more tests #

Patch Set 5 : Minor fixes, more tests, and cleanup #

Patch Set 6 : TestExpectations #

Total comments: 2

Patch Set 7 : Refactor to clarify what nextWord does and less functions #

Total comments: 4

Patch Set 8 : Add test, rebase, TestExpectations #

Patch Set 9 : TestExpectations #

Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -1 line) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/Character.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/Character.cpp View 1 2 3 4 5 6 7 2 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h View 1 2 3 4 5 6 1 chunk +32 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaperTest.cpp View 1 2 3 4 5 6 7 1 chunk +156 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 29 (11 generated)
kojii
Still WIP, but script/font/fallback seemed to change and you might be interested in. From the ...
5 years ago (2015-12-17 05:06:49 UTC) #4
kojii
> 2. Some Emoji on Win/Mac fail to render as Emoji. Haven't figured out why. ...
5 years ago (2015-12-17 11:47:11 UTC) #5
kojii
eae@, PTAL.
5 years ago (2015-12-20 16:14:32 UTC) #10
kojii
On 2015/12/20 16:14:32, kojii wrote: > eae@, PTAL. Forgot to note that this CL has ...
5 years ago (2015-12-20 16:18:39 UTC) #11
drott
Thanks for trying to improve the caching mechanism for CJK, Koji. It's a bit hard ...
5 years ago (2015-12-21 10:36:01 UTC) #12
kojii
https://codereview.chromium.org/1525993005/diff/140001/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h File third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h (right): https://codereview.chromium.org/1525993005/diff/140001/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h#newcode121 third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h:121: // Delimit every CJK character because these scripts do ...
5 years ago (2015-12-21 11:59:56 UTC) #13
drott
On 2015/12/21 11:59:56, kojii wrote: > https://codereview.chromium.org/1525993005/diff/140001/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h > File third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h > (right): > > https://codereview.chromium.org/1525993005/diff/140001/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h#newcode121 ...
5 years ago (2015-12-21 12:26:03 UTC) #14
drott
LGTM, I find this clearer. (With a nit on adding a common-only test case). Sorry ...
5 years ago (2015-12-21 14:57:42 UTC) #15
kojii
Refactored in PS7 given your comment, along with the other CL. This time, the focus ...
5 years ago (2015-12-21 15:02:59 UTC) #16
kojii
On 2015/12/21 14:57:42, drott wrote: > LGTM, I find this clearer. (With a nit on ...
5 years ago (2015-12-21 15:34:54 UTC) #17
drott
On 2015/12/21 15:02:59, kojii wrote: > Refactored in PS7 given your comment, along with the ...
5 years ago (2015-12-21 15:35:11 UTC) #18
kojii
On 2015/12/21 15:35:11, drott wrote: > On 2015/12/21 15:02:59, kojii wrote: > > Refactored in ...
5 years ago (2015-12-21 16:04:52 UTC) #19
drott
> Maybe these are simply bugs, but this CL is changing some paint results. > ...
5 years ago (2015-12-21 16:16:16 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1525993005/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1525993005/200001
5 years ago (2015-12-21 18:20:34 UTC) #23
commit-bot: I haz the power
Committed patchset #9 (id:200001)
5 years ago (2015-12-21 18:26:03 UTC) #25
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/1494aab723061f943998a92653c41b6f7f8fa01f Cr-Commit-Position: refs/heads/master@{#366421}
5 years ago (2015-12-21 18:27:05 UTC) #27
dmurph
On 2015/12/21 at 18:27:05, commit-bot wrote: > Patchset 9 (id:??) landed as https://crrev.com/1494aab723061f943998a92653c41b6f7f8fa01f > Cr-Commit-Position: ...
5 years ago (2015-12-21 22:16:30 UTC) #28
Noel Gordon
5 years ago (2015-12-21 22:46:44 UTC) #29
Message was sent while issue was closed.
Some other layout test text failures here, they seem CJK related

https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.10/build...

Powered by Google App Engine
This is Rietveld 408576698