Commit Graph

3820 Commits

Author SHA1 Message Date
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
Leon Scroggins III
28f3943fd4 Make ImageDecoder.setTargetColorSpace to EXTENDED promote to F16
Bug: 117601185
Test: I5e5bc6b73d5d27ae30f00507d59896008d4cf364

ImageDecoder does not have a way to request decoding to F16 on 8 bit
images, but it does have a way to request an EXTENDED ColorSpace. Treat
that as a request to use a higher bit depth. This matches how we match
EXTENDED to F16 in other cases (createBitmap, Bitmap#copy, etc).

Change-Id: I3d31b13b56bb57a23b47ffcb2eaba11c53e0b8d9
2019-02-19 11:50:19 -05:00
TreeHugger Robot
c04886e8aa Merge "Added additional documentation to Bitmap#getScaledWidth, Bitmap#getScaledHeight" 2019-02-15 04:40:08 +00:00
Nader Jawad
9167126a4c Added additional documentation to Bitmap#getScaledWidth,
Bitmap#getScaledHeight

Added additional comments describing the logic behind bitmap
dimension conversion between source and target densities

Change-Id: I7a8f9fddadad337430319a826458d1811809cef6
Fixes: 115292074
Test: N/A
2019-02-14 13:38:27 -08:00
TreeHugger Robot
af73171510 Merge "Restore getIntrinsicWidth behavior from Android O" 2019-02-14 21:14:31 +00:00
John Reck
989bb3714f Merge "Make HardwareRenderer public API" 2019-02-14 20:40:13 +00:00
Nader Jawad
79a31f32ca Restore getIntrinsicWidth behavior from Android O
Updated ImageDecoder InputStreamSource to always respect the given
inputDensity regardless if the provided resource class is null
or not.

Fixes: 115836404
Test: AI8dcdc764a963e95d6c0ad644a1e05f055c748c75 Added CTS test to
verify intrinsic bounds of resolved Drawable respects display density

Change-Id: I54e5835a8bceea9c991972ff7f106dbed29b6662
2019-02-14 10:58:07 -08:00
Leon Scroggins III
97783ad1c1 Make Bitmap#copy docs more accurate
Bug: 121001670
Test: Only a documentation change.

Since Ied0426f6deff354df5998691703a18ddd33ccd3d, we no longer always
apply the ColorSpace to the copy.

Change-Id: I67f486e5c69abb2dd767ac3f1b0da515f9f20e69
2019-02-14 12:18:33 -05:00
Derek Sollenberger
bf3e464704 Refine ColorSpace restrictions for Bitmaps
Bug: 123377741
Bug: 120870651
Bug: 121001670
Bug: 123374456
Bug: 124052364

Test: I90adb511c8fdefe016028da4fd53b079d8367bf6

RGBA_F16 is no longer restricted to particular ColorSpaces. (Previously,
it was LINEAR_EXTENDED_SRGB when decoded, and EXTENDED_SRGB when
created.) Instead, F16 is now EXTENDED if there is an EXTENDED variant,
but is otherwise not special. It defaults to SRGB (but EXTENDED), but
can be created or decoded to other ColorSpaces.

Likewise, smaller Configs use the non-EXTENDED variant, when the
EXTENDED variant was requested.

ALPHA_8 always has a null ColorSpace.

Add TransferParameters to EXTENDED_SRGB. This seems to be a relic from a
time before Skia treated SkColorSpaces as non-bounded. Make it have the
same parameters as SRGB, so that it can be used in native code. e.g. now
we can draw to/from it.

Fix a bug getting the ColorSpace for gray image. ImageDecoder's info
previously reported that a gray image's ColorSpace is null. (Though it
correctly decoded it with the proper ColorSpace.)

Allow setColorSpace to request SRGB on an EXTENDED_SRGB F16 Bitmap. (It
has no visible effect.)

Do *not* allow setting a ColorSpace on an ALPHA_8 Bitmap (throw an
Exception). Other attempts to create a Bitmap with ALPHA_8 and a
non-null ColorSpace silently use null, for backwards compatibility.

Copying *from* an ALPHA_8 to another Config returns a Bitmap with SRGB.

Change-Id: Ied0426f6deff354df5998691703a18ddd33ccd3d
2019-02-13 13:59:37 -05:00
TreeHugger Robot
63ad256efc Merge "Add trackingBug to Typeface.sSystemFontMap." 2019-02-12 20:51:34 +00:00