Commit Graph

4676 Commits

Author SHA1 Message Date
Chet Haase
29d27008a7 Merge "Enable path clipping for View outlines" 2021-12-22 17:38:30 +00:00
Shubham Dubey
f95fdd9472 Revert "Enforce that RuntimeShader is only hardware accelerated"
Revert "Add tests to ensure hardware only for RuntimeShader API"

Revert submission 16475336-RuntimeShader_softwareOnly

Reason for revert: Breaking tests as system is dying
Error: Software rendering doesn't support RuntimeShader
Bug: b/211066630

Reverted Changes:
Id0ee4d1f0:Enforce that RuntimeShader is only hardware accele...
Ib4c2e54bd:Add tests to ensure hardware only for RuntimeShade...

Change-Id: Id7bbf2609a06c1cd69f6a457dab44f9478d95742
2021-12-17 05:43:49 +00:00
Derek Sollenberger
c93d29cfab Enforce that RuntimeShader is only hardware accelerated
Throw an illegal argument exception any time a Paint with
a RuntimeShader is attempted to be drawn into a software
canvas. Also mark that a Picture that uses a RuntimeShader is
properly marked as requiring hardware acceleration.
These tests check that the use of RuntimeShaders trigger

Bug: 189102731
Bug: 201546136
Test: atest CtsUiRenderingTestCases:RuntimeShaderTests
Change-Id: Id0ee4d1f05e2975031121298b45f925ee74f6818
2021-12-16 19:36:46 +00:00
Derek Sollenberger
e09fbeed9a Expose android.graphics.RuntimeShader API
In addition to exposing the API to the SDK this CL expands the
number and type of APIs available to modify the uniforms. For
uniforms that resolve to the primitive types of 'float' or 'int'
there are five different entry points for each whose purpose is
twofold. First, these entry points map directly to the GLSL
types (e.g. float, vec2, vec3, vec4, float[]) that these uniforms
are bound to.  Second, for animations these uniforms can be updated
every frame and avoid unnecessary java array allocations was also
motivation for using this pattern instead of varargs.

Bug: 189102731
Test: atest CtsUiRenderingTestCases:RuntimeShaderTests
Change-Id: I4870acd7656095c9d413e708a3150c10134e8afd
2021-12-16 13:33:31 +00:00
Chet Haase
33c1ea73e8 Enable path clipping for View outlines
Clipping Views to Outlines has existed for several releases,
as has providing a Path for shaping Oulines. However, using
a Path-shaped Outline to clip a View against was specifically
disabled internally, due to historical functionality limitations
(prior to enabling Skia for HWUI rendering) as well as performance
concerns.

On current (even relatively low-end) hardware, path clipping is now
sufficiently performant that we are enabling this functionality.
This functionality will be used by AndroidX APIs that enable easier
shaping via paths.

Bug: 201807515
Test: Manual testing including hwui performance tests and CTS
OutlineTest

Change-Id: Ic61d9393cb72c6ad3517954177e5037a383a0c4d
2021-12-14 21:43:05 +00:00
Vishnu Nair
db018e12e1 Merge "SurfaceView: Synchronize initial destframe change from BBQ" 2021-12-08 16:55:16 +00:00
Vishnu Nair
87d71d6d3f SurfaceView: Synchronize initial destframe change from BBQ
Fixes a case where the SurfaceView is stuck with a wrong
scale.

Destination frame scales the buffer to the SurfaceView
fixed size. Currently the initial destination frame is
applied when the first buffer is acquired by BBQ. The
transaction is sent via the BBQ apply token.

Meanwhile if the client updates the SurfaceView fixed
size, the SurfaceView will apply the transaction via
the SCC apply token.

This can cause destframe changes to be applied out of
order causing the app to be stuck with the wrong
scale.

Bug: 195443440
Test: atest BLASTBufferQueueTest
Test: repro steps from bug

Change-Id: Ibf53a0efdebb87291d081e48633c373a98d347b1
2021-12-07 17:31:51 -08:00
Sally Qi
a54976ec22 Merge "Add DataSpace API to convert between ADataSpace and ColorSpace" 2021-12-02 19:02:12 +00:00
Chavi Weingarten
354d65eec7 Merge "Synchronize SV buffers with main window when config changes" 2021-12-01 17:20:44 +00:00
chaviw
1602deb674 Synchronize SV buffers with main window when config changes
When the main window gets a configuration change, the new buffer for the
SV will get applied in the same transaction as the main window. This
will allow apps to implement seamless rotation without a frame or more
of black where the SV was resized, but the buffer was not yet updated.

