summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2 daysMerge "Add support for Surface.lockCanvas and Surface.unlockCanvasAndPost" ↵android12-hostruntime-devMichael Hoisie
into android12-hostruntime-dev
2 daysAdd support for Surface.lockCanvas and Surface.unlockCanvasAndPostMichael Hoisie
The underlying functionality was ifdef'd out, but it compiles fine on host. Test: ShadowNativeSurfaceTest in Google3 Bug: 344979295 Change-Id: Ieca45f62a7e0b7c72c8c55213e669f5bd2f26b46
2 daysMerge "Update additional hwui files to match sc-layoutlib-native" into ↵Michael Hoisie
android12-hostruntime-dev
2 daysMerge "Fix various hwui compile errors when building with Android toolchain" ↵Michael Hoisie
into android12-hostruntime-dev
2 daysFix various hwui compile errors when building with Android toolchainMichael Hoisie
Attempting to run `m libhwui` causes compile errors in the android12-hostruntime-dev repo. This is because hwui has been modified primarily to enhance host graphics, but as a result trying to build it using the Android toolchain causes compile errors. Update libhwui to fix various compile errors so it's possible to run `m libhwui`. Test: m libhwui Bug: 344979295 Change-Id: I74a7d09e2f7dd8249c8e6e692e6783cfb70bc6f8
3 daysUpdate additional hwui files to match sc-layoutlib-nativeMichael Hoisie
Summary: * CanvasContext.cpp - This was not merged correctly when the initial HW rendering patches were applied from sc-layoutlib-native. This causes compile errors when `m libhwui` is done, which causes hwui to also be built using the standard Android toolchain. * RootRenderNode.cpp/RenderThread.h - Used for RenderNode animation logic * android_canvas.cpp - this is needed for Surface.lockCanvas and Surface.unlockCanvasAndPost * android_bitmap.cpp - appears to be unused by RNG, but added for consistency with android_canvas. * android_graphics_HardwareRenderer - enable RenderNode animation logic. Test: m libhwui Bug: 344979295 Change-Id: If52fe2a46839a5231356066e82cc6bd0baa9ee8b
3 daysMerge "Add support for ImageReader and HardwareRenderer.syncAndDrawFrame in ↵Michael Hoisie
Q and R" into android12-hostruntime-dev
3 daysAdd support for ImageReader and HardwareRenderer.syncAndDrawFrame in QMichael Hoisie
and R Previously, native ImageReader was not used below Android S due to the non-existence of `ImageReader$ImagePlane`. Add an API level check to the ImageReader ImageReader binding logic to support Q and R. Test: ShadowNativeHardwareRendererTest Test: ShadowNativeImageReaderTest Test: HardwareAcceleratedActivityRenderTest Bug: 344979295 Change-Id: I949382eb17db983d4c486e5c065ed0bdbf5d59eb
2024-05-03Merge "Use kN32_SkColorType when creating the buffer for SkiaHostPipeline" ↵Michael Hoisie
into android12-hostruntime-dev
2024-05-03Use kN32_SkColorType when creating the buffer for SkiaHostPipelineMichael Hoisie
kN32_SkColorType is determined at compile-time using a macro that checks the current architectiure. On Mac, this value is different than Linux or Windows. As a result, when HW rendering occurs on a Mac, the blue and red pixels are swapped, which implies one is using kRGBA_8888_SkColorType and the other is using kBGRA_8888_SkColorType. When an Android Bitmap object is initialized using Bitmap.Config.ARGB_8888, it uses kN32_SkColorType Update SkiaHostPipeline to use kN32_SkColorType so the value is consistent with what Bitmap uses. Test: HardwareAcceleratedActivityRenderTest on Mac Test: ShadowNativeHardwareRendererTest on Mac Bug: 338399395 Change-Id: Ic037fea16abcbf950d69daafadbf91fb9c6653a6
2024-04-12Merge "Use "C" numeric locale for consistency in strtof" into ↵Treehugger Robot
android12-hostruntime-dev
2024-04-12Use "C" numeric locale for consistency in strtofMichael Hoisie
In Android, strtof is used in places such as PathParser to parse floats in path expressions in drawables, i.e. "C0.2,0 0.1,1 0.5, 1 L 1,1". In certain locales (e.g. Germany), commas are interpreted as part of numbers, so this is not parsed correctly. Use the minimal "C" numeric locale to ensure consistency when doing strtof and other floating point parsing operations. This is also done in LayoutlibLoader. Bug: 334093536 Test: ShadowNativePathParserTest in Google3 Change-Id: I21e7115240045ebf065362a6e28f6af710509a13
2024-03-18Merge "Enable AnimatedImageDrawable for Mac and Windows" into ↵Michael Hoisie
android12-hostruntime-dev
2024-03-18Merge "Add support for sqlite JNI in Windows" into android12-hostruntime-devMichael Hoisie
2024-03-15Enable AnimatedImageDrawable for Mac and WindowsMichael Hoisie
This allows AnimatedImageDrawables to be rendered on Mac and Windows. Also, disable the AnimatedEndListener mechanism on host. It requires native Looper, which is not available on host. Bug: 329895268 Bug: 274171734 Test: ShadowNativeAnimatedImageDrawableTest on Windows Change-Id: I38b67e6f0e4f00bd288469659265bb78eea7001b
2024-03-15Add support for sqlite JNI in WindowsMichael Hoisie
Update logic in CursorWindow.cpp and android_database_SQLiteConnection.cpp to use libbase's MappedFile, which is supported on all platforms, including Windows. Also ifdef out the Parcel support in CursorWindow, since native Parcel is not supported in RNR. Bug: 317884162 Test: ctesque SQLiteDatabaseTest on Windows Change-Id: I138064847f0afcd264c591bd8d04ed4f4b48362c
2024-03-04Merge "Backport most recent LayoutLib ICU loading logic" into ↵Michael Hoisie
android12-hostruntime-dev
2024-03-01Backport most recent LayoutLib ICU loading logicMichael Hoisie
This allows the ICU system properties to be consistent with the latest version of LayoutLib. Test: nativegraphics integration tests in Google3 Change-Id: I894b9b794a811a53a14462faf665d871bd423730
2024-01-31Merge "Remove unnecessary JNI lookups in RenderNode JNI" into ↵Michael Hoisie
android12-hostruntime-dev
2024-01-31Merge "Add nativeCopyColorSpace from Android O through P" into ↵Michael Hoisie
android12-hostruntime-dev
2024-01-31Add nativeCopyColorSpace from Android O through PMichael Hoisie
This logic was used in Android O through P when copying Bitmaps and then removed in Q. Add the logic back for better backwards compatibility with O through P. Bug: 321811781 Test: m robolectric_native_runtime dist Change-Id: I6cbc490613cd242deb7b0849c1cb23c33d8cae45
2024-01-31Merge "Change the system property used for the ICU default language tag" ↵Michael Hoisie
into android12-hostruntime-dev
2024-01-31Change the system property used for the ICU default language tagMichael Hoisie
Change the system property from 'robolectric.nativeruntime.languageTag' to 'icu.locale.default'. The latter is what has been upstreamed to the LayoutLib main branch. Bug: 321740537 Test: m robolectric_native_runtime dist Change-Id: I7c0ffffe9f8deefc3027b8105f0a58501bf01042
2024-01-12Merge "Strip RNG libraries" into android12-hostruntime-devMichael Hoisie
2024-01-12Strip RNG librariesMichael Hoisie
This results in significant file size reductions: * librobolectric-nativeruntime.so: 118MiB -> 16MiB * librobolectric-nativeruntime.dll: 162MiB -> 13MiB Test: m robolectric_native_runtime dist Change-Id: Ida323dca4404ed674d706c71c16c393a39191450
2024-01-08Merge "[RNG] Bitmap::allocateHardwareBitmap() must copy source content." ↵Raphaël Moll
into android12-hostruntime-dev
2024-01-08[RNG] Bitmap::allocateHardwareBitmap() must copy source content.Raphael Moll
The RNG version of Bitmap::allocateHardwareBitmap() is implemented on top of Bitmap::allocateHeapBitmap(). However, per the class comment description, this factory method should also copy the content of the source bitmap into the newly allocated bitmap. Bug: 310222823,242670053 Test: m -j robolectric_native_runtime dist Change-Id: Ib657fd33b7862411977832da14ce39ec8b22812e
2023-12-29Merge "Enable BitmapFactory.nativeDecodeFileDescriptor on Windows" into ↵Michael Hoisie
android12-hostruntime-dev
2023-12-29Enable BitmapFactory.nativeDecodeFileDescriptor on WindowsMichael Hoisie
The Windows DuplicateHandle API can be used in place of fcntl with F_DUPFD_CLOEXEC Also add Windows variants of isSeekable and AutoFdSeek to hwui JNI utils. Test: BitmapFactory decodeFileDescriptor* tests on Windows Bug: 317994636 Change-Id: Ie6448a22df6c9c300f38af0b4685040787832d5b
2023-12-27Merge "Fix apex build error for libhwui" into android12-hostruntime-devMichael Hoisie
2023-12-27Fix apex build error for libhwuiMichael Hoisie
In a previous CL, the 'libnativehelper_lazy' dependency was switched to libnativehelper. This caused an apex_available platform error because 'libnativehelper' is not available for the platform apex. Switch it back to libnativehelper_lazy. Bug: 317896089 Test: m robolectric_native_runtime dist Change-Id: I187a065d2c2a9325f45fb3dfd311fca8ef4c4696
2023-12-27Merge "Enable host Windows build for librobolectric-nativeruntime" into ↵Michael Hoisie
android12-hostruntime-dev
2023-12-22Enable host Windows build for librobolectric-nativeruntimeMichael Hoisie
Currently SQLite JNI is disabled for Windows because both androidfw/CursorWindow.cpp as well as the SQLite JNI registration logic requires mmap ashmem. Supporting this is feasible but will be done in a separate CL. Note that some functionality still does not work 100% in Windows, such as BitmapFactory.decodeStream and some font-related methods. These will be resolved separately. Test: m robolectric_native_runtime dist Test: Robolectric ShadowNativeMatrixTest Change-Id: Ie932ddec1298597bc3f6051574bc9dcc82b38929
2023-12-14Merge "Backport "Enable path clipping for View outlines"" into ↵Raphaël Moll
android12-hostruntime-dev
2023-12-14Backport "Enable path clipping for View outlines"Raphael Moll
Original change, author, and description: Change-Id: I83466bc54bcea0d7a397c24d519bcba620231adb --- https://android.googlesource.com/platform/frameworks/base/+/33c1ea73e869e68b793ae9a21c2d8ea41e9f1c9a Chet Haase Clipping Views to Outlines has existed for several releases, as has providing a Path for shaping Oulines. However, using a Path-shaped Outline to clip a View against was specifically disabled internally, due to historical functionality limitations (prior to enabling Skia for HWUI rendering) as well as performance concerns. On current (even relatively low-end) hardware, path clipping is now sufficiently performant that we are enabling this functionality. This functionality will be used by AndroidX APIs that enable easier shaping via paths. --- Only the native libs/hwui changes have been backported. Bug: 315048748 Test: m -j robolectric_native_runtime dist Change-Id: I4129d0bf7239a0e1e9e82c9f526d052d1102ce17
2023-12-14Merge "Implement AnimatorManager::forceEndAnimators" into ↵Michael Hoisie
android12-hostruntime-dev
2023-12-14Implement AnimatorManager::forceEndAnimatorsMichael Hoisie
This fixes a build break. It was not added in aosp/2874695. Test: m robolectric_native_runtime dist Change-Id: I5602aa4bce64fece66fdcd617573afde56511b4b
2023-12-14Merge "Backport android_view_RenderNode_forceEndAnimators" into ↵Michael Hoisie
android12-hostruntime-dev
2023-12-13Backport android_view_RenderNode_forceEndAnimatorsMichael Hoisie
This method was added in Android T, but it it trivial to backport to RNG's Android S native code. Test: ShadowNativeHardwareRendererTest Change-Id: I9729ee95b4e373abbab59a9a2ec5052c6d485e5e
2023-12-06Merge "Change the system property used for ICU data" into ↵Michael Hoisie
android12-hostruntime-dev
2023-12-06Change the system property used for ICU dataMichael Hoisie
Change the system property from `icu.dir` to `icu.data.path`. This is to be more consistent with the recent versions of LayoutLib, which uses `icu.data.path`. Test: m robolectric_native_runtime dist Change-Id: I31b57dc911fe3dfdd1ffed9abda5c28f821f9810
2023-11-22Merge "[RNG] Merge ifdef support layers from sc-layoutlib-native." into ↵Raphaël Moll
android12-hostruntime-dev
2023-11-22[RNG] Merge ifdef support layers from sc-layoutlib-native.Raphael Moll
Test: m -j robolectric_native_runtime dist Change-Id: I51dfef128fdf4c8362a1f837bf64416a06c1318f
2023-11-17Merge "Print an error if the ICU dat file does not exist" into ↵Michael Hoisie
android12-hostruntime-dev
2023-11-09Merge "Change default value of setElegantTextFlag" into ↵Ang Li
android12-hostruntime-dev
2023-11-08Change default value of setElegantTextFlagSeigo Nonaka
As a first step of deprecating UI fonts, make setElegantTextFlag as true by default if the target SDK is set to Android 15 or later.. Bug: 308879280 Test: m -j robolectric_native_runtime dist (cherry picked from https://android-review.googlesource.com/q/commit:cbd21e06413c24fdb8b5457b13e57cc213d9755d) Merged-In: If8e40c075122cafd2f89ae703bf6a5f07ebc7bd0 Change-Id: If8e40c075122cafd2f89ae703bf6a5f07ebc7bd0
2023-11-07Print an error if the ICU dat file does not existMichael Hoisie
If the ICU dat file does not exist, there will be obscure crashes in LineBreaker native methods, which are hard to debug and root cause. Add an explicit check that the ICU data directory is valid. Test: m -j robolectric_native_runtime dist Test: Google3 TAP Change-Id: Iac738cd7a81cf9fba43c97b06b7e575df52ff949
2023-11-07Remove unnecessary JNI lookups in RenderNode JNIMichael Hoisie
There was a lot of complex SDK-specific logic to initialize some RenderNode Java accessor methods. This logic gets even more complex in future SDK versions. However, these Java callbacks are never invoked, so it is unnecessary to set them up. Surround that with ifdef __ANDROID__ to avoid running it on host. Test: m -j robolectric_native_runtime dist Change-Id: Ib81b42d0dd547f0534ee5aa7b627f487d729d09a
2023-11-03Merge "Treat Skia buffers as BGRA_8888 in RNG." into android12-hostruntime-devRaphaël Moll
2023-11-03Treat Skia buffers as BGRA_8888 in RNG.Raphael Moll
Test: m -j robolectric_native_runtime dist Change-Id: Ia6f22645902e65045166166c326d8d7c20032a6a