History log of /frameworks/minikin/include/minikin/Macros.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e9bf55ab62350e91a748432ebf72566453332807 16-Feb-2018 Seigo Nonaka <nona@google.com> Enable thread safety annotation

Bug: 65024629
Test: minikin_tests
Test: minikin_stress_tests
Change-Id: I7a118b56c9ef241d9446126386f778466df15db8
/frameworks/minikin/include/minikin/Macros.h
a22996e31226e3dcbfb0c57d03ca9ac54028fc28 01-Feb-2018 Seigo Nonaka <nona@google.com> Remove HbFontCache

This is 2nd attempt of the If86840fcf9.

HbFontCache was introduced for saving hb_font_t creation cost, but it
turned out that creating hb_font_t from another hb_font_t is cheap.

Instead of computing hb_font_t from buffer, compute hb_font_t in Zygote
process and store it in Font class.

By this change, mutex lock is no longer necessary for all HarfBuzz
related function calls.

StaticLayout creation time (w/o -> w/ patch, N=10, walleye-userdebug):
MeasuredText Balanced Hyphenation : 712,896 -> 705,864: (-1.0%)
MeasuredText Balanced NoHyphenation: 548,745 -> 535,891: (-2.3%)
MeasuredText Greedy Hyphenation : 486,093 -> 479,541: (-1.3%)
MeasuredText Greedy NoHyphenation : 491,053 -> 480,571: (-2.1%)
RandomText Balanced Hyphenation : 17,749,025 -> 17,426,362: (-1.8%)
RandomText Balanced NoHyphenation : 7,433,576 -> 7,401,203: (-0.4%)
RandomText Greedy Hyphenation : 7,388,658 -> 7,327,291: (-0.8%)
RandomText Greedy NoHyphenation : 7,375,390 -> 7,381,066: (+0.1%)

MeasuredText creation time (w/o -> w/ patch, N=10, walleye-userdebug)
Styled Hyphenation : 14,364,510 -> 14,430,830: (+0.5%)
Styled Hyphenation WidthOnly : 13,629,489 -> 13,446,345: (-1.3%)
Styled NoHyphenation : 14,104,669 -> 13,873,049: (-1.6%)
Styled NoHyphenation WidthOnly : 13,304,362 -> 13,091,473: (-1.6%)
NoStyled Hyphenation : 17,512,424 -> 17,368,559: (-0.8%)
NoStyled Hyphenation WidthOnly : 17,095,872 -> 16,985,377: (-0.6%)
NoStyled NoHyphenation : 7,371,994 -> 7,344,223: (-0.4%)
NoStyled NoHyphenation WidthOnly : 6,932,519 -> 6,950,149: (+0.3%)

StaticLayout draw time (w/o -> w/ patch, N=10, walleye-userdebug)
MeasuredText NoStyled : 661,017 -> 657,547: (-0.5%)
MeasuredText NoStyled WithoutCache : 660,506 -> 651,035: (-1.4%)
MeasuredText Styled : 868,116 -> 854,418: (-1.6%)
MeasuredText Styled WithoutCache : 916,078 -> 880,388: (-3.9%)
RandomText NoStyled : 561,192 -> 547,528: (-2.4%)
RandomText NoStyled WithoutCache : 6,758,025 -> 6,695,065: (-0.9%)
RandomText Styled : 2,886,462 -> 2,843,580: (-1.5%)
RandomText Styled WithoutCache : 3,319,513 -> 3,276,261: (-1.3%)

Bug: 37567215
Test: minikin_tests
Test: hwui_unit_tests
Test: atest CtsTextTestCases \
CtsWidgetTestCases:EditTextTest \
CtsWidgetTestCases:TextViewFadingEdgeTest \
FrameworksCoreTests:TextViewFallbackLineSpacingTest \
FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \
CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
Test: bit FrameworksCoreTests:android.text.

Change-Id: If523fce5ce3747b03a1d3bad8c5938a4e2901792
/frameworks/minikin/include/minikin/Macros.h
4de86391218f9fa2d1ba15d78cd80514fb5ce43d 07-Feb-2018 Seigo Nonaka <nona@google.com> Revert "Remove HbFontCache"

This causes a regression for some characters.

This reverts commit 6c6954b40f7a6bd6dcf8a3d01c78600437c2e011.

Bug: 73054061
Change-Id: I010754474eebd55e43666893c4f7af9de12b22f3
/frameworks/minikin/include/minikin/Macros.h
6c6954b40f7a6bd6dcf8a3d01c78600437c2e011 01-Feb-2018 Seigo Nonaka <nona@google.com> Remove HbFontCache

HbFontCache was introduced for saving hb_font_t creation cost, but it
turned out that creating hb_font_t from another hb_font_t is cheap.

Instead of computing hb_font_t from buffer, compute hb_font_t in Zygote
process and store it in Font class.

By this change, mutex lock is no longer necessary for all HarfBuzz
related function calls.

