Skip to content
Commit 6f1868b8 authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Associate native MeasuredText with Java one.

To measure text beforehand, remove static layout dependency from
MeasuredText. Now MeasuredText can compute native measured text
by itself and StaticLayout use it for line breaking.

This CL introduce one additional JNI method call per paragraph during
line breaking but looks negligible cost.

Here is a raw performance test result on walleye-userdebug.

StaticLayoutPerfTest (median, N=100):
createRandom:          7,879,440 -> 7,964,789 (+1.08%)
createRandom Balanced: 7,835,192 -> 7,848,151 (+0.17%)

TextViewOnMeasurePerfTest (median, N=100):
measure_AtMost:       92,599,175 ->  93,027,121 (+0.47%)
measure_Exactly:      89,949,922 ->  90,439,886 (+0.54%)
measure_Unspecified: 148,645,916 -> 150,047,694 (+0.94%)

Bug: 67504091
Test: bit CtsTextTestCases:*
Test: bit CtsWidgetTestCases:*
Test: bit CtsGraphicsTestCases:*
Test: bit FrameworksCoreTests:android.text.StaticLayoutTest
Change-Id: Ie932903845645e50cfa0cb428babb31a44babc47
parent f1644f73
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment