diff options
| author | Shubham Dubey <dubeyshubham@google.com> | 2022-01-10 05:17:52 +0000 |
|---|---|---|
| committer | Shubham Dubey <dubeyshubham@google.com> | 2022-01-10 08:58:04 +0000 |
| commit | da511945c380b24dfcb4257e192d3b700d70751b (patch) | |
| tree | b4cccbb16c39305345a83caea2816c8742cab027 /core/java/android/text/TextLine.java | |
| parent | a1b7ced11c774d89b0b18b1076f5f0ce8598f0e3 (diff) | |
Revert "Implement fallback line spacing for BoringLayout"
Revert "Add font extent calculation"
Revert "Add test case for fallback line spacing"
Revert submission 16486662-fallback_line_spacing
Reason for revert: Investigate test failures on master
BUGID: b/213826416
BUGID: b/213829920
Reverted Changes:
I06cd7ab71:Add font extent calculation
I6214d52cd:Implement fallback line spacing for BoringLayout
Ia5825c474:Add test case for fallback line spacing
Change-Id: Ia6d6f9f44e73ddaf5e8fe9a8aead7a53efbddd44
Diffstat (limited to 'core/java/android/text/TextLine.java')
| -rw-r--r-- | core/java/android/text/TextLine.java | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/core/java/android/text/TextLine.java b/core/java/android/text/TextLine.java index 2b396612cf3c..1a7ec7f99c95 100644 --- a/core/java/android/text/TextLine.java +++ b/core/java/android/text/TextLine.java @@ -71,8 +71,6 @@ public class TextLine { private Spanned mSpanned; private PrecomputedText mComputed; - private boolean mUseFallbackExtent = false; - // The start and end of a potentially existing ellipsis on this text line. // We use them to filter out replacement and metric affecting spans on ellipsized away chars. private int mEllipsisStart; @@ -143,7 +141,6 @@ public class TextLine { tl.mTabs = null; tl.mChars = null; tl.mComputed = null; - tl.mUseFallbackExtent = false; tl.mMetricAffectingSpanSpanSet.recycle(); tl.mCharacterStyleSpanSet.recycle(); @@ -174,20 +171,17 @@ public class TextLine { * @param ellipsisStart the start of the ellipsis relative to the line * @param ellipsisEnd the end of the ellipsis relative to the line. When there * is no ellipsis, this should be equal to ellipsisStart. - * @param useFallbackLineSpacing true for enabling fallback line spacing. false for disabling - * fallback line spacing. */ @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) public void set(TextPaint paint, CharSequence text, int start, int limit, int dir, Directions directions, boolean hasTabs, TabStops tabStops, - int ellipsisStart, int ellipsisEnd, boolean useFallbackLineSpacing) { + int ellipsisStart, int ellipsisEnd) { mPaint = paint; mText = text; mStart = start; mLen = limit - start; mDir = dir; mDirections = directions; - mUseFallbackExtent = useFallbackLineSpacing; if (mDirections == null) { throw new IllegalArgumentException("Directions cannot be null"); } @@ -851,31 +845,6 @@ public class TextLine { previousLeading); } - private void expandMetricsFromPaint(TextPaint wp, int start, int end, - int contextStart, int contextEnd, boolean runIsRtl, FontMetricsInt fmi) { - - final int previousTop = fmi.top; - final int previousAscent = fmi.ascent; - final int previousDescent = fmi.descent; - final int previousBottom = fmi.bottom; - final int previousLeading = fmi.leading; - - if (mCharsValid) { - int count = end - start; - int contextCount = contextEnd - contextStart; - wp.getFontMetricsInt(mChars, start, count, contextStart, contextCount, runIsRtl, - fmi); - } else { - int delta = mStart; - wp.getFontMetricsInt(mText, delta + start, delta + end, - delta + contextStart, delta + contextEnd, runIsRtl, fmi); - } - - updateMetrics(fmi, previousTop, previousAscent, previousDescent, previousBottom, - previousLeading); - } - - static void updateMetrics(FontMetricsInt fmi, int previousTop, int previousAscent, int previousDescent, int previousBottom, int previousLeading) { fmi.top = Math.min(fmi.top, previousTop); @@ -980,10 +949,6 @@ public class TextLine { shapeTextRun(consumer, wp, start, end, contextStart, contextEnd, runIsRtl, leftX); } - if (mUseFallbackExtent && fmi != null) { - expandMetricsFromPaint(wp, start, end, contextStart, contextEnd, runIsRtl, fmi); - } - if (c != null) { if (wp.bgColor != 0) { int previousColor = wp.getColor(); |
