Bug: 127580253
Test: CtsGraphicsTestCases
Perf: systrace
Follow on to I0b42c17159b290868a6bed7b90da096995504c4d, which did this
for other classes. I expect this to be more efficient due to passing
fewer JNI parameters, which appears to be the case based on the systrace
data for setColor(@ColorLong):
Duration:
(w/o this change) (w/ this change)
avg: 0.010 ms 0.005 ms
max: 9.130 ms 0.239 ms
min: 0.002 ms 0.002 ms
std: 0.052 ms 0.004 ms
The average is twice as fast, the max is significantly shorter, and the
standard deviation is much smaller as well.
Change-Id: I241824bf2a934746df93da1063b14f3080486cb5
Bug: 77949917
Test: I5737be68dccdc5ebb38291bf3515ae25553dcfc2
In P, the switch to Skia HW rendering lost a feature of HWUI's old
renderer: using a Paint with a BitmapShader resulted in filtering the
Bitmap, regardless of whether FILTER_BITMAP_FLAG was set.
This somewhat restores that behavior, in that it results in filtering
BitmapShaders so long as the client doesn't explicitly turn it off. This
also means that it continues to be possible to get a pixellated drawing
if the client *does* explicitly turn it off.
Change-Id: I62c726a0ba281de239092f066a3df041ecbcee5b
Bug: 121304803
Test: Infeasible
Previously, the NativeAllocationRegistry needed to report how much
native memory was being held onto by the Java class in order to get a
more accurate count of how much memory was in use. But recent changes
allow the system to have an even more accurate view of the native memory
with mallinfo(). Further, the AOSP change
Idccb8b50d26c8c3e93cc34040d784f74dfcdbf51 introduces new APIs that allow
distinguishing between large native malloc allocations, which should
cause more frequent mallinfo() checks, and whose sizes need be available
to ahat etc, and smaller native malloc allocations.
Bitmap and AnimatedImageDrawable use the version for large native malloc
allocations. The rest pass an implied size of 0. Note that many of the
old Registries used somewhat arbitrary sizes, reinforcing the fact that
the new way of keeping track of this is better.
Add Bitmap::pixelStorageType to differentiate between types of memory
that should be accounted for by the Registry.
Update Bitmap::getAllocationByteCount to report the actual size of
ashmem allocation.
Fix a typo in LineBreaker.java, discovered while looking to find
existing callers of Bitmap's constructor.
Change-Id: I57c407258450aeaf08b47df32432466639d9faed
Bug: 127580253
Test: CtsGraphicsTestCases
Perf: systrace
Restored with a partial revert of "Add Paint#get(ShadowLayer)ColorLong"
(commit 6ee411010ea270351d495bf357fc294304286a70).
The original CL combined the @ColorInt and @ColorLong version for
simplicity, but required doing extra work for the @ColorInt version.
Separating them back out speeds it up at the cost of more code.
Using systrace I see the following stats:
Duration:
(w/o this change) (w/ this change)
avg: 0.020 ms 0.001 ms
max: 9.141 ms 0.072 ms
min: 0.005 ms 0.001 ms
std: 0.074 ms 0.001 ms
This change shows a significant speed improvement. It does not do the
same for setShadowLayer, which is likely used less frequently.
Change-Id: I9021864fcad7d0149b93674f09339f805c272994
This is from API council feedback.
Bug: 124794899
Test: atest CtsTextTestCases
Test: atest CtsGraphicsTestCases
Change-Id: Ifa95f87067239cca9c0791bf079045e4f645c3ad
I suppressed the font error during resource loading only if the
targetSdkVersion is API 28 or before, but it turned out that this
makes developers hard to use font resources since:
- We don't give a list of supported font files and OEM may extend/shrink
the font support.
- There is no way to resolve this error during layout inflation.
So, now always supress the IllegalArgumentException during building
Typeface in resource loading.
Bug: 127714175
Test: atest CtsTextTestCases
Test: atest CtsGraphicsTestCases
Test: atest FontsContractTest
Test: atest CtsWidgetTestCases
Change-Id: I08b9f27aaf25ff491fa36d0a4befb3c6e64abfcf
Adding a corresponding getter for the recently opened View.setAnimationMatrix(Matrix).
Bug: 126376184
Test: new cts tests added
Change-Id: I9d5abb1ae3606d2e3884859ce9a81c11c65613d6
The hyphen edit is packed into 8bit integer in native library, but this
should not be exposed to public API as API council suggested.
This CL includes:
- Removing packing structure from HyphenEdit and move constants from
Hyphenator to Paint.
- Replace LineBreaker's getLineHyphenEdit with two separate start/end
function.
- Replace Paint's getHyphenEdit with two separate start/end function.
- StaticLayout still relies on this packing mechanism but no longer need
to be the same packing structure as in Minikin.
Bug: 124794844
Test: atest CtsGraphicsTestCases
Test: atest CtsTextTestCases
Change-Id: I8206061f554cf6e119b2b565162f54317eac630a
Here are the list this CL includes:
- Adding missing @NonNull, @Nullable, @IntRange annotations
- Added @Px annotation to Paint.set/getWordSpacing
- Change Builder classes to final.
- Change FileDescriptor to ParcelFileDescriptor as described in guideline.
- With this change, additional error handling is required in old
Typeface.Builder but we can keep the same behavior (silently fallback to
system fallback in error case).
- Fix comment in getLineHyphenEdit in LineBreaker.Result
- Rename setJustified to setJustificationMode in LineBreaker.Builder
Fix: 126702154
Fix: 126701272
Fix: 126701569
Fix: 126701953
Fix: 126701507
Fix: 126701667
Fix: 126700866
Fix: 126701009
Fix: 126700795
Fix: 126700292
Fix: 126699209
Fix: 124795407
Fix: 124795470
Bug: 124794844
Bug: 124794899
Test: m update-api
Test: TreeHugger
Change-Id: If6e8566b0eef9151d35d75b7f258128d7d3df358
This'll help developers decide if they can try decoding an image
file directly, or if they need to convert it to a more general
format first.
Bug: 126276695
Test: atest android.graphics.cts.ImageDecoderTest
Change-Id: I6a404e3be883ac14ac2e6376247d4209f8963908
If they were null, then the Parcelable would fail to work.
Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
--Added @Px annotations to pixel related parameters in added APIs
--Added @FloatRange annotation to float based APIs
(thickness/inner)Ratio
--Added error checking to invalid ratio arguments to
set(Thickness/Inner)ratio
Bug: 126375868
Bug: 126701500
Test: Added CTS tests to verify parameter validation logic
Change-Id: I8ca70f38edd18f68c168d4d6e2c93bcb9b64c488