Commit Graph

3829 Commits

Author SHA1 Message Date
Andrey Kulikov
c15c9ca54c Introduce View.getAnimationMatrix()
Adding a corresponding getter for the recently opened View.setAnimationMatrix(Matrix).

Bug: 126376184
Test: new cts tests added
Change-Id: I9d5abb1ae3606d2e3884859ce9a81c11c65613d6
2019-03-12 14:53:06 +00:00
TreeHugger Robot
b80a06a88a Merge "Address API review from the council" 2019-03-08 19:29:48 +00:00
TreeHugger Robot
ad07707cac Merge "Document how RenderNode properties form the transform matrix" 2019-03-08 02:48:54 +00:00
Seigo Nonaka
de41eeaafd Address API review from the council
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
2019-03-07 18:23:35 -08:00
John Reck
b7a14d5d51 Document how RenderNode properties form the transform matrix
Fixes: 125026642
Test: none
Change-Id: I30b12e2230ec8513eb789b82e107778ab7bce5ec
2019-03-07 15:12:54 -08:00
John Reck
d7300de54b Merge "Address API council feedback" 2019-03-07 22:09:33 +00:00
Nader Jawad
8bcc12a98f Merge "Added Nullability annotations to new Canvas APIs" 2019-03-07 22:06:32 +00:00
Nader Jawad
fbe2eabd3b Added Nullability annotations to new Canvas APIs
Added @NonNull annotation to drawDoubleRoundRect float array
parameters

Bug: 126702234
Test: N/A
Change-Id: Ib81fcc4ad6d5f2c471e4f6fb5ace4bdfc1d89b33
2019-03-07 09:43:34 -08:00
John Reck
28a1f9428e Address API council feedback
Fixes: 127532446
Test: build & checked docs
Change-Id: Ibf14ad52040694ccd503aaa187b99c19338b727a
2019-03-06 17:31:36 -08:00
TreeHugger Robot
1b042a7c6e Merge "Pass ColorSpace to AnimatedImageDrawable" 2019-03-06 03:37:23 +00:00
TreeHugger Robot
153f106109 Merge "Cleanup functor system-api surface" 2019-03-05 18:45:55 +00:00
Leon Scroggins
a3882ad859 Merge "Explain why Bitmap#setColorSpace is @NonNull" 2019-03-05 18:19:53 +00:00
TreeHugger Robot
0ab1f9250c Merge "Implemented API-review suggested changes on GradientDrawable" 2019-03-05 17:53:31 +00:00
TreeHugger Robot
6d6b53969a Merge "Added nullability annotations to StateListDrawable APIs" 2019-03-05 17:49:23 +00:00
TreeHugger Robot
3b6672deb5 Merge "Add nullability annotations to HardwareRenderer" 2019-03-05 17:37:48 +00:00
TreeHugger Robot
aa20063ef8 Merge "Add missing nullability to RenderNode" 2019-03-05 17:37:10 +00:00
Leon Scroggins III
4580ae1293 Explain why Bitmap#setColorSpace is @NonNull
Bug: 127282638
Test: No change in behavior
Change-Id: I167893b1d80ae37982804ec0dfa98b68d6eaab53
2019-03-05 10:02:12 -05:00
TreeHugger Robot
07cd0c7f3c Merge "Fix RenderNode sample" 2019-03-05 08:01:17 +00:00
Chong Zhang
58077d5d53 Add "image/heic" to supported mimes of ImageDecoder
bug: 127364815
Test: atest android.graphics.cts.ImageDecoderTest
Change-Id: I510a492b1770af70b9a36c239d043f8b09088fc2
2019-03-04 17:21:54 -08:00
Jeff Sharkey
678151592d Merge "API to determine if MIME type is supported." 2019-03-05 01:11:14 +00:00
John Reck
e9aeadb1e7 Cleanup functor system-api surface
Fixes: 127282736
Test: none
Change-Id: I5982d3f4f0671a3c351c11d8baf04aff5640e0a6
2019-03-04 10:29:40 -08:00
John Reck
ab6caf3e50 Add missing nullability to RenderNode
Fixes: 126701521
Test: none
Change-Id: I57dc2fddd28de79005a932759a05d2ddb84d28a9
2019-03-04 10:25:31 -08:00
John Reck
45d70c2bc2 Add nullability annotations to HardwareRenderer
Fixes: 126701502
Test: none
Change-Id: Ic215ffeb8decdadd1ae140c0b278b481b3eb010c
2019-03-04 10:20:27 -08:00
John Reck
c5735202fc Fix RenderNode sample
Fixes: 125027490
Test: none
Change-Id: I31dfdbe1da972f49fbf97ef2d0015b7b054139ae
2019-03-04 10:11:21 -08:00
Alan Stokes
6390339290 Merge "Fix javadoc HTML escaping." am: 693e023bac am: 4514c01068
am: 555ef78e35

