Commit Graph

4137 Commits

Author SHA1 Message Date
John Reck
6b905ded5f Merge "Fix a potential thread safety issue in VectorDrawable" into qt-dev am: 547df6be1e am: 419bd64bc4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14880618

Change-Id: I81b95db1d94ea8b5ead40f58dc4cd9147e1be22b
2021-06-30 15:38:07 +00:00
John Reck
e9831122e6 Fix a potential thread safety issue in VectorDrawable
Bug: 158839504
Bug: 185178568
Test: speculative
Change-Id: Id9f229f08fe5897dda25441fbaa15c98f8130de9
2021-06-11 17:20:02 +00:00
Joshua Baxter
88dce482e3 docs: fix "buidler" typos in Typeface.Builder am: 8aeade4629 am: f36f2de31a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/9975934

Change-Id: I7593fd1af6e5e310322ffba85d6140f6e71b4cb5
2020-11-04 00:16:41 +00:00
Joshua Baxter
8aeade4629 docs: fix "buidler" typos in Typeface.Builder
Change-Id: Ic27a4ea036ca5506793795bf838ff63355eeeaf8
test: make ds-docs
bug: 119301911
2020-11-03 20:00:09 +00:00
Philip P. Moltmann
8bbf9bae6f Fix small issue in PdfDocument docs
Test: Doc fix only
Fixes: 157396387
Change-Id: If1c7a875d8915f53726b832f51cb59fa1f12ae31
2020-05-26 16:29:43 -07:00
Andrew Solovay
b9001d1b8a docs: Removing spurious heading from Javadoc comment
There's an H3 at the top of the PorterDuff.Mode javadoc comment,
and that breaks the TOC in various ways. We don't need that
heading so I'm removing it.

Test: make ds-docs-java
Exempt-from-owner-approval: Docs-only change
Change-Id: I6d5f98b5103a77a7d0245a438b6961c4a21fb059
Bug: 311897143
2020-05-20 00:13:07 +00:00
Leon Scroggins III
e9b2cc829e Update ImageDecoder docs regarding Files
Bug: 139186570
Test: make docs

As part of enforcing Scoped Storage for the next Android release, we're
encouraging app developers to steer away from using raw file path access
and, instead, use FileDescriptor or Uri to access files.

Update createSource(File)'s docs to suggest why they might want to use a
different method.

Update the top level example to use createSource(ContentResolver, Uri)
instead of createSource(File).

Change-Id: Icbccdb5183edd0b6a052ec905f999f02ac4e61d3
(cherry picked from commit 4056974583)
Merged-In: Icbccdb5183edd0b6a052ec905f999f02ac4e61d3
2020-05-12 14:09:56 +00:00
Andrew Sapperstein
8fe35e5f21 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
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
2020-05-01 18:25:32 +00:00
Leon Scroggins III
6419ebff5c Fix .equals call in ImageDecoder
Bug: 154954875
Bug: 143231863
Test: I93b01cb60a8c76110ea2ff4250d0048512629d8d

I9229039b752bafa9a9b85b914a62093dff1eec34 switched from "==" to
".equals", but it did not take into account that Uri#getScheme() can
return null. Switch around the .equals check so that it is called on
SCHEME_CONTENT, which will never be null.

Change-Id: I0df5d2407a32fad0e21e597697af293fbc2fb315
Merged-In: I0df5d2407a32fad0e21e597697af293fbc2fb315
2020-04-28 14:14:30 +00:00
Rob Carr
9005cdcf01 Merge "BLAST: Two start-up optimizations" into rvc-dev 2020-04-27 17:20:42 +00:00
Robert Carr
b9cf275b9b BLAST: Two start-up optimizations
1. Avoid a seperate IPC querying in to system-server
   to initialize the mUseBLAST flag.
2. Avoid calling property_get_bool with each BufferQueue
   creation.

Instead we piggy-back both values inside addWindow return values.

Bug: 152501005
Test: Existing tests pass
Change-Id: If130560a8230f8d399cf7631264d551522939faa
2020-04-24 14:42:55 -07:00
Sumir Kataria
67d06a9965 Update doc formatting.
Add missing <p> tags which should make some methods
more readable.  Also added a few {@code} tags and a
couple of missing {@link} tags.

Fixes: 154547852
Test: m offline-sdk-docs

