OSDN Git Service

Use SpanSet to accelerate Layout.drawBackground
authorGilles Debunne <debunne@google.com>
Tue, 13 Mar 2012 18:26:05 +0000 (11:26 -0700)
committerGilles Debunne <debunne@google.com>
Tue, 13 Mar 2012 22:58:33 +0000 (15:58 -0700)
commit60e3b3fa60a672583fe6294139feb940845efc9b
tree714ceb21482c5982067924a66c9bd6d8a77357d3
parent6810a2442b7c38a3f5d04aa91cef9c0cc5f92cb9
Use SpanSet to accelerate Layout.drawBackground

The main performance improvement should come from the fact
that we entirely skip the loop (which calls getLineStart, getLineTop
and getLineDescent on each line) in the frequent case where there
are no LineBackgroundSpans.

Change-Id: Ie2d3168521e88d43f1a4236da2b3e8447606df1e
core/java/android/text/Layout.java