The last indent should be repeated, so we need to pass an int array
instead of null even if the indent offset is out of array length.
Bug: 65024629
Test: bit CtsTextTestCases:android.text.cts.StaticLayoutTest
Test: bit CtsTextTestCases:android.text.cts.DynamicLayoutTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Bug: 65024629
Change-Id: Ic1274d797db27ae1921135a27bab55e475369710
* Increase the ascent and descent of individual lines in StaticLayout
as needed, if any fallback fonts that end up getting used call for
it. For backward compatibility, this is hidden behind a builder
flag.
* Document in Paint.java that the returned parameters are only for
the default font, and a layout may need more space based on
fallbacks used.
Also update for changes in minikin API:
* MinikinFont now requires a method for getting vertical extents
(ascent, descent, and line gap).
* minikin API now allows asking for vertical extents of laid out
text.
* minikin API's LineBreaker now returns ascents and descents for each
line.
Finally, added performances test for creating a StaticLayout.
Follwing are the numbers on a marlin with a stable clock before and
after this CL.
For fixed text almost always hitting the cache:
Before: mean=260684 median=260188 min=258532 standardDeviation=1897
After: mean=262432 median=261509 min=260429 standardDeviation=2185
For random text almost never hitting the cache:
Before: mean=5971827 median=5991126 min=5886871 standardDeviation=83724
After: mean=6337093 median=6317010 min=6311222 standardDeviation=40213
Bug: 28963299
Bug: 29063863
Bug: 32057121
Bug: 37756858
Test: bit FrameworksCoreTests:android.text.
Test: bit CtsTextTestCases:*
Change-Id: I482a98ff8f472e8bab4f0ba9d1d7b368858038ff
Previously, measures all paragraph for deciding view width.
However, in case AT_MOST measurment, we can stop calculating measure if
the measured paragraph already exceeds the upper limit.
Bug: 64389125
Test: bit CtsWidgetTestCases:*
Test: CorePerfTest. Here is a result before and after this patch.
Before:
INSTRUMENTATION_STATUS: measure_AtMost_median=50332114
INSTRUMENTATION_STATUS: measure_Exactly_median=28276317
INSTRUMENTATION_STATUS: measure_Unspecified_median=50193036
After:
INSTRUMENTATION_STATUS: measure_AtMost_median=28475187
INSTRUMENTATION_STATUS: measure_Exactly_median=26944710
INSTRUMENTATION_STATUS: measure_Unspecified_median=50880088
Change-Id: I2a39eb39817a8f845c4fa2e174a905a2d057096e
The dashbaord suggests that multiple tests are always capped at the same
value due to the timeout. To collect the actual metric, set a larger
timeout value, 10s for now.
Also, added a test to stop managed profile user. However, the test is
still finishing surprisingly fast because of the empty broadcast queue.
Bug: 62096041
Test: adb shell am instrument -e class android.multiuser.UserLifecycleTest -w com.android.perftests.multiuser/android.support.test.runner.AndroidJUnitRunner
Change-Id: Ia52db17525d9eb960c9a8c860cdb52c0f487e5f1
Developer can specify android:fontFamily with three ways, pre-defined
font family name, e.g. "sans-serif", path to the font file in resource
directory, e.g. "res/fonts/Roboto-Regular.ttf", or path to the XML font
family file, e.g. "res/fonts/Roboto.xml".
Resources.getFont treats font files and XML files but pre-defined family
name is handled by TextView. Thus, we can early exit if the passed value
is not likely resource path.
This improves the inflation performance.
The score without this patch:
gfx-avg-frame-time-50: 6.9
gfx-avg-frame-time-90: 9.4
gfx-avg-frame-time-95: 10.4
gfx-avg-frame-time-99: 16.7
The score with this patch:
gfx-avg-frame-time-50: 7.0
gfx-avg-frame-time-90: 8.9
gfx-avg-frame-time-95: 9.7
gfx-avg-frame-time-99: 16.5
Measured on bullhead-userdebug.
The APCT perf test improves from
String FontFamily: 200,086 -> 132,561
File FontFamily : 199,256 -> 161,843
XML FontFamily : 203,681 -> 158,553
Measured on angler-userdebug.
Bug: 38232467
Test: UiBenchmark
Change-Id: Ia601ae7207ae8c60848c9efdbb9396267a57257c
Only do access checks if there's a cache miss. If there's
a cache hit then those checks have necessarily already
passed once so we don't need to repeatedly do them
on every access.
Before:
timeCachedGetSharedPreferences_mean=126084
After:
timeCachedGetSharedPreferences_mean=362
Test: ran perf test
Change-Id: I51f0186f8e66c05ea0e5a457930377d1460dea17
dx doesn't like classes in the java.* namespace unless it is compiling
a core library. Move SystemPerfTest to
android.perftests.SystemPerfTest.
Test: builds
Change-Id: I24951d2c9a71d8bb873763d1ccd2f1a67f2be64e
* public attr "autoSizeText" becomes "autoSizeTextType"
(inlined with all other methods and naming)
* documentation for autoSizetextType "uniform" re-worked:
"The TextView scales text size both horizontally and
vertically to fit within the container"
* converted comments into Javadoc for
TextView#AUTO_SIZE_TEXT_TYPE_NONE and
TextView#AUTO_SIZE_TEXT_TYPE_UNIFORM
* better documented attr "autoSizePresetSizes" to specify
it is a resource array of dimensions
* various small fixes in comments
Bug: 35755149
Bug: 35763485
Bug: 35764658
Bug: 32221168
Test: run cts-dev -m CtsWidgetTestCases -t \
android.widget.cts.TextViewTest
Change-Id: I36afd399e005521b6e85922aa9e1e4418bb960e1
This CL is no-op (cosmetics only)
* renames autoSizeText type "xy" to "uniform"
* renames attribute "autoSizeStepSizeSet" to "autoSizePresetSizes"
* renames "AUTO_SIZE_TEXT_TYPE_XY" to "AUTO_SIZE_TEXT_TYPE_UNIFORM"
* renames public TextView#getAutoSizeTextPresetSizes() to public
TextView#getAutoSizeTextAvailableSizes() because this method can
return either preset sizes or computed sizes (via min/max/step)
Bug: 34923754
Bug: 32221168
Test: associated test renames in the same topic
Change-Id: Ifacccf21ca014b6c0a07322fa02b7859ee53e387
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.
Bug: 30188076
Test: make checkbuild
Change-Id: If507b641624a2933e722f61e815890fcdf442265
Bug: 33460152
Test: adb shell am instrument -w -e class android.view.ViewShowHidePerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner
- Also FastNative for setDisplayList, simplifying upcall into field setter.
- Also removes depth sweep parameter for ViewShowHideTests for now, they're not
providing much extra info.
Together with Outline/Path CL, about 25% faster visibility toggles
960MHz Bullhead Before (prior to Outline/Path CL):
$ adb shell am instrument -w -e class android.view.ViewShowHidePerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner | grep min
INSTRUMENTATION_STATUS: add[Factory:NestedLinearLayoutTree,depth:6]_min=743505
INSTRUMENTATION_STATUS: goneToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=332420
INSTRUMENTATION_STATUS: invisibleToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=354154
INSTRUMENTATION_STATUS: recordAfterAdd[Factory:NestedLinearLayoutTree,depth:6]_min=1106095
INSTRUMENTATION_STATUS: remove[Factory:NestedLinearLayoutTree,depth:6]_min=1261290
INSTRUMENTATION_STATUS: visibleToGone[Factory:NestedLinearLayoutTree,depth:6]_min=356153
INSTRUMENTATION_STATUS: visibleToInvisible[Factory:NestedLinearLayoutTree,depth:6]_min=362149
After (this CL + Outline/Path CL):
$ adb shell am instrument -w -e class android.view.ViewShowHidePerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner | grep min
INSTRUMENTATION_STATUS: add[Factory:NestedLinearLayoutTree,depth:6]_min=636061
INSTRUMENTATION_STATUS: goneToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=267481
INSTRUMENTATION_STATUS: invisibleToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=289433
INSTRUMENTATION_STATUS: recordAfterAdd[Factory:NestedLinearLayoutTree,depth:6]_min=976827
INSTRUMENTATION_STATUS: remove[Factory:NestedLinearLayoutTree,depth:6]_min=1207286
INSTRUMENTATION_STATUS: visibleToGone[Factory:NestedLinearLayoutTree,depth:6]_min=286148
INSTRUMENTATION_STATUS: visibleToInvisible[Factory:NestedLinearLayoutTree,depth:6]_min=292834
Change-Id: Iaddfa9550bdbab807c662595d005126d98cdc277
Performance test for the number of sizes to choose from
when autosizing.
Tests for 5, 10, 50, 100, 300, 500, 1000, 10000 and
100000!!! different sizes.
Bug: 32740812
Bug: 32221168
Test: this is the test
Change-Id: I611bbf659e51d0236a2ddafb2e2498165cea07a0
Also speed up RenderNode creation:
Use finalizer() instead of NativeAllocationRegistry, this
shaves ~3us off of creation currently
Avoid instanceof, instead have SurfaceView explicitly ask
for updates.
Remove unused method call.
Test: ran benchmarks
Change-Id: I3117fdf72313a4e6a9965baca9f2a8b855c19b34
CL reduces BenchmarkState to minimal levels. It also adds
a warmup loop to get things going first before starting measurements.
With this change with clocks /not/ locked on bullhead the test for
RenderNodeJniOverhead is showing a stable (0ns std dev) result
of 54ns, which is approximately the expected amount.
Test: Ran a few perf benchmarks
Change-Id: If01e455884711ebd9cfb89f076efa19dc0b5436d
b/31928255
Test: run LayoutPerfTest VectorDrawablePerfTest before and after the change
data is consistent.
Change-Id: I30de1f09b1df571479009048d621fef57b94f316
After Ie8c42d60a0bff7636795a958a475058798061fe5,
ActivityTestRule is no longer a subclass of UiThreadTestRule, and looks
like the new UiThreadTest annotation is not working for Parameterized
test. As a temporary fix, use runOnUiThread instead of @UiThreadTest.
Change-Id: I69d035864259c1f0765d52ebc53634d3ef8ef84a
With I63af3a6ecbf92, we create RenderNode lazily, but
blocks containing contents that protrude from line top or
bottom cannot be simply lazily redrawn after edit or
scroll.
With this CL, we check if the contents protrude from line
top or bottom by comparing the text bounds with relevant
font metrics values and we always redrawn such blocks after
edit or scroll.
Bug: 27889485
Change-Id: I666da5eeb39f780c341597f347bfcba21eb34295
Merge core, graphics, and misc into one
test suite as the split is unneccessary.
Also cleans up package names
Change-Id: I82da6cd69b3a52c63770465780ac98628af334ca