Change-Id: I1b8d0212b54e902378d5d25f6d555f69af207604
2020-04-20 16:13:13 -07:00
John Reck
9c52543162 Merge "Document that getTransformMatrix can inset" into rvc-dev 2020-04-17 19:20:38 +00:00
John Reck
62f8b4f3d6 Document that getTransformMatrix can inset
Bug: 152621633
Test: none, docs only change
Change-Id: I4a357affdf698c8eb70ed7abbfa828586b2da0ec
2020-04-16 15:42:14 -07:00
Leon Scroggins III
865f0f1ec9 Support Skia's gray SkColorSpaces
Bug: 153410582
Test: I0a280cdfdb02766f5e415408386cce49a59504ab

For gray color spaces, Skia creates a special toXYZD50 matrix which does
not have any concept of primaries. Update the Java ColorSpace to
recognize such a matrix and treat it specially. Instead of creating
primaries, use a set of dummy values.

This fixes a bug where the Java ColorSpace was invalid (NaNs in its
transforms) and applying it to a new Bitmap yielded incorrect results.

Fix up the @see links in getPrimaries and surrounding methods.

Change-Id: I94fe232e10f56a69832d4a39a2e5909eac641264
(cherry picked from commit d82d585f28)
Merged-In: I94fe232e10f56a69832d4a39a2e5909eac641264
2020-04-14 18:43:16 +00:00
Ryan Mitchell
26ff673458 Add mSourceDrawableId to copy constructor
The copy constructor of AdaptiveIconDrawable#LayerState currently does
not copy mSourceDrawableId from the original layer state. This prevents
drawables created from preloaded AdaptiveIconDrawables from having the
correct source drawable resource id.

Bug: 148488431
Test: CtsContentTestCases:android.content.pm.cts.PackageManagerTest
Change-Id: I7795a337a2a364677e375776c7aec5bc9189e0da
2020-03-27 10:32:52 -07:00
Derek Sollenberger
f8d4a6684c Fix mmap errors when reading font files via the AssetManager.
Previous attempts to do this ignored the offset that the
AssetFileDescriptor may have.

Bug: 149927583
Test: CtsTextTestCases and androidx.appcompat.widget.AppCompatTextViewTest
Change-Id: Idcc8cb83a7f265cfa12707b7ce643b35f7f72352
2020-02-27 15:12:43 -05:00
TreeHugger Robot
781185099b Merge "Do not attempt to special case uncompressed font assets." 2020-02-21 22:35:55 +00:00
Derek Sollenberger
dd03a8ef81 Do not attempt to special case uncompressed font assets.
The logic to attempt to directly mmap uncompressed font assets
has resulted in breakages for some applications and utilities.
This CL disables this speculative optimzation until we can determine
the problem with this approach and if such an optimization is required.

Bug: 149780695
Test: CtsTextTestCases and androidx.appcompat.widget.AppCompatTextViewTest
Change-Id: I3b10a801a5600aefe8573fab1b28cd79c848c892
2020-02-21 15:28:52 -05:00
Derek Sollenberger
76e7430bae Merge changes from topic "HWUI_JNI"
* changes:
  Export symbols for the newly exposed APEX/internal headers
  Remove dependence on libandroid_runtime from Bitmap.cpp
  Update Region.cpp to use AParcel NDK APIs
  Cleanup header and build targets for libhwui clients.
  Remove dependencies on headers outside UI module
  Cleanup LOG_TAG when bundled in HWUI
  Move android.graphics JNI & APEX files into HWUI
2020-02-21 11:43:02 +00:00
Derek Sollenberger
42c50042d1 Remove dependence on libandroid_runtime from Bitmap.cpp
The end goal is to have Bitmap.cpp use AParcel, but until that
API is extended to support this use case this is an alternative
way to isolate the graphics files from the libandroid_runtime.

Test: CtsGraphicsTestCases
Bug: 145227478
Change-Id: Ie3854fe03dec4f7b1b485295bb9a5ebba52ddb7c
2020-02-20 21:50:06 -05:00
Leon Scroggins
251888e9eb Merge "Add details regarding setConvexPath deprecation" 2020-02-20 20:00:38 +00:00
Leon Scroggins III
076bbe1ceb Add details regarding setConvexPath deprecation
Bug: 149857968
Test: make docs
Change-Id: I995e035fc7d73d196a50b4e515db38110baa0fe5
2020-02-20 11:16:11 -05:00
Leon Scroggins III
5a190b19bb Add Bitmap#getHardwareBuffer
Bug: 148155907
Bug: 135299581
Test: TODO