This also includes an optimization where if only SV change occurs, but
there was no request from WMS to report drawing, VRI can apply the
transaction immediately without reporting to WMS.

Test: SV with seamless rotation enabled
Bug: 200284684
Change-Id: I5569d815eef92acf3bf9d7f753bd5ab94a332cfe
2021-12-01 17:17:55 +00:00
Seigo Nonaka
4b3f04314a Merge "Remove link to the deprecated API" 2021-11-30 04:17:39 +00:00
Aaron Labiaga
4b7663bff7 Fix erroneous comment end tag for xml in ripple code sample.
Change-Id: I4f932676d121125cb02c60769af4c245f3cccd03
Bug: b/168605104
2021-11-29 19:06:46 +00:00
Sunny Goyal
43a1f4b48d Updating AdaptiveIconDrawable to support themed icons
Bug: 201718966
Test: CTS updated
Change-Id: Ibb7e106ae11babe533d0787c6245557ebcc02d32
2021-11-24 19:41:59 +00:00
Seigo Nonaka
aec3a3fde5 Remove link to the deprecated API
Bug: 207041621
Test: N/A
Change-Id: Ideb732f3694645612df1b7b885ef0a8ef3fa19c8
2021-11-23 13:07:37 -08:00
TreeHugger Robot
6423d01b01 Merge "Implement fast hyphenation algorithm" 2021-11-19 01:32:34 +00:00
Sally Qi
ac97f99b41 Add DataSpace API to convert between ADataSpace and ColorSpace
Also implement getDataSpace functions in SurfaceTexture and Image field
to help with upstream HDR work.

Bug: 201539996
Bug: 201535454
Test: android.hardware.camera2.cts.ImageWriterTest, android.hardware.cts.DataSpaceTest pass
Change-Id: I17fa43c1ba60e6f59da1910cebcef0dab993ce3b
2021-11-12 13:33:53 -08:00
Seigo Nonaka
0f761404af Implement fast hyphenation algorithm
RandomText Balanced Hyphenation ON
	min: 2,312,291
	mean: 2,320,574
	median: 2,320,112

RandomText Balanced Hyphenation ON(Fast)
	min: 985,850
	mean: 990,922
	median: 986,586

RandomText Balanced Hyphenation OFF
	min: 909,060
	median: 923,585
	mean: 930,052

Bug: 201096525
Test: TreeHugger and minikin_tests
Change-Id: Ide2d73acb3de85e91018e524c89df2c949235a4e
2021-11-10 23:19:43 -08:00
chaviw
989aa9b726 Rename nextTransaction to syncTransaction
The variable nextTransaction is abigious and doesn't represent its
purpose. Rename to syncTransaction

Test: Builds
Bug: 200285149
Change-Id: I55c3efe02aee17a610034bb5eb011e98e7747d7c
2021-11-10 18:17:41 -06:00
chaviw
6f2b3f5dcc Remove setTransactionCompleteCallback
There are no longer an uses for BBQ.setTransactionCompleteCallback so
remove from code.

Test: Builds
Bug: 200285149
Change-Id: I1eea54ac53b4f8514ea11116e6839a39acf51e68
2021-10-14 12:17:19 -05:00
Chet Haase
d51503009f Merge "Updated Outline.offset() docs to clarify behavior" 2021-10-05 20:05:53 +00:00
Chet Haase
6ad394ac04 Updated Outline.offset() docs to clarify behavior
Bug: 202063656
Test: N/A, but added CTS sub-test for untested behavior
Change-Id: I86dc415879b23b92b9283c822094d4b811cd796f
2021-10-05 17:37:35 +00:00
John Reck
712eae053c Support dump gfxinfo reset for process' without a Window
Bug: 199791928
Test: manual
Change-Id: I995d236c2c9d60194f72275a3da1c82340f77898
2021-10-01 15:51:48 -04:00
TreeHugger Robot
e1cf17c292 Merge "ImageFormat: Fix YCBCR_P010 bitsPerPixel" into sc-qpr1-dev am: 70add31774 am: fc5e4c3d43 am: 3fda08d35f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15899485

Change-Id: I7555ca1b7b2135e21b27b08c8f9c5166b06c80fc
2021-09-24 18:38:53 +00:00
Shuzhen Wang
3e4720b3b4 ImageFormat: Fix YCBCR_P010 bitsPerPixel
For P010 format, Each pixel has Y and subsampled CbCr. So:
bitPerPixel = 1.5 * bitPerPixelY
bitPerPixelY = 16 bits

