Merge "Improve ellipsize performance" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
bb487c3233
@@ -2280,7 +2280,10 @@ public abstract class Layout {
|
||||
final int ellipsisStringLen = ellipsisString.length();
|
||||
// Use the ellipsis string only if there are that at least as many characters to replace.
|
||||
final boolean useEllipsisString = ellipsisCount >= ellipsisStringLen;
|
||||
for (int i = 0; i < ellipsisCount; i++) {
|
||||
final int min = Math.max(0, start - ellipsisStart - lineStart);
|
||||
final int max = Math.min(ellipsisCount, end - ellipsisStart - lineStart);
|
||||
|
||||
for (int i = min; i < max; i++) {
|
||||
final char c;
|
||||
if (useEllipsisString && i < ellipsisStringLen) {
|
||||
c = ellipsisString.charAt(i);
|
||||
@@ -2289,9 +2292,7 @@ public abstract class Layout {
|
||||
}
|
||||
|
||||
final int a = i + ellipsisStart + lineStart;
|
||||
if (start <= a && a < end) {
|
||||
dest[destoff + a - start] = c;
|
||||
}
|
||||
dest[destoff + a - start] = c;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user