Skip to content
Commit e7422024 authored by Haoyu Zhang's avatar Haoyu Zhang
Browse files

Introduce Layout#fillCharacterBounds

Introduce Layout#fillCharacterBounds to compute character bounds faster.
This change makes TextView#populateCharacter 5 times faster.

After:
        populateCharacterBounds[mTextLength (100))]_min (ns): 52361
        populateCharacterBounds[mTextLength (300))]_min (ns): 148941
        populateCharacterBounds[mTextLength (1,000))]_min (ns): 463237
        populateCharacterBounds[mTextLength (3,000))]_min (ns): 1388081
        populateCharacterBounds[mTextLength (10,000))]_min (ns): 1165867

Before:
        populateCharacterBounds[mTextLength (100))]_min (ns): 204065
        populateCharacterBounds[mTextLength (300))]_min (ns): 653159
        populateCharacterBounds[mTextLength (1,000))]_min (ns): 2184327
        populateCharacterBounds[mTextLength (3,000))]_min (ns): 6770318
        populateCharacterBounds[mTextLength (10,000))]_min (ns): 22777530

Bug: 233922052
Test: atest android.text.TextViewPopulateCharacterBoundsTest
Test: atest android.text.TextViewCursorAnchorInfoPerfTest
Change-Id: I68a47cf3099b89e0a10604b7706fa7a3dea66d32
parent 6cdf9112
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