Commit Graph

3907 Commits

Author SHA1 Message Date
TreeHugger Robot
432b9640a6 Merge "Add annotations for ImageReader/ImageWriter factory methods" 2019-02-22 00:27:43 +00:00
TreeHugger Robot
74c8a14af9 Merge "Make ImageDecoder.setTargetColorSpace to EXTENDED promote to F16" 2019-02-20 21:36:58 +00:00
Yin-Chia Yeh
e7c158f114 Add annotations for ImageReader/ImageWriter factory methods
Test: make update-api && make
Bug: 124766727
Change-Id: I7f7c5afd013370ab6e42c28b96b3cfa93e8dc615
2019-02-20 10:48:04 -08:00
TreeHugger Robot
7b8c60e0a7 Merge "Make Bitmap#copy docs more accurate" 2019-02-20 17:55:44 +00:00
TreeHugger Robot
a3c3cf4352 Merge "Hide sSystemFontMap in Typeface." 2019-02-20 08:38:30 +00:00
Stan Iliev
898123b6a3 Start RenderThread earlier to preload Vulkan/EGL drivers
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
2019-02-20 02:10:52 +00:00
Qingqing Deng
22273c3f31 Hide sSystemFontMap in Typeface.
Bug: 123769347
Test: no
Change-Id: Ib45000d49a54da8f3b3091a0346152ece70cc3e8
2019-02-19 12:39:07 -08:00
Leon Scroggins III
28f3943fd4 Make ImageDecoder.setTargetColorSpace to EXTENDED promote to F16
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
2019-02-19 11:50:19 -05:00
TreeHugger Robot
c04886e8aa Merge "Added additional documentation to Bitmap#getScaledWidth, Bitmap#getScaledHeight" 2019-02-15 04:40:08 +00:00
Nader Jawad
9167126a4c Added additional documentation to Bitmap#getScaledWidth,
Bitmap#getScaledHeight

Added additional comments describing the logic behind bitmap
dimension conversion between source and target densities

Change-Id: I7a8f9fddadad337430319a826458d1811809cef6
Fixes: 115292074
Test: N/A
2019-02-14 13:38:27 -08:00
TreeHugger Robot
af73171510 Merge "Restore getIntrinsicWidth behavior from Android O" 2019-02-14 21:14:31 +00:00
John Reck
989bb3714f Merge "Make HardwareRenderer public API" 2019-02-14 20:40:13 +00:00
Nader Jawad
79a31f32ca Restore getIntrinsicWidth behavior from Android O
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
2019-02-14 10:58:07 -08:00
Leon Scroggins III
97783ad1c1 Make Bitmap#copy docs more accurate
Bug: 121001670
Test: Only a documentation change.

Since Ied0426f6deff354df5998691703a18ddd33ccd3d, we no longer always
apply the ColorSpace to the copy.

Change-Id: I67f486e5c69abb2dd767ac3f1b0da515f9f20e69
2019-02-14 12:18:33 -05:00
Derek Sollenberger
bf3e464704 Refine ColorSpace restrictions for Bitmaps
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
2019-02-13 13:59:37 -05:00
TreeHugger Robot
63ad256efc Merge "Add trackingBug to Typeface.sSystemFontMap." 2019-02-12 20:51:34 +00:00
Nader Jawad
835ba2baaa Merge "Updated GradientDrawable to expose public APIs to reduce reflection usages" 2019-02-12 17:43:15 +00:00
Nader Jawad
f67cec79a7 Updated GradientDrawable to expose public APIs to
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
2019-02-11 16:56:37 -08:00
Siyamed Sinir
084e436d33 Merge "Prevent access for Typeface.setDefault" 2019-02-11 18:41:31 +00:00
TreeHugger Robot
1c30b0f889 Merge "Fix ColorStateListDrawable container callback API" 2019-02-09 01:37:37 +00:00
Ashley Rose
7fa0d26a97 Fix ColorStateListDrawable container callback API
Bug: 120866624
Test: atest ColorStateListDrawableTest
Change-Id: Ie2ccec13b7b270d013e6f52d86227e5be1eb776a
2019-02-08 15:26:46 -05:00
John Reck
fe5dfcacfc Make HardwareRenderer public API
Bug: 123661129
Test: HardwareRenderer CTS tests
Change-Id: Ic7ff69c9489d00e3f525eec761a84d06cf81be7a
2019-02-08 10:50:14 -08:00
Issei Suzuki
a5dbf52d0a Set insets on the virtual display to avoid IME covering the bubble.
Bug: 123544535
Test: Manual test using the test app, and atest DisplayPolicyLayoutTests
Change-Id: If2fceea97f4d702d000d887883c7f131337e9fd0
2019-02-08 14:21:53 +01:00
Rahul Ravikumar
f6f2e32b4e Merge "Add a EdgeEffect#setBlendMode API." 2019-02-07 21:39:19 +00:00
Shuzhen Wang
ebd10b8fcf Merge "Camera: Add HEIC format output" 2019-02-07 19:15:32 +00:00
Qingqing Deng
acb0f00bbc Add trackingBug to Typeface.sSystemFontMap.
Bug: 123769347
Test: No.
Change-Id: I167048acda6f969d0e9bcc5a08077f96273d177a
2019-02-06 15:13:12 -08:00
Siyamed Sinir
3a24ff34ef Prevent access for Typeface.setDefault
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
2019-02-06 14:30:19 -08:00
Rahul Ravikumar
7ab5459af9 Add a EdgeEffect#setBlendMode API.
* Fixes hidden api usage b/123769450
* Move from setXferMode() to setBlendMode in Paint.

