4038 Commits

Author SHA1 Message Date
Andrew Sapperstein
1f6e22cbd8 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
2020-05-01 00:42:22 +00:00
Xin Li
e13851556b DO NOT MERGE - Merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-master
Bug: 146167222
Change-Id: Ifeb003ec9b3bf824f04d31a117aea65d517241fb
2020-01-15 16:15:41 -08:00
Treehugger Robot
c674b05757 Merge "Use new UnsupportedAppUsage annotation." 2020-01-14 13:50:12 +00:00
Automerger Merge Worker
859b6345c3 Merge "Use new UnsupportedAppUsage annotation." am: 57a0beab18 am: 2eff83dcb3
Change-Id: I48f93c43b66f4d329ef6068b4f74b4c68809c099
2020-01-10 15:17:50 +00:00
Artur Satayev
2a9f3b8811 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I8ffa1da1bcd43c25f4ff817575db77a33c0f3d31
Merged-In: I8ffa1da1bcd43c25f4ff817575db77a33c0f3d31
2020-01-09 15:20:16 +00:00
Artur Satayev
7651f0a4c0 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I4bc8c9482e4bb1af21363f951affff7ee3fefeab
Merged-In: I4bc8c9482e4bb1af21363f951affff7ee3fefeab
2020-01-09 15:13:52 +00:00
Joshua Baxter
3f7792b9bc Merge "docs: Fix docs for Canvas#drawTextOnPath add parameter descriptions for index and count in drawTextOnPath fix a couple of typos" into qt-dev am: 228d235d5b am: 5f4d7e4ac5
am: d59ed2f2a7

Change-Id: I8e2b227a3e54c75feec00e574bf219c5a24e0d8f
2019-11-11 14:29:15 -08:00
Joshua Baxter
228d235d5b Merge "docs: Fix docs for Canvas#drawTextOnPath add parameter descriptions for index and count in drawTextOnPath fix a couple of typos" into qt-dev 2019-11-11 21:52:31 +00:00
Joshua Baxter
28a023d243 Merge "docs: fix typos" into qt-dev am: f6c85f3c0d am: 256363052e
am: bd87d666eb

Change-Id: I8e78ea52159d64334ba1d2ed5b5fa08beaf270f4
2019-11-06 14:17:51 -08:00
Joshua Baxter
811e7aa557 docs: fix typos
Change-Id: Ica9765713212955caf3c7fb246ef4ad8ca0e1c35
test: make ds-docs
bug: 113636515
2019-11-06 21:16:00 +00:00
Joshua Baxter
d20c23b15f docs: Fix docs for Canvas#drawTextOnPath
add parameter descriptions for index and count in drawTextOnPath
fix a couple of typos

test: make ds-docs
Bug: 36969777
Change-Id: I7c451fac4468fb2066b9b29a321fad57785a8a36
2019-11-06 20:58:32 +00:00
Nader Jawad
431ef55e8b Merge "Revert "Fixed default angle to be Orientation.LEFT_RIGHT"" into qt-qpr1-dev
am: 9e3ef79a9f

Change-Id: I3f24f9be2b27bf8ae54e492bdca31ed7894e9f01
2019-09-20 18:42:15 -07:00
Nader Jawad
85c1a0c6b9 Revert "Fixed default angle to be Orientation.LEFT_RIGHT"
This reverts commit d31d0967209775ae352092d3125adfd59c8040d0.

Reason for revert: Although this change fixed the behavior change for for creation of
GradientDrawables defined in xml, the default value for GradientDrawables defined
programmatically is different. The default orientation for GradientDrawables defined
in xml is LEFT_RIGHT, however, the default orientation for GradientDrawables defined
programmatically is TOP_BOTTOM. Since a fix for AAPT has been made to automatically
insert an angle measurement of 0 if one is not defined, we can revert this CL and target
a proper fix in master.

Change-Id: Ib8983386832fb25f53b5e68e76e9d41d9d26fec9
Merged-In: Ib8983386832fb25f53b5e68e76e9d41d9d26fec9
2019-09-20 23:27:20 +00:00
Nader Jawad
c065f1da4e Merge "Fixed default angle to be Orientation.LEFT_RIGHT" into qt-qpr1-dev
am: 9740b2c3b0

Change-Id: I3076655fc4df75078fb36d162e3afd06cac7f46d
2019-08-29 19:05:57 -07:00
Nader Jawad
d31d096720 Fixed default angle to be Orientation.LEFT_RIGHT
Fixed issue where in Android Q if no angle measurement
was specified the default gradient orientation of TOP_BOTTOM
was applied instead of the previous behavior of LEFT_RIGHT

