Commit Graph

3930 Commits

Author SHA1 Message Date
Derek Sollenberger
2db814af51 Merge "Remove native calls to HWUI from Surface and use the public API instead" 2019-10-30 03:11:06 +00:00
Seigo Nonaka
01709c7469 Make AFont_getLocale work
There are multiple problems here:
- Java Font.equals and hashCode doesn't look at locale list. Due to this
issue, the CTS tests have been passing unexpectedly.
- The null pointer check in the AFont_getLoacle was inversed. Should
return only when it is non-null.
- Looks like we cannot get the parent's attribute which always returns
null. Instead, read the "lang" attribute when we read the family tag.

Bug: 139201432
Test: atest NativeSystemFontTest
Test: atest TypefaceEqualsTest
Change-Id: I0514847bbf46a73358afab374ccfce2db09b2ec0
2019-10-29 19:53:35 +00:00
Derek Sollenberger
79201b16f1 Remove native calls to HWUI from Surface and use the public API instead
Test: CtsGraphicsTestCases
Bug: 137655431
Change-Id: I1eda485282306d571ca973e179e7202958b59105
2019-10-25 16:25:39 -04:00
TreeHugger Robot
017cbabdce Merge "Add Bitmap.CompressFormat#WEBP_LOSSY/LOSSLESS" 2019-10-17 14:26:46 +00:00
TreeHugger Robot
459cb5cf2e Merge "Fix ColorSpace#get allocating" 2019-10-17 00:56:55 +00:00
John Reck
da94981b19 Fix ColorSpace#get allocating
Test: none
Change-Id: Ia4d380a74ac8f99ac408f52a602713823db43f50
2019-10-16 16:18:28 -07:00
Philip P. Moltmann
c137f1c679 Add TEST_MAPPING for print and pdf tests
Test: TH
Change-Id: I7157c630fccb8b4d50672ac014e5cd020f1ac71f
2019-10-11 14:53:15 -07:00
Nader Jawad
5830fc9836 Merge "Do not parse angle if it is negative" 2019-10-10 20:02:14 +00:00
Rob Carr
093f80de20 Merge "ViewRootImpl: Add USE_BLAST flag." 2019-10-10 19:43:49 +00:00
Leon Scroggins
a3b702fa84 Merge "ImageDecoder: throw FileNotFoundException on null" 2019-10-10 13:28:09 +00:00
Nader Jawad
5baa087037 Do not parse angle if it is negative
If the Gradient angle is negative after
modding by 360, maintain the previous platform
behavior of TOP_BOTTOM oreintation instead of
attempting to wrap it

Test: Added CTS test to verify various negative
angle measurements
Bug: 142111195

Change-Id: Id9c050a9e15717bfaff331c6a37cb34cbce0f060
2019-10-09 17:03:17 -07:00
John Reck
183e1380ce Improve dumping of display list memory usage
The first step of improving is measuring. So measure better.

Bug: 138856108
Test: dump
Change-Id: I076b904a1f0dfb209622c76bcb8778a10cd2b7db
2019-10-09 13:42:43 -07:00
Robert Carr
48ec4e0b5c ViewRootImpl: Add USE_BLAST flag.
Add support for ViewRootImpl submitting buffers using
BLAST and put this support behind a disabled-by-default
FLAG.

Bug: 135786080
Change-Id: Ia3f205e34db9f9aa574c9c2e2c499dd3046af220
2019-10-08 14:36:38 -07:00
Leon Scroggins III
94d294bb52 Add Bitmap.CompressFormat#WEBP_LOSSY/LOSSLESS
Bug: 135133301
Test: Iadbd8cf3b69a150b9e38ad556392346e1bb27084

WEBP does not give clients explicit control of how to do their WEBP
encode. Add new formats that do. Update the docs for the existing
formats (and the new ones) to explain more precisely how quality is
interpreted.

Change-Id: I9583903c21ab2048fed8e7ed501ee8377ea5ba36
2019-09-23 14:35:54 -04:00
Nader Jawad
9f560fefbc Restored default behavior of GradientDrawable orientation
Fixed issue where GradientDrawable orientation had diverged
from the default behavior. Ensured that orientation by default
is configured to LEFT_RIGHT for xml defined GradientDrawables
and programmatically defined GradientDrawables have the
same default orientation of TOP_BOTTOM.

Refactored previous logic that would keep both the mAngle
parameter used in xml inflation and the mOrientation parameter
that is used to configure the angle of the gradient to no longer
keep these 2 values in sync.

Test: Added CTS test to verify orientation for xml and programmatically
defined GradientDrawables
Bug: 140835351
Bug: 139822941

Change-Id: I594496afe48d04d108053bf284e92bbfd3591fa3
2019-09-19 16:15:49 -07:00
Nader Jawad
87e5b74f8d Revert "Fixed default angle to be Orientation.LEFT_RIGHT"
This reverts commit d31d096720.

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
2019-09-19 16:15:12 -07:00
Leon Scroggins III
3d7ae4efff ImageDecoder: throw FileNotFoundException on null
Bug: 140961740
Test: I41a93b47acde6a7985c53107f448a8b647d245d7

