History log of /frameworks/base/core/java/android/text/BoringLayout.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
07e6c237d3f19b98bbec237892a785fd3895368a 04-Apr-2016 Raph Levien <raph@google.com> Apply correct bottom padding to layouts

The returned descender value for BoringLayout and StaticLayout should
be equal to the font's "bottom" metric in the includePadding case.
Previously, the calculation incorrectly included an addition
mBottomPadding value in some cases (which was an attempt to work
around the case where maxLines was set on TextView but not the
corresponding StaticLayout, no longer the case).

Bug: 27901763
Change-Id: I008c5974b979087725a9bb9104e4771b0caac01c
/frameworks/base/core/java/android/text/BoringLayout.java
70f660f2d6220b10ddb5e32d665c38e30f0ab35c 29-Mar-2016 Siyamed Sinir <siyamed@google.com> Reset FontMetrics at each new measurement in BoringLayout

Reset FontMetrics object used in BoringLayout.isBoring to get updated
and correct FontMetrics as a result of measurement.

Bug: 26704088
Change-Id: If77b0edba8dc4b5b1738a802c5f49e112e47b4f2
/frameworks/base/core/java/android/text/BoringLayout.java
3cf8208a62eb493cbd83d7b9d1f155eb174fcee0 16-Mar-2016 Roozbeh Pournader <roozbeh@google.com> Clean up BoringLayout#isBoring() a little

No functional change. Just some renames and clarifications.

Bug: 23641693
Bug: 27702584
Change-Id: I14efe290a27c695ab79bbb18f9f069c8a2d3ffd6
/frameworks/base/core/java/android/text/BoringLayout.java
06f0e41ebdaa356224da12280fccd454ca07cf38 26-Feb-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Remove unused field

Remove an unused field in BoringLayout. This has also the positive
side effect of allowing static initialization in the boot image.

Bug: 27248115
Change-Id: I9d6beec5f5e045ef899e8979ece96e0239f82076
/frameworks/base/core/java/android/text/BoringLayout.java
715589fb46967ce8aff4406ca7bfc58ad3e3b6ed 13-Feb-2016 Siyamed Sinir <siyamed@google.com> Ellipsized and Non-ellipsized baselines should be same.

This CL make sure that ellipsized and non-ellipsized text have the
same baseline.
- TextView did not set the maxLines for StaticLayout when ellipsized
is false. This resulted in height and baseline calculation
discrepancies between ellipsized and non-ellipsized TextViews using
StaticLayout.
- For single line TextViews when a text is not ellipsized
BoringLayout is used, and when text is ellipsized StaticLayout is
used. Because of the bottom padding added to the last line of
StaticLayout, those two did not have the same baseline.

Bug: 18864800
Change-Id: I5dbc48a6c7f0f4ac4c693d5c95f0a99b989e07f4
/frameworks/base/core/java/android/text/BoringLayout.java
44e8d60f53ebeb9734395b041f20cd67dbcf287f 06-Oct-2015 John Reck <jreck@google.com> Super-fast getLineWidth for BL

Bug: 24678704
Change-Id: I952964f450d19b1e127753d00833eb7b34473bba
/frameworks/base/core/java/android/text/BoringLayout.java
a0419de2a99a61f399da5400bdc229998edce6c2 09-Jul-2015 Raph Levien <raph@google.com> Slightly more precise RTL check in BoringLayout.isBoring()

This patch refines the crude check for potential RTL characters, based
on ranges containing RTL scripts and format characters that affect
bidi. This will make it much less likely that a StaticLayout will be
chosen instead of a BoringLayout.

Bug: 22328919
Change-Id: I9a0ed9b3f3373069052de21c836b3372f175430f
/frameworks/base/core/java/android/text/BoringLayout.java
c2a0b4482d7144e8382346ea4c22c7b89368fec0 02-Oct-2014 Neil Fuller <nfuller@google.com> resolved conflicts for merge of ee665151 to lmp-mr1-dev-plus-aosp

Change-Id: I2588c65b7a9fa43f968151a206924a804f0595a7
33253a4baa6279f81a73425b49dfb6abe5f5416e 01-Oct-2014 Neil Fuller <nfuller@google.com> Switch from FloatMath -> Math and Math.hypot where possible

The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.

That said...

Math is faster than FloatMath with AOT compilation.

While making the change, occurances of:

{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))

have been replaced with:

{(float)} Math.hypot(x, y)

Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:

Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().

hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.

Different implementations measured on hammerhead / L:

AOT compiled:

