Commit Graph

4868 Commits

Author SHA1 Message Date
Angel Aguayo
90c46ee50b Exposed SkCanvas::drawMesh
Added drawMesh method to the Canvas API, utilizing SkCanvas::drawMesh.

Bug: b/253321460
Test: HwAccelerationTest MeshActivity
Change-Id: I43802af61bbd6f76444b4e4b7cec2b95bae34f66
2022-12-03 02:11:46 +00:00
Chet Haase
47ef6a4e2a Merge "Remove PathIterator.Segment() constructor from public API" 2022-12-01 04:00:59 +00:00
Kohsuke Yatoh
a089ecef9f Merge "Make Typeface#releaseNativeObjectForTest @TestApi." 2022-12-01 00:58:46 +00:00
John Reck
d6884198e6 Fix request -> Builder
Test: none
Bug: 245479361
Change-Id: Iee3bf90099648370018f31c6711ffdb56a98d89c
2022-11-30 14:16:45 -05:00
Angel Aguayo
4804746c35 Exposed SkMesh
Exposed skMesh through Mesh API, utilizing makeVertexBuffer,
makeIndexBuffer, make, and makeIndexed. Uniforms are set through
set<>Uniform methods, where the native mesh will then be updated upon
each call to set<>Uniform.

Bug: b/254354591
Test: built hwui
Change-Id: Ia100f00a1e29198e30dfd25999f8bd8db9fb3ca0
2022-11-29 01:21:10 +00:00
Angel Aguayo
0e8df402ab Merge "Exposed SkMeshSpecification" 2022-11-29 00:44:22 +00:00
Chet Haase
af37b98803 Remove PathIterator.Segment() constructor from public API
Bug: 255429700
Test: CTS PathTest and PathIteratorTest pass

Change-Id: Ia269a7cbf6f4a6827752f8034566e04d19076d4a
2022-11-28 23:46:43 +00:00
Kohsuke Yatoh
6c89096fb8 Make Typeface#releaseNativeObjectForTest @TestApi.
The test module would crash with SEGV_MAPERR if the following events
happen in order:
(1) Typeface#deserializeFontMap(ByteBuffer, Map<String, Typeface>)
    (also a @TestApi) is called.
(2) The ByteBuffer passed to deserializeFontMap is GC-ed.
(3) The Typeface objects generated by deserializeFontMap are GC-ed.

This is because Typeface reads the buffer in its native object
destructor after
commit 88e387449b3f477a4cde31127cee5c63f332999c

This crash won't happen in production, because the buffer will never be
released.
To prevent the crash in tests, we must release Typeface objects
manually before (2) happens.

Bug: 255798098
Test: atest CtsGraphicsTestCases
Change-Id: If4426beb9a0dcefde317e6a01b4de9bf3fa4c951
2022-11-28 04:50:24 +00:00
TreeHugger Robot
f6396c6870 Merge "PixelCopy API feedback" 2022-11-24 02:47:26 +00:00
Sally Qi
d2fbea3097 Merge "Plumb overlayPropertes into DMS side." 2022-11-22 18:20:49 +00:00
John Reck
056e5dc03b PixelCopy API feedback
Test: atest android.view.cts.PixelCopyTest
Fixes: 245479361
Change-Id: Ia28c2334cc238a1a78c9d5e687d1f0051a427489
2022-11-21 16:43:50 -05:00
TreeHugger Robot
0736dfb9f0 Merge "Send HWUI load reset hint when Choreographer registers a callback" 2022-11-18 03:27:19 +00:00
Angel Aguayo
79e5f58ff6 Exposed SkMeshSpecification
Exposed SkMeshSpecification through MeshSpecification, exposing Make
methods as well as constructing a Attribute and Varying data classes.

Bug: b/254354404
Test: build hwui
Change-Id: I1040bde091575ac4bb786f7600d016b7c9168831
2022-11-17 21:08:34 +00:00
Matt Buckley
d98e8054f3 Send HWUI load reset hint when Choreographer registers a callback
Send a load reset hint hint to DrawFrameTask through ThreadedRenderer
from ViewRootImpl whenever Choreographer registers a callback. This
allows the PowerHAL to allocate more resources for HWUI in response to
upcoming work, helping prevent frame drop.

Bug: b/243938267
Test: manual

Change-Id: Ie2cf809cf85530af04f4d0db3407853d4da03d62
2022-11-17 20:37:08 +00:00
Cole Faust
e4abcbec1d [conflict] Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c am: d3c499dabc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I84d67fdfcc99f9f6fca218d4264ab8e0bc1f1653
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:47:41 +00:00
Cole Faust
d3c499dabc Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I8090e254f06a3b5fc7e9b23fdae6c5bd3db230c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:37:15 +00:00
Cole Faust
f9df26ae3c Merge "Fix errorprone warnings that should be errors" am: 677d6cd780
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I0e9c5077610407a117ee34ff688b40b52e161a03
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:11:55 +00:00
Sally Qi
fed0301271 Plumb overlayPropertes into DMS side.
- Implement OverlayProperties JNI class
- Call getOverlaySupport() on Diaplay Manager. Inside, provide
  SurfaceControl#getOverlaySupport api to call AIDL function in the back
  end.

Bug: 242588489
Test: build and flash
Change-Id: I23819d21063cd191a06d92295af2be9132bfe1df
2022-11-15 11:08:28 -08:00
Cole Faust
7da659bb6c Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:

BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower

See https://errorprone.info/bugpatterns for more
information on the checks.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8446f9076a45ebf7e7ffa06cb0d4ddb1001b6c00
2022-11-14 17:57:30 -08:00
Nolan Scobie
87ecb66104 Merge "docs: Note that antialiasing is not supported on multiple Canvas draw ops" into tm-dev am: 3b5f7cb4ba am: 7b351a48d8 am: 6f9c9792a4 am: a8d447ca9a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20376185

Change-Id: Ifb7b885294bbfbd1457e08884506cbaab7fa0fdf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 21:15:34 +00:00
Nolan Scobie
a8d447ca9a Merge "docs: Note that antialiasing is not supported on multiple Canvas draw ops" into tm-dev am: 3b5f7cb4ba am: 7b351a48d8 am: 6f9c9792a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20376185

Change-Id: I148060de7166574a6e817b38b1d37d0e34a3593f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 20:54:07 +00:00
Nolan Scobie
6f9c9792a4 Merge "docs: Note that antialiasing is not supported on multiple Canvas draw ops" into tm-dev am: 3b5f7cb4ba am: 7b351a48d8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20376185

Change-Id: If89172b1bdc4d6e75f0eaac3c3467924b8c8a6bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 20:40:30 +00:00
Nolan Scobie
3b5f7cb4ba Merge "docs: Note that antialiasing is not supported on multiple Canvas draw ops" into tm-dev 2022-11-14 19:30:01 +00:00
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
Nolan Scobie
6a23f4bf10 docs: Note that antialiasing is not supported on multiple Canvas draw ops
Fixes: 240457136
Test: Manually checked pages built from ABTD run
Change-Id: I024959a5d9bc74a1a45dfe65245f8952ad18c236
2022-11-03 16:19:17 -04: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