Change-Id: I72faadd47fcd35ed8a5fc2e9e95cadc72cac3c27
2019-03-04 08:56:40 -08:00
Jeff Sharkey
575f065150 API to determine if MIME type is supported.
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
2019-03-01 11:46:15 -07:00
Ashley Rose
fa1a371750 Merge "Add nullability annotations to ColorStateListDrawable" 2019-03-01 18:37:48 +00:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
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
2019-02-28 23:29:04 -07:00
Nader Jawad
abe349cda9 Added nullability annotations to StateListDrawable APIs
Addressing API review feedback to add nullability annotations to
StateListDrawable#findStateDrawableIndex getStateDrawable and
getStateSet

Bug: 126699087
Bug: 126699432
Test: N/A
Change-Id: I5a74ee9a9208800cd1430bc24856c0aeff77c61a
2019-03-01 00:15:24 +00:00
Ashley Rose
24192c806a Add nullability annotations to ColorStateListDrawable
Test: Annotation-only change, exsiting tests still pass
Change-Id: I34d56679658045aa57b93cfd6ad77b2859ce224a
Fix: 126701617
Fix: 126701492
2019-02-28 18:26:07 -05:00
TreeHugger Robot
8d6a8c5626 Merge "Mark Bitmap#getColor as @NonNull" 2019-02-28 22:50:24 +00:00
Adam Powell
b10113347d Merge "System gesture exclusion rects for Views" 2019-02-28 21:11:59 +00:00
Nader Jawad
f26382fd9c Implemented API-review suggested changes on GradientDrawable
--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
2019-02-28 10:23:45 -08:00
Alan Stokes
a9b5b2aab0 Fix javadoc HTML escaping.
HTLM special characters ('<', '>' and '&') don't need to be escaped
inside {@code}, even though they do elsewhere in javadoc. And in fact
they shouldn't be - because if they are escaped then the escaped
version shows up verbatim in the developer docs.

See for example:
https://developer.android.com/reference/android/graphics/drawable/GradientDrawable
https://developer.android.com/reference/android/support/v13/view/inputmethod/InputConnectionCompat

This change just removes the escaping to fix the public documentation.

Test: N/A (only comment lines changed)
Change-Id: I131b3b3e26547e30cff7b67514d177c48926bb26
2019-02-28 17:42:50 +00:00
Leon Scroggins III
0dd9dd84bb Mark Bitmap#getColor as @NonNull
Bug: 126700762
Test: None

This method will never return null. It will either throw an Exception or
return the Color at the specified location. Update the annotation to
make that explicit.

Change-Id: I276c0f84eac030758714b6736da29a7fdc175b7c
2019-02-28 12:00:04 -05:00
Leon Scroggins
8a62499d80 Merge "Support Canvas#drawVertices on GPU-backed Canvases" 2019-02-27 13:33:05 +00:00
Adam Powell
769b8638f9 System gesture exclusion rects for Views
Allow views to register a list of rects where the device's system UI
should not intercept complex (read: down+move+up) gestures on specific
sub-regions of the view. This should not be used for large-scale,
full-view gesture recognition such as scrolling, but rather for specific
areas such as SeekBar's scroll thumb or DrawerLayout's edge strip for
swiping open a navigation drawer.

Add ability for ViewTreeObserver to observe transformed exclusion rects

Bug: 126360272
Test: atest android.view.cts.SystemGestureExclusionRectsTest
Change-Id: If89b6f66637e40efa12955d6408f6e37b25cb46f
2019-02-26 15:37:25 -08:00
Leon Scroggins III
40724e4beb Support Canvas#drawVertices on GPU-backed Canvases
Bug: 28039105
Test: Iaeee40de42c46819558729c792ad36a74265cf61

