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
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
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
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
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
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
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
This reverts commit 4236ccb7c4.
Bug: 116798569
Reason for revert: This API is not needed as system-API
Change-Id: I90140a55a50067f1aa98d9649dfb97ffb45f03a4
This CL includes:
- Move NativeLineBreaker/NativeMeasuredParagraph to android.graphics.text
package since these two uses the shaping result of the text which is a
part of graphics responsibility. At the same time, by this moving,
minikin is only used by android.graphics package.
- Rename NativeLineBreaker/NativeMeasuredParagraph to
LineBreaker/MeasuredText.
- Updated comments of the break strategy and hyphenation frequency.
Bug: 112327179
Test: atest CtsTextTestCases CtsGraphicsTestCases CtsWidgetTestCases
Change-Id: Id69c328e7c9097b9fc11b5c0bd04d1c2e0939c6a
ContentResolver.openTypedAssetFileDescriptor() has support for a
Bundle of options that can be used to communicate things like desired
thumbnail size, and also CancellationSignal to cancel large network
fetches when no longer needed.
Instead of adding all these to ImageDecoder, let developers provide
their own Callable<AssetFileDescriptor> so they can implement these
custom features.
Bug: 111268862
Test: atest cts/tests/tests/graphics/src/android/graphics/cts/ImageDecoderTest.java
Change-Id: I51c509962f50dd08be94507169355b5da54d6782
Exposed Skia's underlying drawDRRect method used to draw a double
rounded rectangle
Bug: 117181396
Test: Added test case to verify Canvas#drawDRRect and re-ran CanvasTests
Change-Id: I4e1954c8ffc82811dc541488d1df9b37309faf51
Add the relevant methods to read from ProtoInputStream to
various classes.
Also add some framework to handle version changes in
UsageStatsDatabase. There is some risk of users losing all their current
UsageStats data, if something goes horribly wrong. The debug flag and a
keep backup files flag are temporarily set in UsageStatsDatabase with
this change. They will both be unset in the future before the Q release.
Some rough number on the impact of this change:
Proto file size on disk reduces to ~47% of XML file size :)
Proto file read time reduces to ~55% of XML file read :)
Proto file write time increases ~17% over the XML file write :(
There will be a follow up CL to address the file write time regression
Bug: 111422946
Fixes: 111449927
Test: atest UsageStatsDatabaseTest
Change-Id: I084aea796ed2163c42947d52396a36cc7c5562a2
As the initial version of the OEM customization XML, support
new-named-family customization. This allows OEMs to add new named
family.
Bug: 111544833
Test: atest FrameworksCoreTests:android.graphics
Change-Id: If58711fc038898175fcad0ae095865312bd738e2
Typeface.buildSystemFallback was kept only because it was used in
layoutlib. Change I33f27f62 (commit a65f963) removed that last use case,
so this now deletes the unused method.
Bug: 112196940
Test: atest FrameworksCoreTests:TypefaceTest
Change-Id: I19b793d34c1ce16d5dc7430c08746261cd52b4b2