If ImageDecoder has a null AssetFileDescriptor, either from a Callable
or from a ContentResolver directly, throw a FileNotFoundException.
Previously, a NullPointerException was thrown attempting to dereference
it.

Change-Id: Ie738b9edc062e520835010befc001578fce09832
2019-09-17 14:13:18 -04:00
TreeHugger Robot
d9c0c15c96 Merge "Fixed default angle to be Orientation.LEFT_RIGHT" 2019-08-23 17:32:51 +00:00
Nader Jawad
bd00e4c6c0 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
2019-08-22 11:24:51 -07:00
Chong Zhang
f333b2caa2 Merge "Prefer animation in ImageDecoder.decodeDrawable" 2019-08-15 23:29:03 +00:00
Chong Zhang
cba2792567 Prefer animation in ImageDecoder.decodeDrawable
Pass down a flag to prefer animation over still images
when decodeDrawble is used. Pass the flag via source
to avoid adding this flag to all create/createFrom/
nCreate method variants. Check the flag only in
native_create when we actually create the decoder.

bug: 120414514
bug: 78868457

Change-Id: I84b4edd0225df9eaa59df8a787bd5902146ab500
2019-08-13 11:27:00 -07:00
Seigo Nonaka
62b641f485 Stop logspam of missing fonts.
Some system fonts may not be there because of saving storages, e.g.
on Watch OS. Stop logging missing fonts error.

Bug: 135419244
Test: N/A
Change-Id: I358f45aee35f25911a29ce272ebd0398561d8864
2019-08-06 11:30:59 -07:00
Kevin Hufnagle
ff5c934c6d Merge "docs: Added missing comma in RectF class description." into qt-dev am: 0c77665c37 am: 12873fe364 am: 79f985061d
am: 809846cded

Change-Id: I806987db334f487b6f86f9c1599c7561dd111cd8
2019-08-01 09:29:50 -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
John Reck
49dde45680 Fix RenderNode sample docs
s/setLeftTopRightBottom/setPosition/

Test: none
Change-Id: I5c3040370ae6c4975c171432c4339984b4a840ed
2019-07-18 09:44:04 -07:00
Winson
9579e75322 Merge "Fix ColorStateListDrawable bounds handling" into qt-dev am: fcbde5243a am: 1a971773e6
am: afc037a39b

Change-Id: Ia2627319166556e6c80b8fdb4cf9f97d109530ae
2019-06-20 13:12:59 -07:00
TreeHugger Robot
fcbde5243a Merge "Fix ColorStateListDrawable bounds handling" into qt-dev 2019-06-20 17:32:31 +00:00
Nader Jawad
a525f0db0f Merge "Added null checks to LayerDrawable implementation" into qt-dev am: 6e4e9817b8 am: a0cd0bb78a
am: dff4367bfb

Change-Id: If57d37339fda289c002d154bdf8f3414045ac5e7
2019-06-20 10:29:25 -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
Nader Jawad
7c567be0a5 Merge "Fixed issue where negative angles were not parsed properly" into qt-dev am: 741e818ef3 am: 4bede44592
am: d112d6c9b8

Change-Id: Ia8423a795cbfdd60354de69ec6eeb7c2f110c872
2019-06-06 18:22:29 -07: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
John Reck
1a7fadaf10 Merge "Add copy constructor to PointF" 2019-06-03 20:48:16 +00:00
John Reck
c492bc1ef8 Add copy constructor to PointF
Fixes: 110863449
Test: builds
Change-Id: Ie562f47becb52f78c406c97d3718de962eb03553
2019-05-31 15:16:10 -07: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
Nader Jawad
217817befa Merge "Move GradientDrawable stroke fields back to grey list" into qt-dev am: 2516b14955 am: 4e9c39a4b9
am: 6016aeadf8

Change-Id: I69a6b6b9b0db64a31970b0e56f381d4f6d037fe6
2019-05-21 10:57:08 -07: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 ac33a48751)
2019-05-17 17:59:57 +00:00
Nader Jawad
2a7bc42cc3 Merge "Fixed issue where GradientDrawable orientation was not consumed properly" into qt-dev am: 9625faaf73
am: 3919ad8862

Change-Id: I9f4c0225383b1d2f5cb6708b28c0fd260b6c6172
2019-05-14 16:55:09 -07: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
Derek Sollenberger
6b045a0b14 Merge "Fix fading edge effect from impacting neighboring pixels" 2019-05-09 18:25:30 +00:00
Derek Sollenberger
ac33a48751 Fix fading edge effect from impacting neighboring pixels
Bug: 129117085
Test: skia unit tests and test cases described in the bug
Change-Id: Ieaa7c831dd6298ac0565e6f1837b1c1dbd4545da
2019-05-02 13:04:20 -04: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