Skia already supports this, so just remove the silent failure on
hardware Canvases.

Change-Id: I2ccd508e6f42ace57bbee9af5852e2daa1f25105
2019-02-26 14:32:25 -05:00
Leon Scroggins III
eac1423a31 Pass ColorSpace to AnimatedImageDrawable
Bug: 123301872
Bug: 117601185
Test: Manual (Ie18811ba29a1db163aca08472b04ae185e9344f0)
Test: CTS (Ie4b0a232effc67ab7a7fc6070302c722177cadfa)
Test: Infeasible (verify desired ColorSpace is used)

When calling setTargetColorSpace on an ImageDecoder for an animated
image, pass this to the AnimatedImageDrawable. Also respect an EXTENDED
ColorSpace as a cue to decode to RGBA_F16, as with Bitmaps.

Call ImageDecoder#checkState for AnimatedImageDrawables, as with
Bitmaps.

Change-Id: I5f6e11ee14ce4477bfedf2d1fdde8e15ed5f24d5
2019-02-26 12:03:29 -05:00
Cuiping.x.Shu
171beb55db Merge "Check recycled when createBitmap" am: cc9f4923d2 am: 2b8063d780
am: 73c478f1bd

Change-Id: Ic8daf7c007670b096e3b7193fe9ccfed3061ff93
2019-02-25 23:04:57 -08:00
TreeHugger Robot
3d61f89275 Merge "Address API council feedback" 2019-02-25 19:21:52 +00:00
Cuiping.x.Shu
0a5c8c15eb Check recycled when createBitmap
This is to avoid framework crash when application used
the recycled bitmap memory in createBitmap.

Bug:123656975

Change-Id: I98f93ce48c7bc91913d0b31bca1dc0a10eb319d7
2019-02-23 00:09:26 +00:00
John Reck
e57475e6c9 Address API council feedback
Bug: 125027187
Bug: 125026102
Bug: 125026678
Bug: 125026234
Bug: 125027586
Bug: 125026476
Bug: 125026103
Bug: 125026237
Bug: 125027248
Bug: 125026475
Bug: 125027487
Test: RenderNodeTests
Change-Id: Ic63ea7a3cfe359a7dff0c1b46e534e499f7e928b
2019-02-22 14:24:28 -08:00
TreeHugger Robot
432b9640a6 Merge "Add annotations for ImageReader/ImageWriter factory methods" 2019-02-22 00:27:43 +00:00
TreeHugger Robot
74c8a14af9 Merge "Make ImageDecoder.setTargetColorSpace to EXTENDED promote to F16" 2019-02-20 21:36:58 +00:00
Yin-Chia Yeh
e7c158f114 Add annotations for ImageReader/ImageWriter factory methods
Test: make update-api && make
Bug: 124766727
Change-Id: I7f7c5afd013370ab6e42c28b96b3cfa93e8dc615
2019-02-20 10:48:04 -08:00
TreeHugger Robot
7b8c60e0a7 Merge "Make Bitmap#copy docs more accurate" 2019-02-20 17:55:44 +00:00
TreeHugger Robot
a3c3cf4352 Merge "Hide sSystemFontMap in Typeface." 2019-02-20 08:38:30 +00:00
Stan Iliev
898123b6a3 Start RenderThread earlier to preload Vulkan/EGL drivers
This CL should fix application startup regression for Vulkan
detected by "Hermetic Startup: EmptyActivity" test.
EGL drivers are loaded in a temp thread to leave more time
in RenderThread for other work. Loading EGL drivers
on the RenderThread may cause a perf regression.

Test: Ran cold-dropcache-test test.
Bug: 122659224
Bug: 123361175
Change-Id: I8ca818e98fac196a41d079be15594caca5cb1bab
2019-02-20 02:10:52 +00:00
Qingqing Deng
22273c3f31 Hide sSystemFontMap in Typeface.
Bug: 123769347
Test: no
Change-Id: Ib45000d49a54da8f3b3091a0346152ece70cc3e8
2019-02-19 12:39:07 -08:00