Loading core/java/android/view/Choreographer.java +6 −3 Original line number Diff line number Diff line Loading @@ -250,12 +250,15 @@ public final class Choreographer { /** * Set flag to indicate that client is blocked waiting for buffer release and * buffer stuffing recovery should soon begin. * buffer stuffing recovery should soon begin. This is provided with the * duration of time in nanoseconds that the client was blocked for. * @hide */ public void onWaitForBufferRelease() { public void onWaitForBufferRelease(long durationNanos) { if (durationNanos > mLastFrameIntervalNanos / 2) { mBufferStuffingState.isStuffed.set(true); } } /** * Contains information about the current frame for jank-tracking, Loading core/jni/android_graphics_BLASTBufferQueue.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -107,10 +107,11 @@ public: } } void onWaitForBufferRelease() { void onWaitForBufferRelease(const nsecs_t durationNanos) { JNIEnv* env = getenv(mVm); getenv(mVm)->CallVoidMethod(mWaitForBufferReleaseObject, gWaitForBufferReleaseCallback.onWaitForBufferRelease); gWaitForBufferReleaseCallback.onWaitForBufferRelease, durationNanos); DieIfException(env, "Uncaught exception in WaitForBufferReleaseCallback."); } Loading Loading @@ -255,7 +256,9 @@ static void nativeSetWaitForBufferReleaseCallback(JNIEnv* env, jclass clazz, jlo } else { sp<WaitForBufferReleaseCallbackWrapper> wrapper = new WaitForBufferReleaseCallbackWrapper{env, waitForBufferReleaseCallback}; queue->setWaitForBufferReleaseCallback([wrapper]() { wrapper->onWaitForBufferRelease(); }); queue->setWaitForBufferReleaseCallback([wrapper](const nsecs_t durationNanos) { wrapper->onWaitForBufferRelease(durationNanos); }); } } Loading Loading @@ -305,7 +308,7 @@ int register_android_graphics_BLASTBufferQueue(JNIEnv* env) { jclass waitForBufferReleaseClass = FindClassOrDie(env, "android/graphics/BLASTBufferQueue$WaitForBufferReleaseCallback"); gWaitForBufferReleaseCallback.onWaitForBufferRelease = GetMethodIDOrDie(env, waitForBufferReleaseClass, "onWaitForBufferRelease", "()V"); GetMethodIDOrDie(env, waitForBufferReleaseClass, "onWaitForBufferRelease", "(J)V"); return 0; } Loading graphics/java/android/graphics/BLASTBufferQueue.java +3 −1 Original line number Diff line number Diff line Loading @@ -61,8 +61,10 @@ public final class BLASTBufferQueue { /** * Indicates that the client is waiting on buffer release * due to no free buffers being available to render into. * @param durationNanos The length of time in nanoseconds * that the client was blocked on buffer release. */ void onWaitForBufferRelease(); void onWaitForBufferRelease(long durationNanos); } /** Create a new connection with the surface flinger. */ Loading Loading
core/java/android/view/Choreographer.java +6 −3 Original line number Diff line number Diff line Loading @@ -250,12 +250,15 @@ public final class Choreographer { /** * Set flag to indicate that client is blocked waiting for buffer release and * buffer stuffing recovery should soon begin. * buffer stuffing recovery should soon begin. This is provided with the * duration of time in nanoseconds that the client was blocked for. * @hide */ public void onWaitForBufferRelease() { public void onWaitForBufferRelease(long durationNanos) { if (durationNanos > mLastFrameIntervalNanos / 2) { mBufferStuffingState.isStuffed.set(true); } } /** * Contains information about the current frame for jank-tracking, Loading
core/jni/android_graphics_BLASTBufferQueue.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -107,10 +107,11 @@ public: } } void onWaitForBufferRelease() { void onWaitForBufferRelease(const nsecs_t durationNanos) { JNIEnv* env = getenv(mVm); getenv(mVm)->CallVoidMethod(mWaitForBufferReleaseObject, gWaitForBufferReleaseCallback.onWaitForBufferRelease); gWaitForBufferReleaseCallback.onWaitForBufferRelease, durationNanos); DieIfException(env, "Uncaught exception in WaitForBufferReleaseCallback."); } Loading Loading @@ -255,7 +256,9 @@ static void nativeSetWaitForBufferReleaseCallback(JNIEnv* env, jclass clazz, jlo } else { sp<WaitForBufferReleaseCallbackWrapper> wrapper = new WaitForBufferReleaseCallbackWrapper{env, waitForBufferReleaseCallback}; queue->setWaitForBufferReleaseCallback([wrapper]() { wrapper->onWaitForBufferRelease(); }); queue->setWaitForBufferReleaseCallback([wrapper](const nsecs_t durationNanos) { wrapper->onWaitForBufferRelease(durationNanos); }); } } Loading Loading @@ -305,7 +308,7 @@ int register_android_graphics_BLASTBufferQueue(JNIEnv* env) { jclass waitForBufferReleaseClass = FindClassOrDie(env, "android/graphics/BLASTBufferQueue$WaitForBufferReleaseCallback"); gWaitForBufferReleaseCallback.onWaitForBufferRelease = GetMethodIDOrDie(env, waitForBufferReleaseClass, "onWaitForBufferRelease", "()V"); GetMethodIDOrDie(env, waitForBufferReleaseClass, "onWaitForBufferRelease", "(J)V"); return 0; } Loading
graphics/java/android/graphics/BLASTBufferQueue.java +3 −1 Original line number Diff line number Diff line Loading @@ -61,8 +61,10 @@ public final class BLASTBufferQueue { /** * Indicates that the client is waiting on buffer release * due to no free buffers being available to render into. * @param durationNanos The length of time in nanoseconds * that the client was blocked on buffer release. */ void onWaitForBufferRelease(); void onWaitForBufferRelease(long durationNanos); } /** Create a new connection with the surface flinger. */ Loading