Loading graphics/java/android/graphics/HardwareRenderer.java +10 −0 Original line number Diff line number Diff line Loading @@ -849,6 +849,14 @@ public class HardwareRenderer { nSetContentDrawBounds(mNativeProxy, left, top, right, bottom); } /** * Force the new frame to draw, ensuring the UI draw request will attempt a draw this vsync. * @hide */ public void forceDrawNextFrame() { nForceDrawNextFrame(mNativeProxy); } /** @hide */ public void setPictureCaptureCallback(@Nullable PictureCapturedCallback callback) { nSetPictureCaptureCallback(mNativeProxy, callback); Loading Loading @@ -1423,6 +1431,8 @@ public class HardwareRenderer { private static native void nSetContentDrawBounds(long nativeProxy, int left, int top, int right, int bottom); private static native void nForceDrawNextFrame(long nativeProxy); private static native void nSetPictureCaptureCallback(long nativeProxy, PictureCapturedCallback callback); Loading libs/hwui/Properties.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,6 @@ RenderPipelineType Properties::sRenderPipelineType = RenderPipelineType::NotInit bool Properties::enableHighContrastText = false; bool Properties::waitForGpuCompletion = false; bool Properties::forceDrawFrame = false; bool Properties::filterOutTestOverhead = false; bool Properties::disableVsync = false; Loading libs/hwui/TreeInfo.h +2 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,8 @@ public: int stretchEffectCount = 0; bool forceDrawFrame = false; struct Out { bool hasFunctors = false; // This is only updated if evaluateAnimations is true Loading libs/hwui/jni/android_graphics_HardwareRenderer.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -259,7 +259,8 @@ static void android_view_ThreadedRenderer_setIsHighEndGfx(JNIEnv* env, jobject c } static int android_view_ThreadedRenderer_syncAndDrawFrame(JNIEnv* env, jobject clazz, jlong proxyPtr, jlongArray frameInfo, jint frameInfoSize) { jlong proxyPtr, jlongArray frameInfo, jint frameInfoSize) { LOG_ALWAYS_FATAL_IF(frameInfoSize != UI_THREAD_FRAME_INFO_SIZE, "Mismatched size expectations, given %d expected %zu", frameInfoSize, UI_THREAD_FRAME_INFO_SIZE); Loading Loading @@ -413,6 +414,12 @@ static void android_view_ThreadedRenderer_setContentDrawBounds(JNIEnv* env, proxy->setContentDrawBounds(left, top, right, bottom); } static void android_view_ThreadedRenderer_forceDrawNextFrame(JNIEnv* env, jobject clazz, jlong proxyPtr) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); proxy->forceDrawNextFrame(); } class JGlobalRefHolder { public: JGlobalRefHolder(JavaVM* vm, jobject object) : mVm(vm), mObject(object) {} Loading Loading @@ -935,6 +942,7 @@ static const JNINativeMethod gMethods[] = { {"nDrawRenderNode", "(JJ)V", (void*)android_view_ThreadedRendererd_drawRenderNode}, {"nSetContentDrawBounds", "(JIIII)V", (void*)android_view_ThreadedRenderer_setContentDrawBounds}, {"nForceDrawNextFrame", "(J)V", (void*)android_view_ThreadedRenderer_forceDrawNextFrame}, {"nSetPictureCaptureCallback", "(JLandroid/graphics/HardwareRenderer$PictureCapturedCallback;)V", (void*)android_view_ThreadedRenderer_setPictureCapturedCallbackJNI}, Loading libs/hwui/renderthread/CanvasContext.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -390,7 +390,7 @@ void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo, int64_t sy return; } if (CC_LIKELY(mSwapHistory.size() && !Properties::forceDrawFrame)) { if (CC_LIKELY(mSwapHistory.size() && !info.forceDrawFrame)) { nsecs_t latestVsync = mRenderThread.timeLord().latestVsync(); SwapHistory& lastSwap = mSwapHistory.back(); nsecs_t vsyncDelta = std::abs(lastSwap.vsyncTime - latestVsync); Loading Loading
graphics/java/android/graphics/HardwareRenderer.java +10 −0 Original line number Diff line number Diff line Loading @@ -849,6 +849,14 @@ public class HardwareRenderer { nSetContentDrawBounds(mNativeProxy, left, top, right, bottom); } /** * Force the new frame to draw, ensuring the UI draw request will attempt a draw this vsync. * @hide */ public void forceDrawNextFrame() { nForceDrawNextFrame(mNativeProxy); } /** @hide */ public void setPictureCaptureCallback(@Nullable PictureCapturedCallback callback) { nSetPictureCaptureCallback(mNativeProxy, callback); Loading Loading @@ -1423,6 +1431,8 @@ public class HardwareRenderer { private static native void nSetContentDrawBounds(long nativeProxy, int left, int top, int right, int bottom); private static native void nForceDrawNextFrame(long nativeProxy); private static native void nSetPictureCaptureCallback(long nativeProxy, PictureCapturedCallback callback); Loading
libs/hwui/Properties.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,6 @@ RenderPipelineType Properties::sRenderPipelineType = RenderPipelineType::NotInit bool Properties::enableHighContrastText = false; bool Properties::waitForGpuCompletion = false; bool Properties::forceDrawFrame = false; bool Properties::filterOutTestOverhead = false; bool Properties::disableVsync = false; Loading
libs/hwui/TreeInfo.h +2 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,8 @@ public: int stretchEffectCount = 0; bool forceDrawFrame = false; struct Out { bool hasFunctors = false; // This is only updated if evaluateAnimations is true Loading
libs/hwui/jni/android_graphics_HardwareRenderer.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -259,7 +259,8 @@ static void android_view_ThreadedRenderer_setIsHighEndGfx(JNIEnv* env, jobject c } static int android_view_ThreadedRenderer_syncAndDrawFrame(JNIEnv* env, jobject clazz, jlong proxyPtr, jlongArray frameInfo, jint frameInfoSize) { jlong proxyPtr, jlongArray frameInfo, jint frameInfoSize) { LOG_ALWAYS_FATAL_IF(frameInfoSize != UI_THREAD_FRAME_INFO_SIZE, "Mismatched size expectations, given %d expected %zu", frameInfoSize, UI_THREAD_FRAME_INFO_SIZE); Loading Loading @@ -413,6 +414,12 @@ static void android_view_ThreadedRenderer_setContentDrawBounds(JNIEnv* env, proxy->setContentDrawBounds(left, top, right, bottom); } static void android_view_ThreadedRenderer_forceDrawNextFrame(JNIEnv* env, jobject clazz, jlong proxyPtr) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); proxy->forceDrawNextFrame(); } class JGlobalRefHolder { public: JGlobalRefHolder(JavaVM* vm, jobject object) : mVm(vm), mObject(object) {} Loading Loading @@ -935,6 +942,7 @@ static const JNINativeMethod gMethods[] = { {"nDrawRenderNode", "(JJ)V", (void*)android_view_ThreadedRendererd_drawRenderNode}, {"nSetContentDrawBounds", "(JIIII)V", (void*)android_view_ThreadedRenderer_setContentDrawBounds}, {"nForceDrawNextFrame", "(J)V", (void*)android_view_ThreadedRenderer_forceDrawNextFrame}, {"nSetPictureCaptureCallback", "(JLandroid/graphics/HardwareRenderer$PictureCapturedCallback;)V", (void*)android_view_ThreadedRenderer_setPictureCapturedCallbackJNI}, Loading
libs/hwui/renderthread/CanvasContext.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -390,7 +390,7 @@ void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo, int64_t sy return; } if (CC_LIKELY(mSwapHistory.size() && !Properties::forceDrawFrame)) { if (CC_LIKELY(mSwapHistory.size() && !info.forceDrawFrame)) { nsecs_t latestVsync = mRenderThread.timeLord().latestVsync(); SwapHistory& lastSwap = mSwapHistory.back(); nsecs_t vsyncDelta = std::abs(lastSwap.vsyncTime - latestVsync); Loading