Commit Graph

3663 Commits

Author SHA1 Message Date
Louis Chang
a358d7611c Set minimum scaled width/height to 1
Applications could be launched on a secondary display that
has lower density than default display. While some applications
may use 1x1 image resource as activity background, the scaled
width/height would be 0 if down scaling the 1x1 image with
scale ratio that is less than 1/2.

Making sure the scaled width/height won’t less than 1 to
prevent application crashed.

Bug: 117749148
Test: Launch app on secondary display

Change-Id: I73567dd237736466d0bc423485359d50073d86c1
2018-11-20 22:38:08 +08:00
John Reck
5c6397e9bb Add compat workaround
Bug: 119066174
Test: repro from bug
Change-Id: Ifc50fc64422d571ee94ce8510825aed7f915adfd
2018-11-14 15:25:10 -08:00
TreeHugger Robot
958176c775 Merge "Update API doc of Typeaface.setSystemFallback" 2018-11-10 23:34:30 +00:00
TreeHugger Robot
a87656a7b5 Merge "Tweak RenderNode final/constructor API" 2018-11-10 06:31:40 +00:00
Seigo Nonaka
06dfab0136 Update API doc of Typeaface.setSystemFallback
Bug: 116116764
Test: N/A
Change-Id: I97ebdcfd8d4b4efb0a1d9e3729f74fe7fba96b12
2018-11-09 17:02:36 -08:00
John Reck
e5bc78ff9d Tweak RenderNode final/constructor API
Bug: 112709971
Test: builds
Change-Id: Idc558645015078b923bd94abc320b2a65d8d2c6b
2018-11-09 15:18:43 -08:00
John Reck
6ae76d0d8a Merge "Refactors and a potential public API for rendering" 2018-11-09 19:16:27 +00:00
TreeHugger Robot
c578d38eb7 Merge "Deprecate Drawable#getOpacity" 2018-11-09 03:55:04 +00:00
TreeHugger Robot
34f042d290 Merge "Updated ColorDrawable setAlpha/getAlpha documentation" 2018-11-09 01:46:33 +00:00
Nader Jawad
fc063e9c22 Updated ColorDrawable setAlpha/getAlpha documentation
Updated documentation on ColorDrawable to clarify that the alpha
value provided is combined with the color's already existing alpha
value instead of overwriting it.

Bug: 119004459
Test: Build and boots
Change-Id: Id62462c4ac7d2f46cdc3236876f7e0711fbc4c16
2018-11-08 15:53:47 -08:00
Nader Jawad
3d5c03df79 Deprecate Drawable#getOpacity
Deprecated getOpacity method on Drawable as the graphics optimization
is no longer utilized in the framework

Bug: 118841703
Test: Build and boots
Change-Id: Ie21c9379a5e9737ed68c09c2e518732c1578b3cb
2018-11-08 15:33:31 -08:00
John Reck
8785ceb3b9 Refactors and a potential public API for rendering
Split out the View/ViewRootImpl bits from the
hardware rendering bits.

Create a potential public API surface for
hardware rendering

Bug: 112709971
Test: builds & boots

Change-Id: I9e6f44b07a170574a905f42338282c4bb7e95f56
2018-11-08 15:32:35 -08:00
TreeHugger Robot
e6bded0d4a Merge "Pass custom fallback info to minikin" 2018-11-07 09:01:42 +00:00
Shuzhen Wang
68e8199c64 Merge "Camera: Unhide and update Y8 format spec" 2018-11-07 05:54:39 +00:00
Seigo Nonaka
f69e7037ba Pass custom fallback info to minikin
The custom fallback info is used for determine the priority between
custom fallback and locale fallback. The custom fallback should be
given priority over locale fallback.

Bug: 116512426
Test: minikin_tests
Test: atest TypefaceCustomFallbackBuilderTest
Change-Id: I79cc82fa990d7705ea5c40e9b0be40d062c218dc
2018-11-07 03:52:35 +00:00
Seigo Nonaka
c1b6ab69c6 Introduce new API for specifying user font fallback
Bug: 111133573
Test: atest TypefaceCustomFallbackBuilderTest
Change-Id: I0345824ecd475e43dbb5e5451f647020c4b53a83
2018-11-06 10:56:30 -08:00
Seigo Nonaka
0a2786cc5d Merge "Refactor Typeface construction logic" 2018-11-05 21:09:23 +00:00
John Reck
ddeaa487da Make RenderNode public API
Bug: 112709971
Test: CtsUiRenderingTestCases:.testclasses.RenderNodeTests
Change-Id: I57d64165b842d03565eda5f4d37343c4f9c45d42
2018-11-02 14:24:32 -07:00
Siyamed Sinir
3bef4908b2 Move MeasuredText.sRegistry to Builder
Test: atest android.graphics.text.cts.MeasuredTextTest
Test: atest android.graphics.text.cts.LineBreakerTest
Test: atest android.text.cts.StaticLayoutTest