Fixes: b/123769450

Test: Added CTS Tests.
Change-Id: I1f950e4c14d30dd223cce05835b230c086755089
2019-02-06 14:15:13 -08:00
Qingqing Deng
4a558101cd Add trackingBug to FontFamily Usages.
Bug:123768928
Test: None.
Change-Id: Icfe7c7b48a5736c65cfde6c89af09d3c0b82eabb
2019-02-06 13:32:37 -08:00
Haoyu Zhang
f324849ab0 Merge "Add comments on UnsupportedAppUsage of Typeface.sDefault" 2019-02-06 19:28:40 +00:00
Shuzhen Wang
f655b1c876 Camera: Add HEIC format output
- Add HEIC ImageFormat.
- Add HEIC related camera static metatadata.
- Handle BlobID and BlobSize properly for HEIC format.

Test: Camera CTS
Bug: 79465976
Change-Id: I8606711b036e695e23671c4563364c24aad9ed84
2019-02-06 10:11:20 -08:00
Qingqing Deng
28eb14a807 Deprecate graphics/FontFamily.
Bug: 123768928
Test: atest FontFamilyTest
Test: atest CtsWidgetTestCases:EditTextTest CtsWidgetTestCases:TextViewFadingEdgeTest FrameworksCoreTests:TextViewFallbackLineSpacingTest FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest CtsTextTestCases FrameworksCoreTests:android.text CtsWidgetTestCases:TextViewPrecomputedTextTest
Change-Id: I3fcfa4a75ada9cfe58d090f387fab03a4d807e20
2019-02-05 17:40:38 -08:00
Haoyu Zhang
64457aa115 Add comments on UnsupportedAppUsage of Typeface.sDefault
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
2019-02-05 14:14:43 -08:00
Haoyu Zhang
c0f9d5a262 Add trackNum to UnsupportedAppUsage annotation of createFromFamiliesWithDefault
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
2019-02-05 01:58:30 +00:00
TreeHugger Robot
a9f577b5c6 Merge "Added maxSdk annotation to mNinePatchChunk field on Bitmap" 2019-02-04 23:21:55 +00:00
Nader Jawad
d5d17e5148 Added maxSdk annotation to mNinePatchChunk field on Bitmap
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
2019-02-04 13:18:49 -08:00
TreeHugger Robot
6f55e56e29 Merge "Make Drawable#createFrom* support incomplete images" 2019-02-02 01:28:48 +00:00
Peiyong Lin
dd4b22e66c Merge "[Color] Make setColorMode togglable." 2019-02-01 23:20:30 +00:00
Leon Scroggins III
c0fa2b9570 Make Drawable#createFrom* support incomplete images
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
2019-02-01 21:31:07 +00:00
Kevin DuBois
a28aa5e6ec Merge "Pipe through color sampling to BrightnessChangeEvent" 2019-02-01 17:42:00 +00:00
Peiyong Lin
a94f3221da [Color] Make setColorMode togglable.
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
2019-01-31 21:34:50 -08:00
TreeHugger Robot
8116124801 Merge "Remove Shader#copy()" 2019-01-31 16:41:50 +00:00
Kenny Guy
908108aa4b Pipe through color sampling to BrightnessChangeEvent
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
2019-01-31 16:33:06 +00:00
Peiyong Lin
a0baea28b7 Merge "Replace createHardwareBitmap with wrapHardwareBuffer." 2019-01-31 15:37:56 +00:00
TreeHugger Robot
1bd8c8bb4f Merge "Use ColorLongs in Linear-, Radial-, and Sweep-Gradient" 2019-01-31 04:44:38 +00:00
Peiyong Lin
9d4274005e Replace createHardwareBitmap with wrapHardwareBuffer.
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
2019-01-30 15:22:54 -08:00
TreeHugger Robot
028b73d3c0 Merge "Expose new color long Graphics APIs as public APIs." 2019-01-30 22:04:02 +00:00
Leon Scroggins III
85a13eee5e Remove Shader#copy()
Test: make

This is a hidden, protected API that is not called anywhere on the
system. Remove it.

Change-Id: I6d908945826be6f0cf19278d3d3d8d653faf8ebe
2019-01-30 16:01:36 -05:00
Leon Scroggins III
b0aecc22d3 Use ColorLongs in Linear-, Radial-, and Sweep-Gradient
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
2019-01-30 16:01:31 -05:00
Derek Sollenberger
a141563dc2 Expose new color long Graphics APIs as public APIs.
Test: existing CtsGraphicsTestCases and CtsUiRenderingTestCases
Bug: 120904891
Change-Id: I1d760a9a4681bd3e01132fe1b9213e5a17eb9c3d
2019-01-30 13:10:11 -05:00