Bug: 139822941
Test: Added CTS test to verify GradientDrawableTest
Change-Id: Ia8c53455740a29e1d123c90616066e16ddb4a241
(cherry picked from commit bd00e4c6c0e56f20d7274817477035c4d4924c3d)
2019-08-27 20:28:04 +00:00
Kevin Hufnagle
12873fe364 Merge "docs: Added missing comma in RectF class description." into qt-dev
am: 0c77665c37

Change-Id: Id587253cf5591c2dcd5ec3e0b317e88aa9c59c3d
2019-07-31 18:18:23 -07:00
Kevin Hufnagle
1d61926379 docs: Added missing comma in RectF class description.
Test: make ds-docs -j32

Bug: 132942874
Change-Id: I8e9d2bfa620be35ef66bd9b05c4a0b9e4727cafa
2019-07-30 18:57:37 +00:00
Winson
1a971773e6 Merge "Fix ColorStateListDrawable bounds handling" into qt-dev
am: fcbde5243a

Change-Id: I3a619b554a7c59d29429efe1247c4a350874397d
2019-06-20 11:03:28 -07:00
TreeHugger Robot
fcbde5243a Merge "Fix ColorStateListDrawable bounds handling" into qt-dev 2019-06-20 17:32:31 +00:00
Nader Jawad
de05111e3e Merge "Added null checks to LayerDrawable implementation" into qt-dev
am: 6e4e9817b8

Change-Id: I40ded5cb8f6b688c28299ebc382133ec15a50bc7
2019-06-20 10:11:53 -07:00
TreeHugger Robot
6e4e9817b8 Merge "Added null checks to LayerDrawable implementation" into qt-dev 2019-06-20 16:58:45 +00:00
Winson
eca29cf944 Fix ColorStateListDrawable bounds handling
The inner Drawable was never updated.

Bug: 135592087

Test: atest ColorStateListDrawableTest
Test: manual test valid ColorStateList XML in res/color

Change-Id: If922acd3054ded7cc068241376ebf7017e1ff6ff
2019-06-19 16:38:28 -07:00
Nader Jawad
abfcd0aa86 Added null checks to LayerDrawable implementation
Added null checks around usages of drawable child layers
within the constructor as well as the isProjected method

Test: Added cts tests to LayerDrawableTest
Bug: 134902243
Change-Id: I94a5fbc896ab53e29f4db4dcd04daf0bf9dd66dc
2019-06-18 15:53:26 -07:00
Paul Duffin
d93f565421 Remove superfluous use of no_framework_libs: true
Bug: 134566750
Test: m droid
Change-Id: I2777e8f9da0c7e0f3fc84277600f9db45b2f837e
Exempt-From-Owner-Approval: no response from owners minor build change
2019-06-18 19:21:34 +01:00
TreeHugger Robot
741e818ef3 Merge "Fixed issue where negative angles were not parsed properly" into qt-dev 2019-06-07 00:43:31 +00:00
Leon Scroggins
9be1d08acb Merge "Allow non-convex paths in Outline#setConvexPath" into qt-dev 2019-05-30 18:31:40 +00:00
Leon Scroggins III
63eb6e495a Allow non-convex paths in Outline#setConvexPath
Bug: 131759669
Test: I5eca77e1a60e484e4e118b7e464a88363c539ca9
Test: Manual - assert no longer fires and app looks normal

The limitation to only support convex paths was due to a limitation
in the old renderer. Today, it is fine to use a concave path. Further,
Skia has changed how it computes complexity - it is more conservative,
so paths which were previously thought to be convex are no longer. We
cannot guarantee that a path will be considered convex (especially
after e.g. rotating it, as in the library in question), so drop the
requirement.

Change-Id: Ice88d0995750e066320cb175a87f8ae70ce3aeed
2019-05-30 09:38:04 -04:00
Nader Jawad
364bf189e8 Fixed issue where negative angles were not parsed properly
Added logic to wrap negative angle measures provided
for linear gradients to be between 0 and 360

Test: Added cts test to GradientDrawableTest
Bug: 132650579
Change-Id: Iefde8bfc4b043dbe9dc57247f48077587fb03f6e
2019-05-29 18:53:11 -07:00
TreeHugger Robot
9fdd35e9aa Merge "Fix fading edge effect from impacting neighboring pixels" into qt-dev 2019-05-22 21:32:59 +00:00
TreeHugger Robot
2516b14955 Merge "Move GradientDrawable stroke fields back to grey list" into qt-dev 2019-05-20 22:40:54 +00:00
Nader Jawad
87d098908b Move GradientDrawable stroke fields back to grey list
The following fields are still lacking public getters:
Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeDashGap:F
Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeDashWidth:F
Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeWidth:I