Bug: 117888473
Bug: 112327179
Change-Id: I0c1b86928429dce02867ac0cba674e0f69fc5fdf
2018-10-30 16:53:59 -07:00
Seigo Nonaka
ee4b6d85dc Refactor Typeface construction logic
API refactoring:
- Replace Font.getWeight()/getSlant() with Font.getStyle().
- Change Typeface.CustomFallbackBuilder.setItalic() to setSlant()

Implementation refactoring:
- Add hidden builder API for asset manager with cookie. The cookie is
internal, so hide the API as well.
- Replace createFromResources with Typeface.Builder
- Reimplement Typeface.Builder with Typeface.CustomFallbackBuilder

Ground work for b/114479228
- Keep list of FontFamily in the Typeface.

Bug: 114479228
Test: atest CtsTestCases
Test: atest CtsGraphicsTestCases
Test: atest CtsWidgetTestCases
Change-Id: Ifaaa58ddea147644a93158aa075394c2f645617c
2018-10-30 12:18:12 -07:00
TreeHugger Robot
a5ce2c7c7c Merge "Register generic font families in Zygote" 2018-10-29 20:06:34 +00:00
Shuzhen Wang
ec5e8d25f0 Camera: Unhide and update Y8 format spec
- Unhide Y8 format as part of MONOCHROME camera support.
- Specify required stream combination for Y8 format.

Test: Camera CTS test
Bug: 70216652
Change-Id: Iab28b7ee3f2d5ec534a517079f14e0ed648ae556
2018-10-29 07:44:13 -07:00
TreeHugger Robot
815aa66d3c Merge "Update some docs & tweak some method names" 2018-10-27 00:24:59 +00:00
Seigo Nonaka
d06aa0ab1f Register generic font families in Zygote
Bug: 114479228
Test: TreeHugger and verified this is booted manually
Change-Id: I5e2c25ad01d5686e6116f343c7345d43f8160c62
2018-10-26 17:17:48 -07:00
John Reck
c7ddcf390f Update some docs & tweak some method names
Test: builds
Change-Id: Id0e5cf6fdb3a391136a1d314498f75e0b954ceeb
2018-10-26 13:57:12 -07:00
TreeHugger Robot
3fb3ac1ab2 Merge "Keep file path used to create SkTypeface in MinikinFontSkia" 2018-10-26 04:12:51 +00:00
John Reck
c59e7dd6ad Merge "Clarify createScaledBitmap's 'filter' docs" am: e0f6d84ba1 am: 324cb8c075
am: c2eaf48e42

Change-Id: Id0a228f273f83b238ba1df92a78b7a0da66c4209
2018-10-25 18:17:28 -07:00
Seigo Nonaka
54c6a2722b Keep file path used to create SkTypeface in MinikinFontSkia
This is a ground work for the itemize API. The file path will be the
output of the itemize API.

