Bug: 73529437
Test: No change in behavior, no new tests
Document that it can be inflated from xml, and reference the attributes
that it supports.
Add a comment describing what the class does with respect to animation.
Update the comment for start() to better reflect when the callback is
called.
Change-Id: I660cbc4e185dca8bc7a43a185f91ae0485ef8753
Copies language from <android/surface_texture.h> that connects
EGL/Vulkan presentation timestamps to SurfaceTexture#getTimestamp.
In the process, reorganized the existing language to talk about
general properties of the timestamp, and then talk about behavior of
specific producers instead of mixing them together.
Bug: 72755997
Test: make docs
Change-Id: I88253f9e23df7d7c4fe3c1c51ff2ac494da1913c
Bug: 73788969
Test: I501e8b76aacd785cb994165ab01dc1b39fea3a1c
Move them into ImageDecoder.DecodeException, which is where they are
actually used. This also provides some more context, so that the prefix
"ERROR_" is no longer necessary, fixing the redundancy/awkwardness in
ERROR_SOURCE_ERROR. Further rename that to SOURCE_MALFORMED_DATA, which
is more descriptive, and does not imply a Java Error.
Change-Id: Ied17ad343650f9c33d9a35b0f9d00ccc22264bd6
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: 73788969
Test: If9e27a6ce2604128a619bc4843d62711f94b4d87
Add a new Exception subclass that contains information about the type of
error, and the original Exception, if any. Remove the old
IncompleteException class. If the decode creates a partial image, pass
the information up to Java, where we create the new Exception and pass
it to the callback and/or throw it. Rewrite nDecodeBitmap to always take
the ImageDecoder as a parameter for this callback, and simply use a
boolean to determine whether to call onPostProcess
Check for exceptions in some overlooked cases in native code, and
route to the new type.
Remove FIXME to avoid parsing the whole image. In my limited testing,
it didn't seem to speed anything up, and this should be called in a
background thread anyway. Parsing now also ensures that we've read the
stream when we can have a chance to handle the exception from the right
place.
Remove fixme for b/70626068, which has been marked as WontFix.
Add a TestApi for testing an Exception thrown by an InputStream.
Remove onPartialImage from hiddenapi-light-greylist.txt to fix the build
error this change introduces. onPartialImage was erroneously added to
the list.
Change-Id: I12f69857328e63c993bd669412b06addeb6a74f1
Bug: 73641604
Test: infeasible
Fix nNativeByteSize's return value to be jlong, instead of long.
Add up the bytes used by the SkAnimatedImage and SkPictures and store
them on the AnimatedImageDrawable for registration.
Note that this is an approximation, and it assumes it will be drawn to a
hardware canvas and animated.
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