This CL should fix application startup regression for Vulkan
detected by "Hermetic Startup: EmptyActivity" test.
EGL drivers are loaded in a temp thread to leave more time
in RenderThread for other work. Loading EGL drivers
on the RenderThread may cause a perf regression.
Test: Ran cold-dropcache-test test.
Bug: 122659224
Bug: 123361175
Change-Id: I8ca818e98fac196a41d079be15594caca5cb1bab
Bug: 117601185
Test: I5e5bc6b73d5d27ae30f00507d59896008d4cf364
ImageDecoder does not have a way to request decoding to F16 on 8 bit
images, but it does have a way to request an EXTENDED ColorSpace. Treat
that as a request to use a higher bit depth. This matches how we match
EXTENDED to F16 in other cases (createBitmap, Bitmap#copy, etc).
Change-Id: I3d31b13b56bb57a23b47ffcb2eaba11c53e0b8d9
Updated ImageDecoder InputStreamSource to always respect the given
inputDensity regardless if the provided resource class is null
or not.
Fixes: 115836404
Test: AI8dcdc764a963e95d6c0ad644a1e05f055c748c75 Added CTS test to
verify intrinsic bounds of resolved Drawable respects display density
Change-Id: I54e5835a8bceea9c991972ff7f106dbed29b6662
Bug: 121001670
Test: Only a documentation change.
Since Ied0426f6deff354df5998691703a18ddd33ccd3d, we no longer always
apply the ColorSpace to the copy.
Change-Id: I67f486e5c69abb2dd767ac3f1b0da515f9f20e69
Bug: 123377741
Bug: 120870651
Bug: 121001670
Bug: 123374456
Bug: 124052364
Test: I90adb511c8fdefe016028da4fd53b079d8367bf6
RGBA_F16 is no longer restricted to particular ColorSpaces. (Previously,
it was LINEAR_EXTENDED_SRGB when decoded, and EXTENDED_SRGB when
created.) Instead, F16 is now EXTENDED if there is an EXTENDED variant,
but is otherwise not special. It defaults to SRGB (but EXTENDED), but
can be created or decoded to other ColorSpaces.
Likewise, smaller Configs use the non-EXTENDED variant, when the
EXTENDED variant was requested.
ALPHA_8 always has a null ColorSpace.
Add TransferParameters to EXTENDED_SRGB. This seems to be a relic from a
time before Skia treated SkColorSpaces as non-bounded. Make it have the
same parameters as SRGB, so that it can be used in native code. e.g. now
we can draw to/from it.
Fix a bug getting the ColorSpace for gray image. ImageDecoder's info
previously reported that a gray image's ColorSpace is null. (Though it
correctly decoded it with the proper ColorSpace.)
Allow setColorSpace to request SRGB on an EXTENDED_SRGB F16 Bitmap. (It
has no visible effect.)
Do *not* allow setting a ColorSpace on an ALPHA_8 Bitmap (throw an
Exception). Other attempts to create a Bitmap with ALPHA_8 and a
non-null ColorSpace silently use null, for backwards compatibility.
Copying *from* an ALPHA_8 to another Config returns a Bitmap with SRGB.
Change-Id: Ied0426f6deff354df5998691703a18ddd33ccd3d
reduce reflection usages
--Marked GradientState parameter as hidden as each field on it is
accessible through GradientDrawable's public API
--Updated setColors API method to enable setting color stop positions
array
--Fixed issue where GradientDrawable with start/center/end colors
configured via xml would crash at runtime if the colors were modified
with a different number of colors. Resolved by providing optional
float array parameter that defaults to null if unset.
--Added public setters to GradientState parameters that were not
previously exposed
Bug: 124051827
Bug: 124051738
Bug: 124050218
Bug: 124050917
Test: Added CTS tests to GradientDrawableTest for new API coverage
Change-Id: I175998c9920d0ecca021fc3cac7d3a3f9e4b61cf
Developers can use font in xml and also application global theme in
order to change the default Typeface. android:textViewStyle and its
attribute android:textAppearance can be used to change typeface and
other text related properties.
Test: None
Bug: 123769410
Change-Id: I5923da9c7a31a5da0466fd864dd37100d896e2b0
Added comments and trackingBug for UnsupportedAppUsage annotation of
Typeface.sDefault.
Developers can already use theme to customize font for their app.
But it still has a huge amount of usage.
For that reason we can't put it into black list now, and further
investigate is required for future action.
Bug: 123769446
Test: atest TypefaceTest
Change-Id: I238c4dfbbf4a4df6a0c477d36560a28cf4dc081b
We won't change anything of the reflection access of creatFromFamiliesWithDefault.
So we only add the bug number for tracking purpose.
And the TODO is removed because the corresponding ticket is marked as fix.
Bug: 123768395
Test: atest TypefaceTest
Change-Id: I802392859fb611ea558d0c06fc0bd77f5a38c439
Hidden API usage in Bitmap->mNinePatchChunk. Annotated the field
with the max sdk annotation as there is a public getNinePatchChunk
method on Bitmap.
Bug: 123769491
Test: N/A
Change-Id: I59cee2b8af238e5656b1366c044600f6feaa95ab
Bug: 120786924
Test: I18463379d8e3d354ffafd006abd79c0a7918b500
Prior to P, createFrom* supported incomplete images, but this
regressed in P with the switch to ImageDecoder, which does not succeed
on incomplete images by default. Add a PartialImageListener, so that
incomplete images succeed.
Change-Id: Icb57d5857e1dcf6a347bb198f49284ac1975b54b
Previously setColorMode must be called before view is set, and has no effect
after that. The state of WCG on Android when this patch was written, was that
most hardware out there can not handle mixed color spaces composition well
which results in GPU composition. And this situation will remain true for a
long time.
Despite photography applications want to have WCG, it's a power cost especially
during video playback. In order to mitigate this fact and the desire to move
the ecosystem forward in WCG, we make setColorMode togglable such that in the
next app vsync, when color mode is changed we issue a surface update which
results in the old EGLSurface or VkSurface being destroyed and new EGLSurface
or VkSurface being created with the target color space being set. As a result,
applications can now togglable WCG on/off.
BUG: 120288123
Test: Build, flash and boot. Verify with SurfaceFlinger dumpsys on demo app.
Change-Id: I09bf8c380a01f4dde364873d37b248cedc6ccfd3
Change brightness tracker to enable / disable color
sampling on screen on / off.
Add value channel to BrightnessChangeEvent if available.
Bug: 112756444
Test: atest BrightnessTrackerTest
Test: atest android.display.cts.BrightnessTest
Test: manual checked pixel3 which supports this and pixel2 which doesn't
Change-Id: I94384752235d891cee975b01f933c0bc0b4572a9
The bitmap.createHardwareBitmap doesn't take a ColorSpace as input, as a result
the returned bitmap is always in SRGB color space. Given that we want to remove
the assumption of SRGB color space, we replace the usage of
createHardwareBitmap with wrapHardwareBuffer which takes an extra argument
ColorSpace. As a result, we will be able to also fix SurfaceControl and various
other places that use screenshot in follow up patches.
BUG: 120904891
Test: CtsUiRenderingTestCases
Change-Id: I57fc0c85d68df43b0e69f9a1ebac00d2ba39554d
Bug: 122844033
Test: Id1809aef84eca0ccc61bafc2476ad52ed78d5f22
Add APIs that mirror the existing creation APIs, but use @ColorLongs
instead of @ColorInts. Note that call-sites that used a null array (but
not a variable "int[]" pointing to a null array) are now ambiguous. It
is unlikely that there are any such call-sites, though, since they would
throw NullPointerException.
Consolidate constructors. Those that take two color endpoints now create
two-member long-arrays and call the more general constructor, saving
lots of code. The additional cost of small arrays is not as much as it
used to be, in the early days of Android, when this class was written.
In *Gradient#copy, there is no longer any need to clone the colors
array, since the mColorLongs was created by the Gradient. Similarly,
there never was any need to clone mPositions, which was always a clone
of the user-supplied array anyway.
Clean up Shader.cpp:
- Throw and return if the pointer is null before dereferencing it.
- Simplify and put together matrix-related code.
Change-Id: Ib71c5e85b2a398959bf687bce33980d3429bcbc3