Commit Graph

4694 Commits

Author SHA1 Message Date
czq
2111954aaa Introduce FontStyle.FONT_WEIGHT_UNSPECIFIED constant
Introduce a new constant FontStyle.FONT_WEIGHT_UNSPECIFIED = -1, which is used when text weight is not specified. Also replace -1 with it in TextView, TextAppearanceSpan.

Bug: 256995042

Test: manually test
Change-Id: Ia8334f5513cc3e5b7383b67b24b27bf2866d05ad
2022-11-08 13:27:17 +08:00
John Reck
03256ddf5c Update PixelCopy for API feedback
Fixes: 245479361
Test: make && atest PixelCopyTests
Change-Id: I54d0f5d4d5618f21806672093bd6e0cfbae0dd56
2022-10-27 19:43:15 -04:00
Patrick Williams
3bb9f289f2 BBQ: Update TransactionHangCallback to pass ANR reason
Bug: 244218818
Test: presubmits

Change-Id: I00f961c743665b1a38fe3a9e66935b11570bc3e4
2022-10-20 20:07:31 +00:00
Sally Qi
02068d5aaa Plumb getOverlaySupport() into Display Manager for HWUI.
- HWUI can understand if Fp16 for HDR can be supported.

Bug: 242588489
Test: builds
Change-Id: I603ded84a5fbe6142afd167224903cf4010a309f
2022-10-10 17:46:42 -07:00
John Reck
95f75f4c16 Merge "Change how memory policy is configured" 2022-09-28 20:08:10 +00:00
John Reck
5f66fb8162 Change how memory policy is configured
Should be a mostly no-op but adds a handful of new options

* Adds a 'MemoryPolicy' to mostly consolidate memory settings
* Moves trim handling into HWUI proper
* Adds settings for UI hidden & context destruction that's not
  dependent on TRIM signals
* Treats persistent process the same as system_server
* Tweaks HardwareBitmapUploader timeout to reduce churn

Bug: 245565051
Test: builds & boots

Change-Id: I1f1b3db884ef7fa45ff2556436464a99440b998e
2022-09-28 10:47:56 -04:00
Sally Qi
6a7f4a50eb Merge "Add annotation for all dataspace enums." 2022-09-27 19:34:15 +00:00
Sally Qi
8b6a6fa889 Add annotation for all dataspace enums.
Bug: 246347925
Test: builds
Change-Id: I7661121578a3a6db1840b5c5613a4b6750f9860a
2022-09-26 07:50:07 -07:00
czq
acbe6b890f Add a new API Typeface#getSystemFontFamilyName()
Added a new field to get the system font family name of a typeface, together with a public API getSystemFontFamilyName. Modified the constructor method of Typeface.

Test: atest android.graphics.cts.TypefaceTest#testGetSystemFontFamilyName

Bug: 231894524

Change-Id: I3a5d1e724c0984a2a708a21a3876eb64abe3e20b
2022-09-21 13:23:18 +08:00
Automerger Merge Worker
228bd6f01a Merge "Merge "Revert "Using clippath for adaptive icon drawable instead of bit..."" into tm-qpr-dev am: 132b386fc5" into tm-qpr-dev-plus-aosp am: deb34216ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19991819

Change-Id: I02ac6e8d5ef63f91be32df9275321888ca69072b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-20 16:21:59 +00:00
Sebastián Franco
3aaf48ffc6 Merge "Revert "Using clippath for adaptive icon drawable instead of bit..."" into tm-qpr-dev am: 132b386fc5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19991819

Change-Id: I27b89d458f6b7d3ba4fe3c85d5b6399fa7d1fc7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-20 15:51:32 +00:00
Sebastián Franco
132b386fc5 Merge "Revert "Using clippath for adaptive icon drawable instead of bit..."" into tm-qpr-dev 2022-09-20 15:27:07 +00:00
Sebastián Franco
3ccaff2fc7 Revert "Using clippath for adaptive icon drawable instead of bit..."
Revert "Fixing alpha tests for adaptive drawable"

Revert submission 19370745-no-clip-adaptive_icon

Reason for revert: Culprit cl for b/241010439
Reverted Changes:
Ieb428748a:Fixing alpha tests for adaptive drawable
I60ce42d91:Using clippath for adaptive icon drawable instead ...

