Reorganize JNI in StaticLayout
This CL reorganize the JNI strategy as follows:
- Remove nNewBuilder/nFreeBuilder.
- Make addStyleRun/addReplacementRun CriticalNative.
- Remove nSetupParagraph and pass necessary arguments to
nComputeLineBreaks instead.
Here is a performance scores: (w/o patch -> w/ patch)
StaticLayoutPerfTest (median):
createRandom: 3,755,090 -> 3,781,394 (+0.70%)
createRandom Balanced: 3,702,837 -> 3,730,435 (+0.74%)
TextViewOnMeasurePerfTest (median):
measure_AtMost: 39,172,360 -> 35,883,014 (-8.4%)
measure_Exactly: 38,005,066 -> 34,585,052 (-9.0%)
measure_Unspecified: 67,191,780 -> 63,100,545 (-6.1%)
Bug: 65024629
Test: bit CtsTextTestCases:*
Test: bit CtsWidgetTestCases:*
Change-Id: If9db1fdd2b03a1cf240f87322c1e852cf8085fff
5 files changed