StaticLayout creation time (w/o -> w/ patch, N=10, walleye-userdebug):
MeasuredText Balanced Hyphenation : 712,896 -> 705,864: (-1.0%)
MeasuredText Balanced NoHyphenation: 548,745 -> 535,891: (-2.3%)
MeasuredText Greedy Hyphenation : 486,093 -> 479,541: (-1.3%)
MeasuredText Greedy NoHyphenation : 491,053 -> 480,571: (-2.1%)
RandomText Balanced Hyphenation : 17,749,025 -> 17,426,362: (-1.8%)
RandomText Balanced NoHyphenation : 7,433,576 -> 7,401,203: (-0.4%)
RandomText Greedy Hyphenation : 7,388,658 -> 7,327,291: (-0.8%)
RandomText Greedy NoHyphenation : 7,375,390 -> 7,381,066: (+0.1%)

MeasuredText creation time (w/o -> w/ patch, N=10, walleye-userdebug)
Styled Hyphenation : 14,364,510 -> 14,430,830: (+0.5%)
Styled Hyphenation WidthOnly : 13,629,489 -> 13,446,345: (-1.3%)
Styled NoHyphenation : 14,104,669 -> 13,873,049: (-1.6%)
Styled NoHyphenation WidthOnly : 13,304,362 -> 13,091,473: (-1.6%)
NoStyled Hyphenation : 17,512,424 -> 17,368,559: (-0.8%)
NoStyled Hyphenation WidthOnly : 17,095,872 -> 16,985,377: (-0.6%)
NoStyled NoHyphenation : 7,371,994 -> 7,344,223: (-0.4%)
NoStyled NoHyphenation WidthOnly : 6,932,519 -> 6,950,149: (+0.3%)

StaticLayout draw time (w/o -> w/ patch, N=10, walleye-userdebug)
MeasuredText NoStyled : 661,017 -> 657,547: (-0.5%)
MeasuredText NoStyled WithoutCache : 660,506 -> 651,035: (-1.4%)
MeasuredText Styled : 868,116 -> 854,418: (-1.6%)
MeasuredText Styled WithoutCache : 916,078 -> 880,388: (-3.9%)
RandomText NoStyled : 561,192 -> 547,528: (-2.4%)
RandomText NoStyled WithoutCache : 6,758,025 -> 6,695,065: (-0.9%)
RandomText Styled : 2,886,462 -> 2,843,580: (-1.5%)
RandomText Styled WithoutCache : 3,319,513 -> 3,276,261: (-1.3%)

Bug: 37567215
Test: minikin_tests
Test: hwui_unit_tests
Test: atest CtsTextTestCases \
CtsWidgetTestCases:EditTextTest \
CtsWidgetTestCases:TextViewFadingEdgeTest \
FrameworksCoreTests:TextViewFallbackLineSpacingTest \
FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \
CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
Test: bit FrameworksCoreTests:android.text.

Change-Id: If86840fcf957ca16e3a821204b79156fc23f1596
/frameworks/minikin/include/minikin/Macros.h
26ef1697ea9f110d58f99eb64118f15ae9c6f785 02-Dec-2017 Seigo Nonaka <nona@google.com> Move MeasuredText to its own file and store runs in it.

This lays the ground work for precomputed layout.

This also changes the MeasuredText in LineBreaker from
member variables to method argument.

Bug: 67504091
Test: minikin_tests

Change-Id: Ia5797aa918dd050feb96bcde30a1eb8112708113
/frameworks/minikin/include/minikin/Macros.h
6c8722e217ff5238f0b849152d7936959a728103 30-Nov-2017 Seigo Nonaka <nona@google.com> Apply clang-format

Bug: 65125938
Test: m
Change-Id: I4a4319cc34c186aa0a3ce1d0301af1cd4e0feb81
/frameworks/minikin/include/minikin/Macros.h
0dcb27d502afcb34f59ac85c886ec13a5fdaa0dd 22-Nov-2017 Seigo Nonaka <nona@google.com> Measure the text before starting line break.

To measure the text width before line breaking, extract measuring logic
from LineBreaker and accept measured text result as the argument of
LineBreaker.

LineBreaker still needs style information for hyphenation. Technically
we can measure all possible hyphenation patterns in measure part, but
that's too complex to do at the same time in this CL.

Locally verified this doesn't cause any performance regressions.

Here is a raw performance test result on marlin userdebug.

StaticLayoutPerfTest (median, N=100):
createRandom: 6,189,897 -> 6,121,704 (-1.10%)
createRandom Balanced: 6,183,420 -> 6,038,833 (-2.34%)

TextViewOnMeasurePerfTest (median, N=100):
measure_AtMost: 57,640,596 -> 56,786,386 (-1.48%)
measure_Exactly: 55,566,211 -> 55,305,721 (-0.47%)
measure_Unspecified: 96,236,366 -> 96,088,572 (-0.15%)

Bug: 65024629
Test: atest CtsTextTestCases
Test: atest CtsWidgetTestCases
Test: atest CtsGraphicsTestCases
Test: minikin_tests

Change-Id: Ib0ae50f173a805130d8622164b1b72dc10f5c49e
/frameworks/minikin/include/minikin/Macros.h