[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials

[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials

[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials

[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials

[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials

[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials

Interpreter:

benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
/frameworks/base/core/java/android/text/BoringLayout.java
d97b097a5b7a906e8d30c6d3b0f41c55650ce7a9 24-Apr-2014 Raph Levien <raph@google.com> Followon fix for 14276128 Clipping at bottom of TextView

The previous fix did not work when the text was ellipsized, because the
test for whether the line was the last line was incorrect. The new test
handles both the end of the buffer and the case where it is the last
line because of ellipsizing.

So this should be the proper fix for bug 14276128 Clipping at bottom of
TextView when lineSpacingMultiplier < 1

This version of the patch also handles the single-line case (which is
computed in BoringLayout rather than StaticLayout).

Change-Id: I88791acc2aa493cc8c599b374f4d213571260b4b
/frameworks/base/core/java/android/text/BoringLayout.java
4b60c30838fbd635964f1e79c057de5048dcc66f 18-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5175022 Easy mode in MeasuredText.setPara() is no more used

- use the real TextDirectionHeuristics constants
- make more formal that LayoutDirection should be resolved BEFORE TextDirection
- reset TextDirection if LayoutDirection is recomputed
- remove non used TextDirectionHeuristic.isRtl(CharSequence...)

Change-Id: I1d53a7e3ee324cfd27785bb4d715d93de8d9ff4d
/frameworks/base/core/java/android/text/BoringLayout.java
cb379120456d8065d742021fc5c66748fc8a11a8 07-Jul-2011 Doug Felt <dougfelt@google.com> Implement textDirection heuristic selection.

Change-Id: I2fcf18de573f2d66494fa5ed61e4273c3c6078c7
/frameworks/base/core/java/android/text/BoringLayout.java
f483e514d4ed3b93cc5ba22beb9c85efcda75535 29-Apr-2011 Gilles Debunne <debunne@google.com> TextView's baseline is correctly computed for empty text.

Bug http://code.google.com/p/android/issues/detail?id=15598

Change-Id: I3aae29b55dc92acca3883b8d14e01dc1c79c2243
/frameworks/base/core/java/android/text/BoringLayout.java
e8e45f2c05cb3b6d23f30c8f96d8e0b3699cea7a 29-Mar-2010 Doug Felt <dougfelt@google.com> Refactor Styled utility functions into reusable objects.

This takes utility functions from Styled and a few other classes and
incorporates them into two new utility classes, TextLine and
MeasuredText. The main point of this is to support shaping by skia,
to experiment with how this will look, this also introduces
character-based Arabic shaping.

MeasuredText is used by code that determines line breaks by generating
and examining character widths in logical order. Factoring the code
in this way makes it usable by the ellipsize functions in TextUtils as
well as by StaticLayout. This class takes over the caching of widths
and chars arrays that was previously performed by StyledText. A small
number of MeasuredText objects are themselves cached by the class and
accesed using static obtain and recycle methods. Generally only these
few cached instances are ever created.

TextLine is used by code that draws or measures text on a line. This
unifies the line measuring and rendering code, and pushes assumptions
about how rtl text is treated closer to the points where skia code is
invoked. TextLine implements the functions that were previously
provided by Styled, working on member arrays rather than
explicitly-passed arguments. It implements the same kind of static
cache as MeasuredText.

TextLine and MeasureText simulate arabic glyph generation and shaping
by using ArabicShaping, ported with very minor changes from ICU4J's
ArabicShaping. This class generates shaped Arabic glyphs and Lam-Alef
ligatures using Unicode presentation forms. ArabicShaping is not
intended to be permanent, but to be replaced by real shaping from the
skia layer. It is introduced in order to emulate the behavior of real
shaping so that higher level code dealing with rendering shaped text
and cursor movement over ligatures can be developed and tested; it
also provides basic-level support for Arabic.

Since cursor movement depends on conjuncts whose formation is
font-dependent, cursor movement code that was formerly in Layout and
StaticLayout was moved into TextLine so that it can work on the shaped
text.

Other than these changes, the other major change is a rework of the
ellipsize utility functions to combine multiple branches into fewer
branches with additional state.

Updated copyright notices on new files.

Change-Id: I492cb58b51f5aaf6f14cb1419bdbed49eac5ba29
/frameworks/base/core/java/android/text/BoringLayout.java
86fcef87b802ee58147127dc5cca940239a30404 18-Aug-2009 Eric Fischer <enf@google.com> Don't use BoringLayout to display text that has paragraph-style markup.

BoringLayout assumes it doesn't have to do any work to calculate the
line height. In this case, though, there may actually be work to be
done, so have it fall back to StaticLayout to do the more thorough job.

Bug 2051050
/frameworks/base/core/java/android/text/BoringLayout.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/text/BoringLayout.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/text/BoringLayout.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/android/text/BoringLayout.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/text/BoringLayout.java