Change-Id: I70a55c49ee6929a20a8bcda83284f5fe59256be0
2022-09-19 16:47:22 +00:00
Alec Mouri
172f625928 Merge "Revert^2 "Support alpha for SurfaceView"" 2022-09-16 20:23:57 +00:00
Alec Mouri
655a5e42b9 Revert^2 "Support alpha for SurfaceView"
3fde6cee3c

This is the same CL as the original CL, with the exception that SurfaceView#isZOrderedOnTop checks mRequestedSubLayer, rather than mSubLayer.

This is to fix a CTS failure with InlineContentViewTest#testSetZOrderedOnTop, which set the Z order of an offscreen SurfaceView without binding it to a layout.

Change-Id: Ifdfa710d87f7ea4c333505ffdcc7fbff06245fba
2022-09-12 17:51:56 +00:00
Chet Haase
7ced2599ae Rename Path.iterator method to avoid AndroidX collision
There will be an extension function in the AndroidX version
of this API with the name 'iterator'. Callers of that API
should get the extension version instead, but Kotlin defers
to the actual implementation if it exists. Changing the method
name here (and removing the new implementation of the
Iterable interface) to avoid that collision.

Bug: 223586753
Test: Changed PathIterator cts tests to suit

Change-Id: I30e2c227ddc4fd387a90d72c52c1324c9207a3a7
2022-09-12 17:46:32 +00:00
Alec Mouri
9f935c2810 Merge "Revert "Support alpha for SurfaceView"" 2022-09-09 19:06:03 +00:00
Andrew Solovay
d9f47f36c9 Merge "Fix example AGSL code in the javadoc comments" into tm-dev am: 89acf500cb am: 0dc87cd904 am: 48a36fc521
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19889898

Change-Id: Ib78c5529a4f57da3b38e22e3c9c0ed964579219f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 20:35:25 +00:00
Andrew Solovay
e4f2b5f570 Merge "Fix example AGSL code in the javadoc comments" into tm-dev am: 89acf500cb am: c7a544b14d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19889898

Change-Id: Id531b6cdd0e9d4a205fa1baac4c28a19dce696a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 20:12:45 +00:00
Andrew Solovay
0dc87cd904 Merge "Fix example AGSL code in the javadoc comments" into tm-dev am: 89acf500cb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19889898

Change-Id: I37850fbf06135fc19137bab4c5dd33bdd250f2e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 19:17:31 +00:00
Samiul Islam
3fde6cee3c Revert "Support alpha for SurfaceView"
Revert submission 19562144-surfaceview-alpha

Reason for revert: Presubmit breakage b/245651921
Reverted Changes:
I7510a3a6c:Add CTS for applying alpha for SurfaceView
Ibc14b18f1:Support alpha for SurfaceView

Change-Id: I498c98951a53e6bb1c1251dceb9d150311b07cc8
2022-09-08 14:15:33 +00:00
Alec Mouri
4432aa6283 Merge "Support alpha for SurfaceView" 2022-09-08 00:17:03 +00:00
Brian Osman
640927e292 Fix example AGSL code in the javadoc comments
Need to land this fix in tm-dev for it to show up in the published reference docs.

Bug: 237562620
Test: [go/atsd docs build]
Change-Id: I5f562b70d04bc86779190002a2640fb51dc00531
(cherry picked from commit 0547bffe40)
2022-09-07 22:56:42 +00:00
Alec Mouri
914e750867 Support alpha for SurfaceView
Basically, this removes an excuse for apps to use TextureView for video
playback or one-off HDR images prior to HDR UI being ready everywhere.

The idea is that for Z-above, applying alpha is easy, because the
surface just needs to be have alpha modulated. Z-below is a little bit
more creative - the alpha is applied to the hole punch and drawn using
DST_OUT blending semantics. This allows for views underneath the
SurfaceView to blend with surface, while being occluded by views on top
of the SurfaceView.

There may need to be some complex view hierarchies that would be useful
to test, but simple view layouts seem to work.

Note that this is guarded with a target SDK check, to defend against
applications that are propagated alpha to child views while expecting
opaque SurfaceViews.

Bug: 241474646
Test: HWAccelerationTest doesn't look broken
Change-Id: Ibc14b18f1ce6f25250318db50275c6b8c972bade
2022-09-07 19:32:23 +00:00
Cole Faust
9acf46f66f [conflict] Merge "Fix array-related errorprone warnings" am: a1eb8cf128 am: 44f8576073 am: 91d6c5b564 am: 6a79ae2567 am: 9b3a5fc03b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2186016

