Bug: 76144110
Test: I95165583649a1df86782d3684f7bf9bcd8dab7bd
This matches the behavior of DisplayListCanvas. Not scaling means that
we can draw a Bitmap to a Picture, and then play that back in HW mode
and see the same result.
Change-Id: I7421431bad0531112e06ab5c14814b6b6f1591d9
Bug: 74061412
Bug: 73893665
Test: Manual, I5669a97c70d726826c5c00bc1413c2f97d95d88c
ImageDecoder typically does not scale a Bitmap up to handle density.
This saves memory, and we already handle the density by scaling at
draw time. But some apps rely on the size of the Bitmap without taking
density into account. For backwards compatibility, on apps that are
built for a pre-P version of Android, scale up in ImageDecoder.
Change-Id: I9991d1286e386b47fc57bcfbf0c6652beb1a53ef
Bug: 74545298
Test: I6a633553bbb5ff26d84aaf5371b8b43a770afd4f
This allows using ImageDecoder to decode a file in the "assets"
directory of an app.
Change-Id: I2193f052cc2e16c55c7f68f7e51e07cd24ee4df9
Bug: 74545298
Test: Ibc283c2e8aee999e951de51f3a43b581a765aaf5
Although resources can already be accessed with ContentResolver + URI,
this allows a simple method to do the same.
Change-Id: I1bf698f36d5540f6de7cb9957e4223123d0f4331
This CL documents the byte order for 585, 8888, and fp16 buffers.
Test: documenting existing behavior
Bug: 71518511
Change-Id: I128344db318eb4597b6eb00f0ae317e369145152
Bug: 74408046
Test: Ic6acdc4a1a16840ec6ad9b13b4926c643d0f81ae
Skia incorrectly sets the gamma for LINEAR_EXTENDED_SRGB to 0 as a
misguided optimization attempt. As a result, a HARDWARE Bitmap which
natively has this color space does not match it properly. (Note that we
already catch an F16 Bitmap, above.) Add a workaround in
Bitmap.getColorSpace() to check for the color space explicitly.
Change-Id: Id595e365d1c8d572cfcea214d230a8ce1decdc01
The method signature of the createFromFamiliesWithDefault is changed
for supporting multiple font fallback. The old method is used by
supportlib-v27.
Bug: 73981003
Test: Manually done
Change-Id: I45ee9975b0f15481b60362113b89d4a1bf5a5338
Bug: 73788928
Test: I1606cbb4e71579160ffaef12c1ed738fad882cd1
This will allow Kotlin developers to treat the setters as properties.
Part of the motivation for the rename is that "getAsAlphaMask" sounds
like it returns an alpha mask itself. Rename both to
_etDecodeAsAlphaMask.
Change-Id: I8f9b04f8381840490b662c3bcd37a95442af8110
Bug: 73529437
Test: I27af7c3b2e08fa50bc19e08930d970931ce4b5e9
If isAutoMirrored, and the layout direction is RTL, make
AnimatedImageDrawable draw flipped.
Change-Id: I9a3436ef4cb9df2845a67663a2503c2c1a3dba89
Bug: 73529437
Test: I60fbee6d3610070413e8c46f363ec3c19c2e7c52
Allow setting AnimatedImageDrawable's loop count in xml. Use
"repeatCount" to match the existing attr used by other objects, and
change the Java api from "loop" to "repeat".
Cache the repeat count in the State object for the situation where we
inflate but are waiting on a theme, so that when we get a src we can
apply the existing repeat count.
Change-Id: Ie723fe9a40c64dd0e1e8fd7b5d5cf81e5c5ccd0d
Bug: 73788928
Test: No change in behavior; no new tests.
There is already an overload for both decodeDrawable and decodeBitmap
that allows not using an OnHeaderDecodedListener, so require calls to
the method that includes a parameter for it to contain a non-null
version.
Throw an exception if OnHeaderDecodedListener is null. Move
implementation to Impl methods to share code without lint warnings.
Rename the non-static decodeBitmap to decodeBitmapInternal, to
distinguish it from the others.
Change-Id: I12c0a35786d8d1267044ac09b5c9203cdfb7175a
Note that AppCompatTextView doesn't work well with this attribute since
it overwrites the selected Typeface.
Bug: 63135308
Test: atest android.widget.cts.TextViewFontWeightTest
Change-Id: I76ee5e3007ea5f96249d2a0bfb66ff5975c62522
Bug: 73788928
Test: No change in behavior; no new tests
This will allow the generated JavaDocs to include these in setAllocator.
Change-Id: Icd109ddf45e8809da1a0980924a6f4feccefcac2
Bug: 73788928
Test: I7d5082ba7319c6c069dde5d0efb22af6e92dd243
This way the input's position is unaffected. Update the docs to reflect
the new behavior.
Change-Id: I7212948ee289ea8da1be9fe81d3f4bc9296e3e61
Bug: 73529437
Test: I7907f5dd7eb8d4ab72b8e9ddcbcbfc7aa8cb05ae
Support AutoMirroring, from inflation and setting manually.
Ensure that AnimatedImageDrawable always has a State object, even if
it has no mNativePtr. If it has no mNativePtr, throw an Exception when
trying to use it.
Require that inflation have a valid src, unless it is waiting on a theme
(like BitmapDrawable).
Change-Id: I5b22cdbf4b57862d6ccc5750a677168287860f9f
Bug: 27847286
Test: none
Now that we have a framework replacement, deprecate this little-used
class.
Change-Id: Iedec214c7eb729ccb77d2b4818971393938b2295
This is 2nd attempt of I7db9e2ca4db68a16648cfb8fcf63555f501304c2
This CL changes the MeasuredText API:
- Rename MeasuredText to PrecomputedText.
- Introduce PrecomputedText.Param which holds all text layout parameters.
- Add API to get PrecomputedText.Param from TextView.
- Remove MeasuredText.Builder and add PrecomputedText.create method instead.
- Remove setRange from MeasuredText since it is not for normal use case.
(It can not be used for TextView)
Bug: 67504091
Bug: 72861572
Test: bit FrameworksCoreTests:android.text.
Test: atest CtsWidgetTestCases:EditTextTest \
CtsWidgetTestCases:TextViewFadingEdgeTest \
FrameworksCoreTests:TextViewFallbackLineSpacingTest \
FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \
CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest \
CtsTextTestCases
Change-Id: Ie73bce52c6c673cda58973ddad04627a7cf2e5e9