Hidden for now. We'd like to make it an SDK API eventually
(b/148155907).

Internal code is currently calling createGraphicBufferHandle. This is
not something we plan to expose from the UI rendering module, so add a
method to get a HardwareBuffer instead. This is something we were
already planning to add. It seems that clients of
createGraphicBufferHandle really wanted a Parcelable to pass the
HARDWARE Bitmap to another thread. This should satisfy that use case.

Change-Id: Id701f7c7eab37830cd7d2cdb929cbe6ba4eca119
2020-02-18 16:35:56 -05:00
Derek Sollenberger
db8164c0ac Merge "Move RenderNodeAnimator to android.graphics.animation package" 2020-02-14 16:32:50 +00:00
TreeHugger Robot
8780aae16c Merge "Create a ParcelableColorSpace" 2020-02-14 00:58:30 +00:00
Derek Sollenberger
8c2f6b6e15 Move RenderNodeAnimator to android.graphics.animation package
A wrapper still exists at android.view.RenderNode animator
as it needs access to internals of the view that would violate
the package layering if moved into android.graphics.animation.

This CL also moves the Java and cpp files associated with creating
a native interpolator that can be run directly on the RenderThread.

Bug: 149293249
Test: CtsViewTestCases
Change-Id: I5260331fedbd634cf2f6d6d392941e7284527420
2020-02-13 16:14:06 -05:00
John Reck
aa5f38577a Create a ParcelableColorSpace
Bug: 148412652
Test: ParcelableColorSpaceTest CTS
Change-Id: If0901367e501e2ecfc71b9ed29ec7d8dd4d0550f
2020-02-12 14:28:10 -08:00
Derek Sollenberger
e2edcebb2b Merge "Consolidate AssetManager calls in Font/FontFamily" 2020-02-11 13:11:42 +00:00
Derek Sollenberger
4db7bd28e7 Consolidate AssetManager calls in Font/FontFamily
The Font/FontFamily classes use private API calls in native
code to get the contents of an Asset.  These calls need to
be made on public APIs in order to isolate the graphics module
from the rest of the system.  Public Java APIs already exist so
this CL refactors the code to use those methods.

Test: CtsTextTestCases
Bug: 147136234
Change-Id: I35a6558b597684e59279d7a841669c5f909d5152
2020-02-10 20:05:31 +00:00
Stan Iliev
c90438175f Refactor GraphicsStatsService for updateability
Move GraphicsStatsService to android.graphics package.
Move GraphicsStatsService JNI from libservices.core to
libandroid_runtime.
Declare GraphicsStatsService ctor as the only @SystemApi.
Remove MemoryFile usage from GraphicsStatsService, but use
SharedMemory and other SDK APIs instead. This is done to
avoid using unstable API MemoryFile.getFileDescriptor.
Propose new SharedMemory.getFdDup API for next release, which
is hidden for now.
Refactor statsd puller to avoid proto serialization by moving
data directly into AStatsEventList.
"libprotoutil" is added as a static dependancy to libhwui, which
should be fine because its implementation does not link anything.

Bug: 146353313
Test: Ran "adb shell cmd stats pull-source 10068"
Test: Passed unit tests and GraphicsStatsValidationTest CTS
Change-Id: If16c5addbd519cba33e03bd84ac312595032e0e1
2020-02-07 12:27:07 -05:00
Derek Sollenberger
1863d94e9a Ensure SkiaPipeline always has a valid colorspace.
Previously we didn't assign a colorspace to the pipeline until it
was provided a surface to render into.  This resulted in undefined
behavior if the application attempted to render an offscreen layer
before the OS provided the main window with its surface. Now instead
of deferring setting whether or not the application is wide gamut we
do initialize it to a default setting when the pipeline is created.

Bug: 148042673
Test: apct/device_boot_health_check_extra_postsubmit
Change-Id: I84d743511e949ac977486470bb14eec936de7f88
2020-02-06 07:41:50 -05:00
Leon Scroggins III
a49beaaa69 Replace Outline#setConvexPath with Outline#setPath
Bug: 148544953
Test: No change in behavior, no new tests

setConvexPath no longer requires that the Path be Convex, so deprecate
the method and replace it with a name that does not imply it must be
Convex.

Update internal references to the Path being Convex as well.