Change-Id: I5e59b8549df348c181cd3b72311798a5d7602a67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-30 21:03:54 +00:00
Cole Faust
9b3a5fc03b Merge "Fix array-related errorprone warnings" am: a1eb8cf128 am: 44f8576073 am: 91d6c5b564 am: 6a79ae2567
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2186016

Change-Id: I7052a1f7391ed6701fe0e1036c27368609032e35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-30 20:44:00 +00:00
Chet Haase
c373758055 Merge "Add APIs to make Android Path queryable and more useful" 2022-08-29 16:38:40 +00:00
Chet Haase
0834e9f298 Add APIs to make Android Path queryable and more useful
The underlying Skia implementation of Path has APIs for
querying the data in a path (via SkPath::Iter). It also exposes
the ability to add conic sections (conicTo()), which is useful
since a Path can contain conics (even if it was not created with
conics directly).  And it adds a method to get the generationId
from a Path, used to see whether a Path changed since the
last time that Id was retrieved. Finally, it exposes a simple
interpolate() function to allow linear interpolation between
two paths.

This CL adds PathIterator to enable querying Path data, and
adds conicTo, isInterpolatable(), and interpolate() to Path,
all of which wrap the underlying, existing Skia functionality.

Bug: 157391114
Bug: 223586753
Test: Added PathIteratorTest plus new tests on PathTest
Change-Id: Iddadfde24dd75ac04d0a2f3ebca767613af25360
2022-08-26 16:32:11 +00:00
Cole Faust
584140c83a Fix array-related errorprone warnings
The ArrayEquals, ArrayHashCode, ArrayToString, and
ArraysAsListPrimitiveArray errorprone findings were
demoted from errors to warnings. Fix existing
occurrences of them so they can be made errors again.

Bug: 242630963
Test: RUN_ERROR_PRONE=true m javac-check
Change-Id: Ia6f216cc36ad0a5758f39fd9b34962cd4adf9d8e
2022-08-25 10:57:12 -07:00
Jon Eckenrode
32cd0a63d4 Merge "Docs: Touch-up of parameter descriptions and tags for consistency." 2022-08-24 18:04:56 +00:00
joneckenrode
66504044ed Docs: Touch-up of parameter descriptions and tags for consistency.
Staged:

https://android.devsite.corp.google.com/reference/android/widget/TextView

https://android.devsite.corp.google.com/reference/android/graphics/text/LineBreakConfig

https://android.devsite.corp.google.com/reference/android/graphics/text/LineBreakConfig.Builder

Test: Built API docs
Change-Id: I68d5228b2f952876c81f8590ccf69d68733f2741
2022-08-23 17:48:53 +00:00
Shuzhen Wang
093242d17d Merge "Handle @format annotation for PixelFormat and ImageFormat" 2022-08-22 15:34:45 +00:00
Shuzhen Wang
572a0642ab Handle @format annotation for PixelFormat and ImageFormat
This is to address the lint error when passing a PixelFormat integer to
ImageReader.newInstance().

Also add the IntDef for YCBCR_P010.

Test: Copy annotations.zip to SDK, and observe no lint error in AS
Bug: 176408464
Change-Id: I224190b5124d6871c4ef04dc5086c6d7c91d4daa
2022-08-18 01:23:02 +00:00
Jon Eckenrode
0004b75dbf Merge "docs: Edited API documentation related to line-break and line-break word styles." 2022-08-16 21:48:11 +00:00
John Reck
50ef099e56 Annotate Bitmap
* Mark sameAs @WorkerThread
* Always noteSlowCall #sameAs
* @NonNull all the non-null things
* Styling fixups

Fixes: 219890711
Test: make
Change-Id: Iad220e7e667a5a6c558fc93dfe2eb9df2d7db35d
2022-08-16 10:30:09 -04:00
joneckenrode
f81fbd3eb0 docs: Edited API documentation related to line-break and line-break word styles.
Staged to:

https://android.devsite.corp.google.com/reference/android/graphics/text/LineBreakConfig

https://android.devsite.corp.google.com/reference/android/graphics/text/LineBreakConfig.Builder

https://android.devsite.corp.google.com/reference/android/widget/TextView