Removed the maxTargetSdk from the @UnsupportedAppUsage
annotation.

Bug: 132971065
Test: N/A
Change-Id: Id19452a8db6cda43c7d1b3c3c5ee74468c6de4e1
2019-05-20 13:37:43 -07:00
Derek Sollenberger
9d25cc242f Fix fading edge effect from impacting neighboring pixels
Bug: 132354626
Bug: 129117085
Test: skia unit tests and test cases described in the bug
Change-Id: Ieaa7c831dd6298ac0565e6f1837b1c1dbd4545da
(cherry picked from commit ac33a487516196e9f1cf830e78313806e6daf777)
2019-05-17 17:59:57 +00:00
Nader Jawad
b8a529ff1f Fixed issue where GradientDrawable orientation was not
consumed properly

Moved methods to resolve the current gradient orientation
from GradientDrawable to GradientState. Fixed issue where
orientation parameter was not consumed properly in the
GradientDrawable constructor causing the angle and orientation
parameters to be out of sync.

Bug: 132420435
Test: Added test to CTS to verify GradientDrawable constructor behavior
Change-Id: I639d1ab4b8791810ea72c3f85878a8c7d9093661
2019-05-14 21:37:19 +00:00
Leon Scroggins
6e5efabcfd Merge "Pass ColorSpace along with HardwareBuffers" into qt-dev 2019-05-02 15:15:02 +00:00
Nader Jawad
de546a4868 Fixed issue where GradientDrawable would fail inflation
with invalid angle parameters

Previously, GradientDrawable would fail xml parsing if
an angle measurement was not a multiple of 45 and the type
of gradient is linear. Restore the original behavior to only
verify the angle measurement only if the type is linear
instead of verifying this requirement for all gradient types.

Removed restriction that radii must be non-negative as
subsequent logic in GradientDrawable already clamps the radius
to valid parameters.

Bug: 130309904
Test: Updated tests in CtsGradientDrawableTest
Change-Id: Ib1b3a0bb80639ddc00be7e630c62e781dfa6d9cf
2019-05-01 11:59:55 -07:00
Leon Scroggins III
3e2d7b7fe0 Pass ColorSpace along with HardwareBuffers
Bug: 130148101
Bug: 120904891
Test: I3bdb6a7edbab4b9b8f13d4597e5987e6db6fe928

Bitmap#wrapHardwareBuffer defaults to using the SRGB ColorSpace (i.e. if
null is supplied), but it's possible that where the HardwareBuffer was
originally used, it was associated with a different ColorSpace. Update
clients of this API to pass that ColorSpace.

Pass the ColorSpace's ID. This results in only supporting Named
ColorSpaces, which matches some of our other ColorSpace support, and
should be enough for most use cases.

Change-Id: I02460f079ed467199f368b4a4fd7708d6fa5433a
2019-04-25 16:48:08 +00:00
Seigo Nonaka
37d181673b Fix performance regression by fixing keys used in Typeface.Builder
The key used in Typeface.Builder is different from the key used in
findFromCache method. The problem is key generation in Typeface.Builder
since the key should be created from requested parameters not the actual
font styles.

Here is the raw performance differences on walleye-userdebug

android.graphics.perftests.TypefaceCreatePerfTest(us):
  createFromResources: 248 -> 23: (-225, -90.7%)

Bug: 131167183
Test: manually collected perf test result.
Change-Id: Idea25095979707ac84b7f4bc1ede0c2daefd6127
2019-04-23 13:21:27 -07:00
Nader Jawad
531db61ac1 Added BlendMode equivalent APIs to replace deprecated PorterDuff
variants

Updated various framework Views to have equivalent BlendMode APIs
to replace the deprecated PorterDuff equivalents.
Updated InspectableProperty annotations to refer to the same
xml attributes as the original tintmode APIs

Bug: 126726419
Test: Added CTS tests to verify new BlendMode APIs
Change-Id: Id9ab36d3d4d29f351250723e9d13d49bc6062c83
Merged-In: Id9ab36d3d4d29f351250723e9d13d49bc6062c83
2019-04-17 21:11:39 +00:00
Sunny Goyal
62915b28e0 Fixing HardwareBuffer leak when creating a bitmap
Callers are supposed to close the hardware buffer themselves. Creating
a utility method around this

Bug: 123874711
Test: No more leak warning on device
Change-Id: I2cf215f0646222f63e564a58edab1ffffa396ff3
2019-04-10 21:59:57 +00:00
Nader Jawad
52c090c749 Fix LaTeX formatting in Android documentation
Added missing usesMathJax tag within Javadoc for
each BlendMode enum value. This should ensure that the
blending formulas are rendered properly in the android documentation

