Bug: 150395371
Test: make
This method is being replaced by
Bitmap#wrapHardwareBuffer(HardwareBuffer) as part of the switch to a
mainline module.
With I41cb03fb65432d208820a428783de82a9f152035, there are no more
callers of this overload.
Change-Id: Ia837d6c4019d1e8495829b606fe62a68d557119a
Bug: 150395371
Test: make && flashall
Bitmap is replacing methods that use a hidden GraphicBuffer with ones
that use the public HardwareBuffer. ScreenshotGraphicBuffer is just a
holder for GraphicBuffer and some metadata; switch it to hold a
HardwareBuffer (and rename to match).
Remove GraphicBuffer#createFromExisting, which was only called by
ScreenshotGraphicBuffer#createFromNative. Also remove JNI references to
that method, which were no longer in use.
Switch uses of GraphicBuffer that retrieve it from a
ScreenshotGraphicBuffer to HardwareBuffer.
Changes are almost entirely mechanical:
- (Screenshot)GraphicBuffer -> (Screenshot)HardwareBuffer
- GraphicBuffer#destroy -> HardwareBuffer#close
- getGraphicBuffer -> getHardwareBuffer
When creating a Snapshot in SurfaceFreezer, use the ColorSpace of the
ScreenshotHardwareBuffer.
Remove GraphicBuffer#createFromExisting. This is no longer necessary,
and although it was marked UnsupportedAppUsage, go/nonsdk-dash shows no
usage.
Change-Id: I41cb03fb65432d208820a428783de82a9f152035
Test: make
This method is marked as UnsupportedAppUsage, but that was for the
signature prior to I0bf8c4c72cc118d2799a59e8eb6c2cede546fceb (which has
not been released). This was a false positive, anyway. No app should be
using this while there is an almost identical public method.
Change-Id: Ib71a58be6ec72cd4c52e8fca3c2cd4055df55ecf
Bug: 150395371
Test: make
This became BitmapRegionDecoder in
I3e60c7fe4abd0289e1384e69a08fd20fe6fb0e10, but we forgot to delete the
Java file. It's been unused since then.
Change-Id: Ibe4e813d448346c9b15d4e112a2062713321edc9
Bug: 148155907
Bug: 150395371
Test: I652101b6a4b3d9de4e77a316ba0436ce466f3620
Bitmap already has a method to create a Bitmap from a HardwareBuffer,
and the NDK allows doing the reverse. This updates the SDK to allow
retrieving the HardwareBuffer, too.
Update the docs to match wrapHardwareBuffer regarding modifications.
Throw an Exception if called on a non-HARDWARE Bitmap, which is
friendlier than the crash that previously happened on the hidden API
(and the one it replaced).
Change-Id: I408cff708efa76f89e0c4c6dae16f19166ffe74d
Bug: 140600285
Test: CtsGraphicsTestCases:android.graphics.cts.BitmapRegionDecoderTest
Test: I684e0ed6049e146e2c1698383c73709a7163b642
Clean up BRD in preparation for mainline module changes.
isShareable has been ignored for a long time, so update the APIs to
reflect that. Deprecate the existing ones, and add replacements without
isShareable. Make newInstance(FileDescriptor, boolean) into
newInstance(ParcelFileDescriptor), as recommended by the build failure.
- newInstance(byte[], int, int, boolean) has ignored it since
I7dd545c9d52d21c226e11b8921e35a1d9bba9515 (GB)
- newInstance(FileDescriptor, boolean) has ignored it since
Id1e1c8c5938ee1a33c6fa3caabd2c28e89243eb4 (KITKAT)
- newInstance(InputStream, boolean) and newInstance(String, boolean)
have always ignored it
Document WebP and HEIF support.
Add @NonNull annotations. Remove misleading comments about
returning null on failure. My understanding is that if it either returns
an object or throws an Exception, @NonNull is the appropriate
annotation - the client does not need to check for null.
Change-Id: I0bf8c4c72cc118d2799a59e8eb6c2cede546fceb
Bug: 150395371
Test: make
- Mark mDensity as package-protected, since it is not used elsewhere.
- Document getNativeInstance, getOpticalInsets, getNinePatchInsets,
and scaleFromDensity - where they are called, and that they should not
be called from outside the module.
- Mark setImmutable as private. No outside callers use it.
Change-Id: I85efe4829e2914222696aa659f8a21b699c3d788
Bug: 63136392
Bug: 150395371
Test: make
This reverts commit 1480b67635.
Bitmap moving into a new mainline module in S. These module-boundary-
crossing hidden APIs need to be either made official or removed.
We already got the information we need from this logging, so remove it
and the hidden APIs. If/when we need to investigate this in the future,
we should be able to recreate the logging without crossing the boundary.
Change-Id: I5d094a0e427d225719614745867d5b00888d8fec
Previous attempts to do this ignored the offset that the
AssetFileDescriptor may have.
Bug: 149927583
Test: CtsTextTestCases and androidx.appcompat.widget.AppCompatTextViewTest
Change-Id: Idcc8cb83a7f265cfa12707b7ce643b35f7f72352
The logic to attempt to directly mmap uncompressed font assets
has resulted in breakages for some applications and utilities.
This CL disables this speculative optimzation until we can determine
the problem with this approach and if such an optimization is required.
Bug: 149780695
Test: CtsTextTestCases and androidx.appcompat.widget.AppCompatTextViewTest
Change-Id: I3b10a801a5600aefe8573fab1b28cd79c848c892
* changes:
Export symbols for the newly exposed APEX/internal headers
Remove dependence on libandroid_runtime from Bitmap.cpp
Update Region.cpp to use AParcel NDK APIs
Cleanup header and build targets for libhwui clients.
Remove dependencies on headers outside UI module
Cleanup LOG_TAG when bundled in HWUI
Move android.graphics JNI & APEX files into HWUI
The end goal is to have Bitmap.cpp use AParcel, but until that
API is extended to support this use case this is an alternative
way to isolate the graphics files from the libandroid_runtime.
Test: CtsGraphicsTestCases
Bug: 145227478
Change-Id: Ie3854fe03dec4f7b1b485295bb9a5ebba52ddb7c
Bug: 148155907
Bug: 135299581
Test: TODO
Hidden for now. We'd like to make it an SDK API eventually
(b/148155907).
Internal code is currently calling createGraphicBufferHandle. This is
not something we plan to expose from the UI rendering module, so add a
method to get a HardwareBuffer instead. This is something we were
already planning to add. It seems that clients of
createGraphicBufferHandle really wanted a Parcelable to pass the
HARDWARE Bitmap to another thread. This should satisfy that use case.
Change-Id: Id701f7c7eab37830cd7d2cdb929cbe6ba4eca119
A wrapper still exists at android.view.RenderNode animator
as it needs access to internals of the view that would violate
the package layering if moved into android.graphics.animation.
This CL also moves the Java and cpp files associated with creating
a native interpolator that can be run directly on the RenderThread.
Bug: 149293249
Test: CtsViewTestCases
Change-Id: I5260331fedbd634cf2f6d6d392941e7284527420
The Font/FontFamily classes use private API calls in native
code to get the contents of an Asset. These calls need to
be made on public APIs in order to isolate the graphics module
from the rest of the system. Public Java APIs already exist so
this CL refactors the code to use those methods.
Test: CtsTextTestCases
Bug: 147136234
Change-Id: I35a6558b597684e59279d7a841669c5f909d5152
Move GraphicsStatsService to android.graphics package.
Move GraphicsStatsService JNI from libservices.core to
libandroid_runtime.
Declare GraphicsStatsService ctor as the only @SystemApi.
Remove MemoryFile usage from GraphicsStatsService, but use
SharedMemory and other SDK APIs instead. This is done to
avoid using unstable API MemoryFile.getFileDescriptor.
Propose new SharedMemory.getFdDup API for next release, which
is hidden for now.
Refactor statsd puller to avoid proto serialization by moving
data directly into AStatsEventList.
"libprotoutil" is added as a static dependancy to libhwui, which
should be fine because its implementation does not link anything.
Bug: 146353313
Test: Ran "adb shell cmd stats pull-source 10068"
Test: Passed unit tests and GraphicsStatsValidationTest CTS
Change-Id: If16c5addbd519cba33e03bd84ac312595032e0e1
Previously we didn't assign a colorspace to the pipeline until it
was provided a surface to render into. This resulted in undefined
behavior if the application attempted to render an offscreen layer
before the OS provided the main window with its surface. Now instead
of deferring setting whether or not the application is wide gamut we
do initialize it to a default setting when the pipeline is created.
Bug: 148042673
Test: apct/device_boot_health_check_extra_postsubmit
Change-Id: I84d743511e949ac977486470bb14eec936de7f88
Bug: 148544953
Test: No change in behavior, no new tests
setConvexPath no longer requires that the Path be Convex, so deprecate
the method and replace it with a name that does not imply it must be
Convex.
Update internal references to the Path being Convex as well.
Change-Id: I8935dc8ac7f7fb7db0d667e35fda67afdf2e6ac8
Make all received bitmaps immutable as this
improves re-use for subsequent transfers.
Remove minimum size to stay on ashmem, as
Parcel's writeBlob already has similar logic.
This effectively reduces the minimum size to 16kB.
Bug: 148301859
Test: device booted, a notification showed up
Change-Id: I2fafb0989944c0ef82de6edcb4924056a592cf66
Bug: 129694386
Test: No change in behavior, no new tests
EdgeType is only used as a parameter to quickReject, but it is always
ignored. Deprecate it and the existing quickReject methods. Add new
versions of quickReject without EdgeType parameters. Switch clients to
the new versions.
Change-Id: Id932f10915a8c4959fe0e85f507ce7fd2da8a576
Bug: 133807397
Test: No change in behavior, no new tests
isConvex is unreliable. We may change how we compute it from release to
release, and it could change based on various factors like a rotation.
Change-Id: Ib76246fc24f09bd13cf63b4b96b56afa613d0bc9
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.
Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I8ffa1da1bcd43c25f4ff817575db77a33c0f3d31
The old API was a shim over the new API, and will be deleted soon.
The new API is actually public, simpler, and more powerful.
Test: Everything still builds.
Change-Id: I11af8da9132e23a070e87dd5a7401c4854dd102a
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.
Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I4bc8c9482e4bb1af21363f951affff7ee3fefeab
Introduce HardwareRendererObserver to isolate the android.graphics
package from the android.view package. The native code that
interacts with the observer was also moved from libandroid_runtime to
libandroid_graphics to keep it within the confines of the UI Rendering
module.
Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: Ibccecbeda0c4d9501d86514a53eb98548233ba6a
Bug: 135133301
Test: Idf64474f28c0bf3f77616a31d843d84fbfd570ab
If the specified crop Rect is empty or unsorted, throw an
IllegalStateException, like we do if the Rect does not fit in the target
size.
This is a change in behavior to make it more consistent. Here are the
specific behavior changes:
- an empty crop rect was previously supported in all cases, but would
result in a zero width and/or height Bitmap/Drawable. If one
dimension is non-zero, it still affects layout, though nothing is
drawn. This is not useful, so the new Exception is more helpful. (It
is also more consistent with setTargetSize, which throws an
IllegalArgumentException for non-positive dimensions.)
- a negative width or height in decodeBitmap, or on a static image in
decodeDrawable, previously threw an IOException when trying to call
SkBitmap::setInfo with a negative width or height. Throwing an
IllegalStateException is more consistent with other invalid crop rects
- a negative width or height in decodeDrawable on an animated image
previously resulted in an AnimatedImageDrawable with a negative
intrinsic width and/or height. When passed to an ImageView, this
dimension ends up being 1. Again, this does not seem useful.
Change-Id: I15d2f77125799413eaf55d417e98ff34599e2eb4
We want to eventually migrate some of these APIs to be @SystemApi for mainline modules.
The #dumpDebug name is more appropriate than #writeToProto.
Bug: 142279786
Test: Manual
Change-Id: I60793e91cedf6b720d4ecef6a8484f4fed4ff30f