c9611626465f9e11817854f554e7b7d0c6cee905 |
|
12-Jan-2018 |
Seigo Nonaka <nona@google.com> |
Store hyphenated pieces in MeasuredText Do hyphenation calculation at the same time of measuring character widths. We can do the 93% of line break work beforehand. Here is a raw performance score: (walleye-userdebug, w/o patch -> w/ patch, N=30) Measured Balanced Hyphenation : 11,428,287 -> 703,417 (-93.8%) Measured Balanced NoHyphenation: 535,660 -> 536,210 (+0.1%) Random Balanced Hyphenation : 18,903,251 -> 19,046,535 (+0.8%) Random Balanced NoHyphenation : 7,973,160 -> 7,956,803 (-0.2%) Measured Greedy Hyphenation : 486,633 -> 486,381 (-0.1%) Measured Greedy NoHyphenation : 484,716 -> 490,018 (+1.1%) Random Greedy Hyphenation : 7,966,823 -> 7,921,520 (-0.6%) Random Greedy NoHyphenation : 7,918,480 -> 7,925,110 (+0.1%) This CL also removes overhang member variable from MeasuredText since this is no longer used in line breaker. Bug: 67504091 Test: bit CtsTextTestCases:* Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest Test: minikin_tests Change-Id: I94c65980bf1190c9351d50dc0c811a377fb93ee6
/frameworks/minikin/libs/minikin/OptimalLineBreaker.cpp
|
366f57fb4efd0ddf5d48cd232cd88d3777517ea2 |
|
09-Jan-2018 |
Seigo Nonaka <nona@google.com> |
Reorganize optimal line breaker This CL contains: - Rename LineBreakImpl.{h|cpp} with OptimalLineBreaker.{h|cpp} - Extract line break candidate enumeration code from LineBreakerImpl and rename LineBreakImpl with LineBreakOptimizer. - Fix unexpected hyphenation by ordering hyphenation break point and desperate break points. - Refactor line break candidate enumeration code. Compatibility: To check the compatibility from current implementation, manually compared the line break result for the UDHR text (http://unicode.org/udhr/). Then verified new implementation completely replicate the same output as the current implementation except for desperate breaks. Here is the combination verified: Langauge: ar, zh-CN, zh-TW, nl, fr, de, it, ja, ko, po, pl-PL, pl-BR, ru, es-ES, th, tr, bg, ca, hr, cs, da, el, he, hi, hu, id, lv, lt, no, ro, sr-Cyrl, sr-Latn, sk, sl, sv, uk, vi Font Size: 14px, 15px, 16px, 17px, 18px, 19px Line Width: 128px, 256px, 512px, 1024px Performance: Verified this doesn't cause performance regression. Here is raw performance score. StaticLayoutPerfTest(walleye-userdebug, w/o patch -> w/ patch, N=50): Random Text, No Hyphen : 7,782,872 -> 7,754,140 (-0.37%) Random Text, Hyphen : 19,028,618 -> 18,942,728 (-0.45%) measured Text, No Hyphen : 346,625 -> 349,809 (+0.92%) measured Text, Hyphen : 11,411,894 -> 11,379,360 (-0.29%) Bug: 71709070 Bug: 65024629 Test: minikin_tests Test: bit CtsTextTestCases:* Test: bit FrameworksCoreTests:android.text.StaticLayoutTest Change-Id: I1933335764405da6d7c82cf1d1af1692e6d10a04
/frameworks/minikin/libs/minikin/OptimalLineBreaker.cpp
|