Test: N/A
Bug: 130041190
Change-Id: I6c6dcc1804d8399468191bf758bf6cc7685918b5
(cherry picked from commit 39055b05e023a76941eb601d2c18df6b6db88117)
2019-04-05 23:28:36 +00:00
TreeHugger Robot
a78f842121 Merge "Relaxed nullability requirements for setTintMode APIs for both PorterDuff.Mode and BlendMode" 2019-04-01 16:26:32 +00:00
Nader Jawad
7ddb3965d9 Relaxed nullability requirements for setTintMode APIs for
both PorterDuff.Mode and BlendMode

The existing documentation had annotated the PorterDuff.Mode
parameter of Drawable#setTintMode to be @NonNull. However,
some applications were still passing in null as a parameter.
This was fine in previous releases as the default implementation
of Drawable#setTintMode did not read this field. With the
recent changes to introduce the BlendMode API, the nullability
assumption broke for various apps that passed in null, causing
NullPointerExceptions to be thrown.

Instead, update the documentation to be nullable and internally
convert the parameter to the corresponding default for either
PorterDuff.Mode or BlendMode.

Test: Added CTS tests to verify null behavior for each setTintMode
overload
Bug: 129446670

Change-Id: I42a4b03d190e5a64df518b5c768b2c22853abf12
2019-03-29 14:08:44 -07:00
Nader Jawad
129f414e70 Fixed issue where XmlPullParserExceptions are thrown with
Theme defined GradientDrawable attributes

Fixed issue where attributes that are supposed to be defined
together would throw exceptions if they are configured through
multiple inflation passes both with and without theme attributes.
Removed conditional logic that would parse attributes only
if the corresponding gradient type matched. Instead, attributes
are parsed on each inflation pass, falling back on previously
resolved parameters in the absence of a field. Validation
of the radius parameters has moved to ensureValidRect

Test: Added test to GradientDrawableTest
Bug: 127838188
Change-Id: Ie05e416eb747c774b9a39d4d0be28e1e775f0db5
2019-03-28 23:48:30 +00:00
TreeHugger Robot
d4b6ff816d Merge "Pass Bitmap's native instance to JNI where feasible" 2019-03-27 23:08:42 +00:00
Lei Yu
436e40de8a Merge "Remove circular dependency in BlendMode.java" 2019-03-27 20:52:52 +00:00
jackqdyulei
846af9caf0 Remove circular dependency in BlendMode.java
For some reason this circular dependency will create crash in
robo tests.

Fixes: 129417525
Test: RunSettingsRoboTests
Change-Id: Ic7641840ecfed9ba0270d7d9ce03622a7053df74
2019-03-27 20:51:47 +00:00
TreeHugger Robot
cdbd41b6ee Merge "Remove bitmap::getBitmapAllocationByteCount" 2019-03-27 19:03:27 +00:00
Leon Scroggins III
71fae62f5f Pass Bitmap's native instance to JNI where feasible
Test: CtsGraphicsTestCases, CtsUiRenderingTestCases,
      CtsRenderscriptTestCases

This is significantly faster than passing the Java object down and then
calling a JNI method to retrieve the pointer. See
https://buganizer.corp.google.com/issues/16656908#comment19

In some cases this changes what used to be native crashes (due to
android::BitmapWrapper:assertValid's LOG_ALWAYS_FATAL_IF) into
NullPointerExceptions (if a caller used a null Bitmap).

In addition:
- Remove unnecessary JNIEnv param from toBitmap(jlong)
- Change instances of toBitmap(JNIEnv*, jobject) to the above
- Replace calls to GraphicsJNI::getSkBitmap() to inline calls to
  toBitmap/getSkBitmap
- make Canvas#nInitRaster @FastNative (FIXME: Could these be
  @CriticalNative?)

Change-Id: I6194097be1b6e6952eba70e1e7052a5a250eed93
2019-03-27 13:39:23 -04:00
Nader Jawad
40a43424ee Merge "Added framework APIs to leverage new BlendMode API" 2019-03-27 16:39:03 +00:00
Nader Jawad
dadf251a0d Added framework APIs to leverage new BlendMode API
Updated various framework APIs to leverage the new BlendMode API
that parallels the corresponding porterduff mode equivalent.

Added new Drawable#onApplyBlendMode API that provides a backward
compatible solution for Drawable implementations that leverage
the new BlendMode API as well as fall back on the traditional
setTintMode(PorterDuff.Mode) API for instances where it is not
implemented

Bug:126726419
Test: Re-ran CTS graphics test cases
Change-Id: I119a7f57dce0a095c0a73cf83dc50b82beff5e32
2019-03-26 16:44:10 -07:00