diff options
Diffstat (limited to 'native')
| -rw-r--r-- | native/android/choreographer.cpp | 29 | ||||
| -rw-r--r-- | native/android/input.cpp | 4 | ||||
| -rw-r--r-- | native/android/libandroid.map.txt | 8 | ||||
| -rw-r--r-- | native/android/surface_control.cpp | 26 | ||||
| -rw-r--r-- | native/webview/loader/loader.cpp | 4 |
5 files changed, 54 insertions, 17 deletions
diff --git a/native/android/choreographer.cpp b/native/android/choreographer.cpp index 38641de0efb3..deee5b173c21 100644 --- a/native/android/choreographer.cpp +++ b/native/android/choreographer.cpp @@ -40,6 +40,11 @@ void AChoreographer_postFrameCallbackDelayed64(AChoreographer* choreographer, return AChoreographer_routePostFrameCallbackDelayed64(choreographer, callback, data, delayMillis); } +void AChoreographer_postExtendedFrameCallback(AChoreographer* choreographer, + AChoreographer_extendedFrameCallback callback, + void* data) { + return AChoreographer_routePostExtendedFrameCallback(choreographer, callback, data); +} void AChoreographer_registerRefreshRateCallback(AChoreographer* choreographer, AChoreographer_refreshRateCallback callback, void* data) { @@ -50,3 +55,27 @@ void AChoreographer_unregisterRefreshRateCallback(AChoreographer* choreographer, void* data) { return AChoreographer_routeUnregisterRefreshRateCallback(choreographer, callback, data); } +int64_t AChoreographerFrameCallbackData_getFrameTimeNanos( + const AChoreographerFrameCallbackData* data) { + return AChoreographerFrameCallbackData_routeGetFrameTimeNanos(data); +} +size_t AChoreographerFrameCallbackData_getFrameTimelinesLength( + const AChoreographerFrameCallbackData* data) { + return AChoreographerFrameCallbackData_routeGetFrameTimelinesLength(data); +} +size_t AChoreographerFrameCallbackData_getPreferredFrameTimelineIndex( + const AChoreographerFrameCallbackData* data) { + return AChoreographerFrameCallbackData_routeGetPreferredFrameTimelineIndex(data); +} +int64_t AChoreographerFrameCallbackData_getFrameTimelineVsyncId( + const AChoreographerFrameCallbackData* data, size_t index) { + return AChoreographerFrameCallbackData_routeGetFrameTimelineVsyncId(data, index); +} +int64_t AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentTime( + const AChoreographerFrameCallbackData* data, size_t index) { + return AChoreographerFrameCallbackData_routeGetFrameTimelineExpectedPresentTime(data, index); +} +int64_t AChoreographerFrameCallbackData_getFrameTimelineDeadline( + const AChoreographerFrameCallbackData* data, size_t index) { + return AChoreographerFrameCallbackData_routeGetFrameTimelineDeadline(data, index); +} diff --git a/native/android/input.cpp b/native/android/input.cpp index 8eeb9555c51c..4de2c23e62b8 100644 --- a/native/android/input.cpp +++ b/native/android/input.cpp @@ -329,3 +329,7 @@ void AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event, int handled InputEvent* e = static_cast<InputEvent*>(event); iq->finishEvent(e, handled != 0); } + +AInputQueue* AInputQueue_fromJava(jobject inputQueue) { + return android::android_view_InputQueue_getNativePtr(inputQueue); +} diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt index f33e11817730..f00eef2f1b00 100644 --- a/native/android/libandroid.map.txt +++ b/native/android/libandroid.map.txt @@ -29,6 +29,13 @@ LIBANDROID { AChoreographer_postFrameCallbackDelayed64; # introduced=29 AChoreographer_registerRefreshRateCallback; # introduced=30 AChoreographer_unregisterRefreshRateCallback; # introduced=30 + AChoreographer_postExtendedFrameCallback; # introduced=33 + AChoreographerFrameCallbackData_getFrameTimeNanos; # introduced=33 + AChoreographerFrameCallbackData_getFrameTimelinesLength; # introduced=33 + AChoreographerFrameCallbackData_getPreferredFrameTimelineIndex; # introduced=33 + AChoreographerFrameCallbackData_getFrameTimelineVsyncId; # introduced=33 + AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentTime; # introduced=33 + AChoreographerFrameCallbackData_getFrameTimelineDeadline; # introduced=33 AConfiguration_copy; AConfiguration_delete; AConfiguration_diff; @@ -84,6 +91,7 @@ LIBANDROID { AInputQueue_attachLooper; AInputQueue_detachLooper; AInputQueue_finishEvent; + AInputQueue_fromJava; # introduced=Tiramisu AInputQueue_getEvent; AInputQueue_hasEvents; AInputQueue_preDispatchEvent; diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index 693a027bd0e2..ceba4d60bed0 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -146,28 +146,24 @@ struct ASurfaceControlStats { uint64_t frameNumber; }; -void ASurfaceControl_registerSurfaceStatsListener(ASurfaceControl* control, void* context, - ASurfaceControl_SurfaceStatsListener func) { - SurfaceStatsCallback callback = [func](void* callback_context, - nsecs_t, - const sp<Fence>&, - const SurfaceStats& surfaceStats) { - +void ASurfaceControl_registerSurfaceStatsListener(ASurfaceControl* control, int32_t id, + void* context, + ASurfaceControl_SurfaceStatsListener func) { + SurfaceStatsCallback callback = [func, id](void* callback_context, nsecs_t, const sp<Fence>&, + const SurfaceStats& surfaceStats) { ASurfaceControlStats aSurfaceControlStats; - ASurfaceControl* aSurfaceControl = - reinterpret_cast<ASurfaceControl*>(surfaceStats.surfaceControl.get()); aSurfaceControlStats.acquireTime = surfaceStats.acquireTime; aSurfaceControlStats.previousReleaseFence = surfaceStats.previousReleaseFence; aSurfaceControlStats.frameNumber = surfaceStats.eventStats.frameNumber; - (*func)(callback_context, aSurfaceControl, &aSurfaceControlStats); + (*func)(callback_context, id, &aSurfaceControlStats); }; + TransactionCompletedListener::getInstance()->addSurfaceStatsListener(context, reinterpret_cast<void*>(func), ASurfaceControl_to_SurfaceControl(control), callback); } - void ASurfaceControl_unregisterSurfaceStatsListener(void* context, ASurfaceControl_SurfaceStatsListener func) { TransactionCompletedListener::getInstance()->removeSurfaceStatsListener(context, @@ -370,11 +366,11 @@ void ASurfaceTransaction_setBuffer(ASurfaceTransaction* aSurfaceTransaction, sp<GraphicBuffer> graphic_buffer(reinterpret_cast<GraphicBuffer*>(buffer)); - transaction->setBuffer(surfaceControl, graphic_buffer); + std::optional<sp<Fence>> fence = std::nullopt; if (acquire_fence_fd != -1) { - sp<Fence> fence = new Fence(acquire_fence_fd); - transaction->setAcquireFence(surfaceControl, fence); + fence = new Fence(acquire_fence_fd); } + transaction->setBuffer(surfaceControl, graphic_buffer, fence); } void ASurfaceTransaction_setGeometry(ASurfaceTransaction* aSurfaceTransaction, @@ -662,4 +658,4 @@ void ASurfaceTransaction_setOnCommit(ASurfaceTransaction* aSurfaceTransaction, v Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction); transaction->addTransactionCommittedCallback(callback, context); -}
\ No newline at end of file +} diff --git a/native/webview/loader/loader.cpp b/native/webview/loader/loader.cpp index 1265763d47d3..94e1e9f8b1c2 100644 --- a/native/webview/loader/loader.cpp +++ b/native/webview/loader/loader.cpp @@ -121,8 +121,8 @@ jint DoLoadWithRelroFile(JNIEnv* env, const char* lib, const char* relro, jobject clazzLoader) { int relro_fd = TEMP_FAILURE_RETRY(open(relro, O_RDONLY)); if (relro_fd == -1) { - ALOGE("Failed to open relro file %s: %s", relro, strerror(errno)); - return LIBLOAD_FAILED_TO_OPEN_RELRO_FILE; + ALOGW("Failed to open relro file %s: %s", relro, strerror(errno)); + return LIBLOAD_FAILED_TO_OPEN_RELRO_FILE; } android_namespace_t* ns = android::FindNamespaceByClassLoader(env, clazzLoader); |