Bug: 114479228
Test: minikin_tests
Test: hwui_unit_tests (only tested on 32bit. couldn't test 64bit)
Change-Id: I70252594889175bf5fa0013bbaa95c6c87ca5680
2018-10-25 22:49:04 +00:00
John Reck
c2eaf48e42 Merge "Clarify createScaledBitmap's 'filter' docs" am: e0f6d84ba1
am: 324cb8c075

Change-Id: I29ff879ded8e40f73c5326bf1f929b117ede96d6
2018-10-24 15:37:38 -07:00
John Reck
a2d20b447a Add theme & View API to control force-dark
Bug: 102591313
Test: CTS android.uirendering.cts.testclasses.ForceDarkTests

Change-Id: I6ba129681aed8e2f3f1b1ac60d458bb5f5393e9b
2018-10-24 10:17:20 -07:00
John Reck
8884cfc13e Merge "Rename & package shuffle" 2018-10-23 20:02:00 +00:00
John Reck
7ba6f430f6 Clarify createScaledBitmap's 'filter' docs
Reddit complained the docs were bad, so make the docs less bad.

Test: none
Change-Id: I61928ea859af4ce0a63a9b545ea1b6dd965cc3df
2018-10-22 13:24:48 -07:00
Seigo Nonaka
9958c4ab21 Introduce FontStyle for future extensibility
This is a ground work for b/114479228
FontStyle is an argument of the font itemization. Currently Android
system uses weight and italic info for itemizing but maybe we will
use width and oblique style in future.
To be extensible in future, introduce FontStyle.

This CL includes:
- new class FontStyle which holds width and italic at this moment. In
  future, we may add width and oblique. (or grdual italic slant)
- Font class still returns weight/slant since they need to be immutable.
- Moved font weight constants from Font to FontStyle

Bug: 114479228
Test: atest CtsGraphicsTestCases
Change-Id: I0ba717fbf9f90ee6f760c1a0f6eda17b4bef6f43
2018-10-19 14:51:59 -07:00
Jeff Sharkey
047edaeaa3 Merge changes I86f597f1,I5c9c09dd
* changes:
  MediaStore deprecations for Q.
  Convenience method for obtaining thumbnails.
2018-10-19 15:21:54 +00:00
Seigo Nonaka
7b86fe573c Change add{StyleRun, ReplacementRun} to append{StyleRun, ReplacementRun}
Giving any range to the Builder is too much freedum and hard to tell
errors. Changes to accept length instead of ranges. By this change, we
can prevent and tell errors about
- The gap in the text that no Paint is assigned.
- The given range is overlapped.
- The given range exceeds the text length.

Bug: 112327179
Test: TreeHugger

Change-Id: Iefc078b1f7be2d006a65b46e0b4ea1018ecb29e7
2018-10-18 14:58:18 -07:00
Jeff Sharkey
4e5efa3186 Convenience method for obtaining thumbnails.
Obtaining a thumbnail for a Uri requires opening it with the slightly
obscure openTypedAssetFileDescriptor(), passing in "image/*" with the
right Bundle of EXTRA_SIZE to hint the target area on screen, and
defensively scaling any returned results.

This is pretty tedious to get right, so offer a convenience method
that does all this for the developer.  Internally uses ImageDecoder
to follow best-practices, and replaces older getDocumentThumbnail()
implementation by delegating to this one.

A future CL will teach ImageDecoder about how to read any embedded
EXIF thumbnails, including any required rotation.

Bug: 111268862
Test: atest FrameworksCoreTests:android.content.ContentResolverTest
Change-Id: I5c9c09ddf9b480f3b5c6ade0a078cccb68de2f2b
2018-10-18 14:32:51 -06:00
Fan Zhang
4a772fc4d2 Merge "Refactor the nativePtr validation code to a method." 2018-10-16 22:04:51 +00:00
Fan Zhang
9fe7cdf3a5 Refactor the nativePtr validation code to a method.
This will make testing much easier.

Bug: 117828816
Test: robotests
Change-Id: I1ca81e2005e559c0ec1e5f468cdd4bc0c21edbea
2018-10-16 13:30:03 -07:00
Peiyong Lin
93cd653b22 Merge "[Graphics] Align Display P3 transfer function coefficients." am: fde18facba
am: bc56d73af2

Change-Id: Ib72ca917df3a778c4ad59dc46f672b482e8b62bf
2018-10-16 11:26:55 -07:00
Peiyong Lin
bc56d73af2 Merge "[Graphics] Align Display P3 transfer function coefficients."
am: fde18facba

Change-Id: I242a8f1ccf0d2b662d745a0a956da7e7c8e3d790
2018-10-16 11:03:47 -07:00
Peiyong Lin
7a45d2c310 [Graphics] Align Display P3 transfer function coefficients.
The transfer function of Display P3 should be sRGB transfer function,
previously we defined f as 0.039, however, the sRGB transfer function defines f
as 0.04045. This patch fixes it.

BUG: 116726537
Test: Build, flash and boot

Change-Id: I247092d8ce939aa743f23a1f8688cbaf0874fb99
Merged-In: I247092d8ce939aa743f23a1f8688cbaf0874fb99
2018-10-16 16:50:25 +00:00
Peiyong Lin
dbd6e3fd88 Merge "[Graphics] Align Display P3 transfer function coefficients." 2018-10-16 16:48:46 +00:00
Peiyong Lin
f198118ba1 [Graphics] Align Display P3 transfer function coefficients.
The transfer function of Display P3 should be sRGB transfer function,
previously we defined f as 0.039, however, the sRGB transfer function defines f
as 0.04045. This patch fixes it.

BUG: 116726537
Test: Build, flash and boot

Change-Id: I247092d8ce939aa743f23a1f8688cbaf0874fb99
2018-10-15 17:06:53 -07:00
Seigo Nonaka
aa35899430 Merge "Make LineBreaker public" 2018-10-15 21:56:12 +00:00
Tobias Thierer
0d0dd506ac Merge "Remove unused imports of libcore.io.Libcore." am: 2a520365da am: abe7a32c67
am: 320e38309b

Change-Id: I2f8069235c4e8c298b0e092928a23d15cbe30520
2018-10-12 19:24:25 -07:00
Tobias Thierer
320e38309b Merge "Remove unused imports of libcore.io.Libcore." am: 2a520365da
am: abe7a32c67

Change-Id: I57d7d317f5827a54346e287db3f6f2d625e0aebc
2018-10-12 19:13:38 -07:00
Tobias Thierer
abe7a32c67 Merge "Remove unused imports of libcore.io.Libcore."
am: 2a520365da

Change-Id: I79c4679d483e0e8ea2e434237bd61d75f129da0f
2018-10-12 18:59:21 -07:00
TreeHugger Robot
c5f8fa9d81 Merge "Switch to Skia's new representation of linear gamma" 2018-10-12 15:48:25 +00:00
TreeHugger Robot
91fe37b86e Merge "Revert "Expose the ability to resolve icon as a different app"" 2018-10-12 02:56:57 +00:00
Leon Scroggins III
a95934967a Switch to Skia's new representation of linear gamma
Bug: 77276533
Test: CtsGraphicsTestCases ImageDecoderTest#testColorSpace
      ag/5244477

Although the old one works for [0,1], Skia has switched to this new
representation because it has the following nice properties:
- it extends cleanly above 1
- it's unambiguously defined

Having ColorSpace out of sync results in mismatches between those
objects underlying SkColorSpace objects when they should be the same.

Change-Id: Ie5cf223d6053718aded12b66ea58a874ce888903
2018-10-11 12:27:06 -04:00