https://android.devsite.corp.google.com/reference/android/R.attr

https://android.devsite.corp.google.com/reference/kotlin/android/R.attr

Test: Built API docs
Change-Id: I06fdf27ba94d806753a1dcc99873dff24cdae626
2022-08-12 17:58:25 +00:00
John Reck
ce2a426ace Merge "Allow PixelCopy for a window from any View" 2022-08-09 13:32:18 +00:00
Kohsuke Yatoh
29727ab342 Remove unused Typeface.getFallback().
The usage was removed in
commit d5ecababb4

Bug: 174672300
Test: m -j
Change-Id: Ie7194d749c14a2c1b5c786bf4bce97bd0eb3a29e
2022-08-08 17:11:33 +00:00
John Reck
2a01556d81 Merge "Remove Path's isSimplePath" 2022-08-05 21:30:34 +00:00
John Reck
c93103c9eb Remove Path's isSimplePath
The optimization has bugs and is of questionable value
given the current state of JNI. Just remove it.

Fixes: 149585703
Test: uirendering CTS, Path graphics test
Change-Id: I613e4854695ae6e4ad9ec8b17be44e856ed03860
2022-08-05 11:22:50 -04:00
John Reck
4d73cb1043 Allow PixelCopy for a window from any View
Also make it actually async, and allow the bitmap
to be auto-allocated

Bug: 195673633
Test: PixelCopyTest CTS suite

Change-Id: Ie872f20c809eaaeb8dc32f3ec6347f21a9a7bc1a
2022-08-04 13:41:58 -04:00
TreeHugger Robot
6b7aa49581 Merge "Fixing getSafeZone() method in AdaptiveIcon" into tm-qpr-dev am: 065fd52a00 am: b423fc6d60
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19520338

Change-Id: Ib2f69b152c5902412d9c030f9ee7c32c60d02f94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-04 17:10:15 +00:00
Sunny Goyal
63985967cb Fixing getSafeZone() method in AdaptiveIcon
Bug: 240335326
Test: atest FrameworksCoreTests:android.graphics.drawable.IconTest#testWithAdaptiveBitmap -- --abi x86_64
Change-Id: I1204bd759a347a9635dfb48e71ff65cef1f75f9d
2022-08-03 23:17:55 +00:00
Kohsuke Yatoh
711a120d16 Pass buffer base address to minikin::BufferReader.
Bug: 174672300
Test: atest CtsGraphicsTestCases:android.graphics.cts.TypefaceTest
Change-Id: Ie6bf1bb01ccc2803bc6206a0d2276ac59c6877a1
2022-08-03 16:30:49 +00:00
TreeHugger Robot
2a0f7e9438 Merge "Add TestApi that change default typeface" 2022-07-27 01:10:54 +00:00
Sunny Goyal
efdccdbf2d Merge "Using clippath for adaptive icon drawable instead of bitmap shader" into tm-qpr-dev am: aa3a5a36bd am: 7426a459e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19370745

Change-Id: Ia2e44300f2498c3bfb142a301f343fb67eb08369
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 16:54:30 +00:00
Seigo Nonaka
a2ffe9084a Add TestApi that change default typeface
Bug: 238597089
Test: atest android.theme.cts.ThemeHostTest#testThemes
Change-Id: Ia56b4424ab27b2f8dd01c0e61a1f9d26bd661fc9
2022-07-26 16:55:13 +09:00
Sunny Goyal
6d611a3054 Using clippath for adaptive icon drawable instead of bitmap shader
clipPath is already anti-aliased since Android S, so we do not
need to create extra bitmaps for this

Bug: 211896569
Bug: 238937089
Test: Updated tests / presubmit
Change-Id: I60ce42d91ca96babbde9faa4e5580b00f681de35
2022-07-21 20:59:17 +00:00
Kohsuke Yatoh
c2832239d9 Merge "Preload minikin LocaleListCache in Zygote." 2022-07-20 17:35:59 +00:00
Kohsuke Yatoh
bb4e06fde0 Preload minikin LocaleListCache in Zygote.
This saves ~31 KB per process on oriole.

Bug: 174672300
Test: atest CtsGraphicsTestCases:android.graphics.cts.TypefaceTest
Change-Id: Ic70ea842985a0aca441a31327e41980ed47bc961
2022-07-19 06:13:03 +00:00