Change-Id: I8935dc8ac7f7fb7db0d667e35fda67afdf2e6ac8
2020-01-31 14:21:46 -05:00
Leon Scroggins
e98ae477cc Merge "Deprecate Path#isConvex" 2020-01-29 18:10:14 +00:00
TreeHugger Robot
e428a2cc04 Merge "Deprecate Canvas.EdgeType" 2020-01-28 18:13:01 +00:00
John Reck
efac0521d6 Improve bitmap IPC
Make all received bitmaps immutable as this
improves re-use for subsequent transfers.

Remove minimum size to stay on ashmem, as
Parcel's writeBlob already has similar logic.
This effectively reduces the minimum size to 16kB.

Bug: 148301859
Test: device booted, a notification showed up
Change-Id: I2fafb0989944c0ef82de6edcb4924056a592cf66
2020-01-24 16:06:14 -08:00
Leon Scroggins III
2410b90e06 Deprecate Canvas.EdgeType
Bug: 129694386
Test: No change in behavior, no new tests

EdgeType is only used as a parameter to quickReject, but it is always
ignored. Deprecate it and the existing quickReject methods. Add new
versions of quickReject without EdgeType parameters. Switch clients to
the new versions.

Change-Id: Id932f10915a8c4959fe0e85f507ce7fd2da8a576
2020-01-23 20:43:34 +00:00
Leon Scroggins III
6a0cdd24df Deprecate Path#isConvex
Bug: 133807397
Test: No change in behavior, no new tests

isConvex is unreliable. We may change how we compute it from release to
release, and it could change based on various factors like a rotation.

Change-Id: Ib76246fc24f09bd13cf63b4b96b56afa613d0bc9
2020-01-23 12:41:08 -05:00
Sunny Goyal
77a2416924 Adding API to check if an icon returned by PackageManager
is a fallback icon

Bug: 141588119
Test: atest PackageManagerTest
Change-Id: I9ae5a74dd0b0c0c49a078d46914986ecb0d27a94
2020-01-21 16:17:49 -08:00
Haoyu Zhang
9f9301ccc2 Restrict UnsupportedAppUsage after Q
Bug: 145986883
Test: atest FontFamilyTest
Test: adb shell am instrument -w -r -e class 'androidx.core.graphics.TypefaceCompatTest' androidx.core.test/androidx.test.runner.AndroidJUnitRunner
Change-Id: I1cf0444b93df00532536531903e889ade9612597
2020-01-14 15:28:09 -08:00
TreeHugger Robot
c18efd1f4d Merge "Use new UnsupportedAppUsage annotation." 2020-01-08 07:55:21 +00:00
Leon Scroggins
d534534a72 Merge "Handle null assetFd like a FNF" 2020-01-07 17:34:59 +00:00
Artur Satayev
00f8b53650 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
2020-01-07 14:40:02 +00:00
Brian Osman
bc44fa0fa8 Use SkRuntimeEffect rather than SkRuntimeShaderFactory
The old API was a shim over the new API, and will be deleted soon.
The new API is actually public, simpler, and more powerful.

Test: Everything still builds.
Change-Id: I11af8da9132e23a070e87dd5a7401c4854dd102a
2020-01-03 20:31:50 +00:00
Artur Satayev
53fe96661b 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
2019-12-18 15:42:06 +00:00
Derek Sollenberger
7da86dd922 Merge "Move FrameMetricsObserver logic into UI Module." 2019-12-18 12:14:26 +00:00
TreeHugger Robot
3d37450027 Merge "ImageDecoder: compare Strings with .equals()" 2019-12-17 23:37:52 +00:00
Derek Sollenberger
c4ef2c702a Move FrameMetricsObserver logic into UI Module.
Introduce HardwareRendererObserver to isolate the android.graphics
package from the android.view package.  The native code that
interacts with the observer was also moved from libandroid_runtime to
libandroid_graphics to keep it within the confines of the UI Rendering
module.

Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: Ibccecbeda0c4d9501d86514a53eb98548233ba6a
2019-12-17 10:15:27 -05:00
TreeHugger Robot
ff4627bf4c Merge "Revert submission" 2019-12-17 03:06:55 +00:00
Nader Jawad
913dd6b9a9 Revert submission
Reason for revert: Causes regressions tracked in:

b/145900622
b/145864909
b/145948923

Change-Id: Ia24ece94d5281cd25d990d8cae923cf50497e1f1
2019-12-17 01:08:20 +00:00