AChoreographer will consume these callbacks in lieu of going through SF
for the callbacks. This is so that DMS can update its view of display
configs before apps receive the refresh rate callback so that apps can
get consistent information.
Bug: 154874011
Test: ChoreographerNativeTest
Test: Manually verify that HWUI is receiving callbacks
Change-Id: I992c247fd16ef414f94a259bbd300bea3e4c9467
* 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
Targets that will also be contained within the UI module
are allowed to access internal headers. All other targets
that depend on libhwui are restricted to using the APEX headers.
Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: Id92e9874dafb98bd79839d45ab8f22ab999689de
Add native thermal manager API of thermal mananger service into
libandroid. Export Thermal API as NDK library.
Bug: 137151587
Bug: 136285293
Test: build, atest thermalmanager-test atest CtsThermalTestCases
Change-Id: Ia49fb2133624ffcd6168af804ae612ef2bb190f2
Add a compatiblity param to the setFrameRate() api, so the system has
more info to decide the device frame rate when there are multiple
competing preferences.
I also changed the plumbing for setFrameRate() to go directly to surface
flinger, instead of through buffer queue. We're trying to avoid changes
to buffer queue code, to avoid disturbing the prebuilts.
Bug: 137287430
Test: Added new cts tests to verify behavior of the compatibility param.
cts-tradefed run commandAndExit cts-dev --module CtsGraphicsTestCases --test android.graphics.cts.SetFrameRateTest
Test: /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test --gtest_filter='SetFrameRateTest.*'
Change-Id: I9123afee2ba63d01ff35fb2b257a1ee0e4928ddd
Bug: 135133301
Test: AImageDecoderTest
AImageDecoderHeaderInfo_getWidth/Height return an int32_t. Ensure at
creation time that the actual image dimensions will fit in int32_t.
In today's code, this should almost never happen:
- PNGs have their dimensions limited to 1000000
- see PNG_USER_WIDTH_MAX and PNG_USER_HEIGHT_MAX in pnglibconf.h
- JPEGs are limited to 65500
- see JPEG_MAX_DIMENSION in jmorecfg.h
- WebPs' dimensions are encoded in 14 bits
- GIFs' dimensions are encoded in 16 bits
- SkBmpCodec and SkWbmpCodec require dimensions to fit in 16 bits
- SkIcoCodec uses SkBmpCodec or SkPngCodec, so their limits are
enforced
- libheif limits to a size smaller than int32_t
It might be possible for a DNG image to be larger, and some of the above
are configurable. Just in case, make AImageDecoder_create fail on such a
large image.
Change-Id: Id520dfbc0581f990c4f52cb6675e987bf71c558c
The Verified{Input/Key/Motion}Event api are the same as
{Input/Key/Motion}Event api.
The VerifiedMotion class is the same as the MotionEvent class, but
contains less information. It only contains the information that the
system is able to verify.
Same applies to VerifiedKeyEvent.
The class VerifiedInputEvent contains common information applicable to
both Key and Motion.
Test: atest VerifiedKeyEventTest VerifiedMotionEventTest
Bug: 134977432
Change-Id: I4770104eb4c025263da7efeea9c7a658dff74ac9
Bug: 135133301
Test: I5e8bdcdae6837db23c0f4ef08f931f3bebe0ce0d
Previously the default SkColorSpace for AImageDecoder was set to the
result of SkAndroidCodec::computeOutputColorSpace. If the image has a
profile that does not map to an SkColorSpace, it will return either
DISPLAY_P3 or SRGB. Using that at decode time will result in color
conversion.
Instead, default to a null SkColorSpace for such a profile, resulting in
no color conversion. If the image has no profile, default to SRGB, as
usual.
A client that wants SRGB can still request and get that, but this allows
getting the raw pixels for an advanced client that may want to do its
own conversion.
Change-Id: I489f31fef79dec11e97c8e8fb9207adb77a3d0c7
Re-add StatsLog JNI regsitration in AndroidRuntime.cpp.
This will have to be revisited once StatsLog is moved into statsd apex.
Test: m
Test: fastboot flashall
Test: adb logcat "*:E"
Change-Id: I233a527d00d524cbc2edaed7c2be76ea1c212b29
This cl creates libstats_jni, puts the android_util_StatsLog class in it
to implement the jni StatsLog.writeImpl() call, and puts the library in
the statsd apex.
Right now, it does NOT load the library properly and therefore the
library is still in the platform. It needs to be removed from the
platform.
Test: boots
Test: adb shell cmd stats print-logs shows logs still flow
Bug: 147315667
Change-Id: I0a06b66d4640d00ee75bc273423b33dafc944b05
Bug: 135133301
Test: Ibf7c0e563feeb08ce6dbabb5e86ddb385c9dff54
Remove isAnimated and update parameters/returns to match
I93df851dd9fee2eb8d097e2158fb95003a0474db.
Change-Id: Ida2af1682b5f9b91e37079005391b1594239d345
setFrameRate() is a new api in Android 11 that will enable apps to
specify their intended frame rate.
Bug: 143912624
Bug: 137287430
Test: Added a new CTS test - android.graphics.cts.SetFrameRateTest.
Change-Id: I922573c0d704e2e0ce4cfc2a462f14dce8cb7a79
Bug: 135133301
Test: No change in behavior, no new tests
Along with Id5d039761054cf8e7fb906624a277714c21156de, which does the
rename in the header, this does the rename in the impl.
Change-Id: I27244df241a8141b0fd39e02e778eef2975f4dc0
Bug: 147749998
Test: I902de3410c45a21cf27b48a02cdc5d514b7ada60
If the client uses a stride that is not pixel aligned, AImageDecoder
will crash internally trying to access the memory. Return a failure
instead of crashing. Rely on SkImageInfo to compute the minimum size
required, too.
Change-Id: Ia4d14d6209e6f4af74906ff43208fa83ac82cbcd
Bug: 135133301
Test: Iffe659e50078139188c3325545624640ae177cc2
Implement AImageDecoderHeaderInfo_getDataSpace, which reports the
default ADataSpace to decode to. It may report ADATASPACE_UNKNOWN, which
means that we've mostly left the colors in their original color profile.
This matches android.graphics.ImageDecoder/BitmapFactory, which would
use a ColorSpace named "Unknown". (It will standardize on DISPLAY_P3 for
some profiles, which again matches the Java classes.)
Implement AImageDecoder_setDataSpace, which allows specifying the
ADataSpace to decode to. It only supports explicit ADataSpaces.
Change-Id: Iba2f9e09531c23fae83ebe13cb9d18394ee3cd59
Bug: 135133301
Test: I32e9a257a63382629b25f64d1d0abe9682ddec70
Make sure the Bitmap is valid before trying to read its data space.
Change-Id: I0d075197ddc548143a4e4845cc5cc5d3b10d87c7
Bug: 135133301
Test: I2c1e58c41e49c72fb4bdbc64989da103885d34bf
_getInfo now sets a bit in AndroidBitmapInfo.flags to indicate whether
the Bitmap has Config.HARDWARE.
For a HARDWARE Bitmap, its AHardwareBuffer can now be retrieved with
AndroidBitmap_getHardwareBuffer. Call AHardwareBuffer_acquire on the
buffer so it will not be deleted while the client is using it.
Change-Id: I9240c1928c1478053ecf7c252443a33dbd6fd6db
Move ASurfaceTexture JNI implementation from libandroid to
libnativedisplay.
TextureLayer uses ASurfaceTexture_fromSurfaceTexture from
libnativedisplay instead of libandroid_runtime code.
libgui is no longer leaked through surface_texture_platform.h.
DeferredLayerUpdater uses ASurfaceTexture_release instead of
private ASurfaceTexture dtor.
Test: pass CtsUiRenderingTestCases and CtsViewTestCases
Bug: 147060713
Exempt-From-Owner-Approval: Changed only a header path in android_hardware_camera2_legacy_LegacyCameraDevice.cpp
Change-Id: I9720d9c383f8120f9db116fd2b74fc241af84396
Bug: 135133301
Test: Ifbcb41388a48afc64bb22623bb7e981b288b2457
Refactor the bulk of Bitmap_compress into hwui/Bitmap::compress, so that
it can be shared by the new API. Update its enum to match the proper
style. Also make the enum a class so it does not need to have a special
return value for a bad parameter, which is now handled by the caller.
Add ABitmap_compress, which implements the new API by calling
hwui/Bitmap::compress.
Change-Id: Ia8ba4c17b517a05b664c6e317e235836473fd7f6
Bug: 135133301
Test: I48e49ee08ab1954eddf62ecae87942aeb128c10d
As described in I3381582e27894e1072db9b8635f3762b801f5d69, this is a
more sensible API.
In addition, remove unused methods on ImageDecoder.
Lastly, update AImageDecoder methods in the map to document which API
level they were introduced in.
Change-Id: I1aff544e8d6932b9ed0931a00da66a0aba6cd536
Bug: 135133301
Test: I2ea58bede5cf49a7947c96e7e6e37f967632ad6b
BAD_PARAMETER is a more sensible value than -1. The other return will
not be reached, but the code is clearer.
Change-Id: I4bee8f238f61a6c6cd13b5458f201f34d34315d9
Originally reviewed in Ie05a45da32b2fd670abdae35626cd6548cfb102c
(and reverted in I0b06312f6583f766512cc771a35d3d735debcce1)
Bug: 135133301
Test: I7a5fcb726fba0c832bbb86a424d7534a7cfa35b6
This supplements AndroidBitmap_getInfo, allowing NDK clients to know how
to interpret the colors in an android.graphics.Bitmap.
Only build android_bitmap.cpp on Android so that it can rely on
libnativewindow (which is Android-only) for data_space.h
Change-Id: I4b23c68c7e62ed733e95af6f76c47fecbc2c5747
Bug: 135133301
Test: Ib84462ea5fa8a7779eaa44494775e182e52ecaca
Separate out the code for encodedFormatToString into a piece which
returns a const char* that can be used by AImageDecoder (with its own
header) and the part that the JNI code uses to convert that into a Java
String.
Change-Id: I4cf8bfb0aacfb8e22c3f9b1689bd614ed1253673
This was actually added in M, but because it wasn't in the version map
(and there's no CTS test) it's not actually reliably available until
next year...
Bug: https://issuetracker.google.com/146458518
Change-Id: I5eed970118b627c7e74800f04751a07ce64d86da