Bug: 200949749
Test: Camera CTS
Change-Id: I7964d64c25961dbef634ac1ef82898147ec57111
2021-09-23 22:25:09 +00:00
TreeHugger Robot
d7cbe3d827 Merge "In SkSL, replace 'sample' with '.eval'" 2021-09-08 18:15:20 +00:00
Chavi Weingarten
da143d4a41 Merge "Call applyPendingTransactions when frame didn't draw" 2021-09-08 15:50:25 +00:00
chaviw
a9997a38fe Remove flushShadowQueue
flushShadowQueue no longer does anything in BBQ so remove from Java and
JNI code.

Test: Builds
Fixes: 199204968
Change-Id: I4df67a23732ba4ffaca42390b29d3f81cadd6457
2021-09-07 17:53:31 -05:00
chaviw
9f19b5d198 Call applyPendingTransactions when frame didn't draw
It's possible for a caller to requested mergeWithNextTransaction, but
the main frame had nothing new to draw. If that's the case, the
mergeWithNextTransactions will be stuck and never applied (or applied
much later). Since this could end up blocking Transactions, it's better
to force apply these when we know a frame wasn't going to draw this
vsync.

Test: Existing tests pass
Bug: 195262673
Change-Id: Ic0919ba6446d6a12d824185f6b3e540c2d5319d7
2021-09-07 17:31:28 -05:00
Brian Osman
bb10b9c616 In SkSL, replace 'sample' with '.eval'
SkSL syntax is evolving to better communicate how the effects integrate
with the rest of the Skia pipeline. 'sample' suggests texture sampling,
but the invocation of the shader object is really a call to a function
(the entry point of the SkShader's generated code).

Bug: skbug.com/12302
Change-Id: Ib6b895208ae70368901965b7ca13434c51a7455f
2021-09-07 20:17:47 +00:00
chaviw
9c13753526 Rework blast sync callback model
The previous code waited for a frame complete callback from hwui before
notifying WMS that a draw had occurred. However, frame complete callback
was not guaranteed to get called since it only invokes a callback if a
draw actually occured. VRI really needs a signal that RT has completed,
since it just needs to know that a draw was possible so it can notify
WMS that the RT completed its pass.

Instead, rename frameCompleteCallback to frameCommitCallback since that
API is exposed to a public API when a frame was actually drawn.
Create a new callback, frameCompleteCallback, that is invoked when the
draw has completed, regardless if a frame was actually drawn.

When the frameCompleteCallback is invoked, VRI can check to see if a new
frame actually drew. VRI can call into BBQ to see if the frame acquired
matches the frame that was attempted to draw. If so, VRI can wait on a
transaction callback. If not, it can allow VRI to continue. In either case,
it will notify WMS that the draw has finished.

Test: Split over and over
Bug: 195262673
Change-Id: I24dd19ab2746be3fc33e597761abf8c5249f8b5b
2021-09-03 14:50:37 -05:00
Seigo Nonaka
4ed687a48f Filter Alias which points non-existing font family name
The FontFamily will be removed if none of font files exist on the
device.

Bug: 192479819
Test: atest FontListParserTest
Change-Id: I36f6476fe37bc04ec8737936747385c63908d651
(cherry picked from commit 691cfe8818)
2021-08-26 06:21:18 +00:00
John Reck
ba6dd78b58 Merge "Fix Nullability annotation" 2021-08-17 15:52:35 +00:00
John Reck
9e91be3541 Fix Nullability annotation
The initial commit of the @Nullable annotation appears
to have been based off of the javadocs. However, the actual
code does not appear to have allowed for null at that time.

It's not entirely clear if null was ever allowed, but it
hasn't been allowed since API 14 at least

Test: make
Fixes: 195924626
Change-Id: Ibffdc7b90cbfc3bc65a4a08bee52e2e3412bed3e
2021-08-13 22:42:44 +00:00
Automerger Merge Worker
4f2415e1e7 Merge "Merge "Remove bitwise plane information from ImageFormat's P010 docs" into sc-dev am: b0766d70d9 am: 45b34cb562" 2021-08-13 21:08:23 +00:00
Alec Mouri
d351b6d31d Merge "Remove bitwise plane information from ImageFormat's P010 docs" into sc-dev am: b0766d70d9 am: 45b34cb562
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15529193

Change-Id: I97550837d18c57a22bbdef32094571e353addb9b
2021-08-13 21:07:58 +00:00
Alec Mouri
b0766d70d9 Merge "Remove bitwise plane information from ImageFormat's P010 docs" into sc-dev 2021-08-13 18:42:57 +00:00
John Reck
0ba298a7e4 Move WebView overlay support off of NewWeakGlobalRef
Test: ?
Bug: 194893628
Change-Id: Idab4dbdfa958b383754db703b76503a63a8b9d26
2021-08-13 13:40:55 -04:00
Alec Mouri
edae98a45a Remove bitwise plane information from ImageFormat's P010 docs
Some vendors may prefer a different underlying layout for P010 in the
future compared to the one currently supported in gralloc. In
particular, it's not a guarantee that the CB/CR plane is contiguous in
memory with the Y plane.

Bug: 195570363
Test: builds
Change-Id: I01eea78b8555610470959cdb4f0f9ceb16e80f73
2021-08-12 16:49:58 +00:00
John Reck
31bde04846 Move HardwareObserver off of NewWeakGlobalRef
Test: atest android.view.cts.FrameMetricsListenerTest
Bug: 194893628
Change-Id: I352ba74ba03ac998ddcf53a2d5d65f2577e23dd5
2021-08-11 15:11:42 -04:00
Leon Scroggins
6bb80ed918 Merge "Do not turn on dithering by default" into sc-dev am: 9817790471 am: 9a02a75c9d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15502988

Change-Id: Ib9dea6db401869d84343a6f3564256445efd2ea7
2021-08-09 23:57:09 +00:00
Leon Scroggins
9817790471 Merge "Do not turn on dithering by default" into sc-dev 2021-08-09 23:34:12 +00:00
Leon Scroggins III
eb5a3553dc Do not turn on dithering by default
Bug: 195281495
Test: Ief7025c21f365ae90fa63120f1cc82e0695901af

This is a partial revert of 47c51fe80e3dd9d6b518c11c2e1714c271835af5/
I5d5d03e430af380e23016c6deba5eca46067a22b. The intent was to bring
today's rendering implementation in line with the old HWUI
implementation, which always dithered gradients by default. However,
when dithering is enabled, the Skia implementation dithers more than
just gradients (e.g. Bitmaps). Combined with poor performance of the
dithering algorithm on certain GPUs, this led to a performance
regression on key apps.

Change-Id: Id54121091e2cc47131dc9b5ae67bd638fbc005fc
2021-08-09 15:11:20 -04:00
Lucas Dupin
2983d71f12 Merge "Do not run background animation without a Looper" into sc-dev am: c359d54b49 am: c31d0895e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15474611

Change-Id: I5e36368c4d21afb7cfe60e2d196381c97a0c0839
2021-08-05 23:14:56 +00:00
Lucas Dupin
c359d54b49 Merge "Do not run background animation without a Looper" into sc-dev 2021-08-05 22:44:56 +00:00
Lucas Dupin
84922f4f43 Do not run background animation without a Looper
Apps that create RippleDrawable on a background thread could crash,
making them incompatible with S.

Test: manual with MindBody app
Fixes: 194952073
Change-Id: I9d16d5c63c192e96191b4fbc859ff3bc3da733cb
2021-08-05 09:18:32 -07:00
John Reck
7241862b13 Merge "Have RippleDrawable ignore non-attached RenderNodes" into sc-dev am: a633284efe am: 5c4d6e0a01
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15463315

Change-Id: Ib9b35c118bda71f463f93b0c962fe8f34417d720
2021-08-04 22:47:33 +00:00
Sally Qi
2e747286c2 Merge "Fix reference issue from the Theme and XML color in Gradient Drawable by" 2021-08-04 18:30:58 +00:00
John Reck
a355e904a2 Have RippleDrawable ignore non-attached RenderNodes
Don't try to do a RenderNodeAnimation if the RenderNode
isn't attached. Although this isn't strictly speaking a
valid state to be in, it's also easy for RippleDrawable
to just ignore it.

Bug: 186864959
Test: ripples still show up, are still RT accelerated normally
Change-Id: I8127f1419508157eb83ac9bb1562745ac53d2ced
2021-08-04 18:22:16 +00:00
Sally Qi
9df984da93 Fix reference issue from the Theme and XML color in Gradient Drawable by
1. Change mGradientColors to a ColorStateList array
2. Update mGradientColors array by reading the Theme and XML color in UpdateGradientDrawableGradient function
3. Query state color in each instance of mGradientColors array in
ensureValidRect function for LinearGradient object creation.

Bug: 157969624
Test: android.graphics.drawable.cts.GradientDrawableTest suite
Change-Id: Ibbf2c5cb2846d75c53bd34a3f04661ae604e6745
2021-08-03 17:23:56 -07:00
John Reck
4342391dd1 Merge "Remove NewWeakGlobalRef from RenderNode" 2021-08-03 22:29:33 +00:00