Loading include/android/surface_control.h +9 −0 Original line number Diff line number Diff line Loading @@ -595,6 +595,15 @@ void ASurfaceTransaction_setEnableBackPressure(ASurfaceTransaction* transaction, bool enableBackPressure) __INTRODUCED_IN(31); /** * Sets the frame timeline to use. * * \param vsyncId The vsync ID received from AChoreographer, setting the frame's present target to * the corresponding expected present time and deadline from the frame to be rendered. */ void ASurfaceTransaction_setFrameTimeline(ASurfaceTransaction* transaction, int64_t vsyncId) __INTRODUCED_IN(33); __END_DECLS #endif // ANDROID_SURFACE_CONTROL_H Loading libs/gui/FrameTimelineInfo.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -33,12 +33,14 @@ namespace android { status_t FrameTimelineInfo::write(Parcel& output) const { SAFE_PARCEL(output.writeInt64, vsyncId); SAFE_PARCEL(output.writeInt32, inputEventId); SAFE_PARCEL(output.writeInt64, startTimeNanos); return NO_ERROR; } status_t FrameTimelineInfo::read(const Parcel& input) { SAFE_PARCEL(input.readInt64, &vsyncId); SAFE_PARCEL(input.readInt32, &inputEventId); SAFE_PARCEL(input.readInt64, &startTimeNanos); return NO_ERROR; } Loading @@ -48,16 +50,19 @@ void FrameTimelineInfo::merge(const FrameTimelineInfo& other) { if (other.vsyncId > vsyncId) { vsyncId = other.vsyncId; inputEventId = other.inputEventId; startTimeNanos = other.startTimeNanos; } } else if (vsyncId == INVALID_VSYNC_ID) { vsyncId = other.vsyncId; inputEventId = other.inputEventId; startTimeNanos = other.startTimeNanos; } } void FrameTimelineInfo::clear() { vsyncId = INVALID_VSYNC_ID; inputEventId = IInputConstants::INVALID_INPUT_EVENT_ID; startTimeNanos = 0; } }; // namespace android libs/gui/Surface.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -1846,9 +1846,10 @@ int Surface::dispatchSetFrameTimelineInfo(va_list args) { ATRACE_CALL(); auto frameTimelineVsyncId = static_cast<int64_t>(va_arg(args, int64_t)); auto inputEventId = static_cast<int32_t>(va_arg(args, int32_t)); auto startTimeNanos = static_cast<int64_t>(va_arg(args, int64_t)); ALOGV("Surface::%s", __func__); return setFrameTimelineInfo({frameTimelineVsyncId, inputEventId}); return setFrameTimelineInfo({frameTimelineVsyncId, inputEventId, startTimeNanos}); } bool Surface::transformToDisplayInverse() const { Loading libs/gui/include/gui/FrameTimelineInfo.h +3 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ struct FrameTimelineInfo { // not directly vendor available. int32_t inputEventId = 0; // The current time in nanoseconds the application started to render the frame. int64_t startTimeNanos = 0; status_t write(Parcel& output) const; status_t read(const Parcel& input); Loading libs/nativewindow/include/system/window.h +5 −4 Original line number Diff line number Diff line Loading @@ -1026,9 +1026,10 @@ static inline int native_window_set_frame_rate(struct ANativeWindow* window, flo static inline int native_window_set_frame_timeline_info(struct ANativeWindow* window, int64_t frameTimelineVsyncId, int32_t inputEventId) { return window->perform(window, NATIVE_WINDOW_SET_FRAME_TIMELINE_INFO, frameTimelineVsyncId, inputEventId); int32_t inputEventId, int64_t startTimeNanos) { return window->perform(window, NATIVE_WINDOW_SET_FRAME_TIMELINE_INFO, frameTimelineVsyncId, inputEventId, startTimeNanos); } // ------------------------------------------------------------------------------------------------ Loading Loading
include/android/surface_control.h +9 −0 Original line number Diff line number Diff line Loading @@ -595,6 +595,15 @@ void ASurfaceTransaction_setEnableBackPressure(ASurfaceTransaction* transaction, bool enableBackPressure) __INTRODUCED_IN(31); /** * Sets the frame timeline to use. * * \param vsyncId The vsync ID received from AChoreographer, setting the frame's present target to * the corresponding expected present time and deadline from the frame to be rendered. */ void ASurfaceTransaction_setFrameTimeline(ASurfaceTransaction* transaction, int64_t vsyncId) __INTRODUCED_IN(33); __END_DECLS #endif // ANDROID_SURFACE_CONTROL_H Loading
libs/gui/FrameTimelineInfo.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -33,12 +33,14 @@ namespace android { status_t FrameTimelineInfo::write(Parcel& output) const { SAFE_PARCEL(output.writeInt64, vsyncId); SAFE_PARCEL(output.writeInt32, inputEventId); SAFE_PARCEL(output.writeInt64, startTimeNanos); return NO_ERROR; } status_t FrameTimelineInfo::read(const Parcel& input) { SAFE_PARCEL(input.readInt64, &vsyncId); SAFE_PARCEL(input.readInt32, &inputEventId); SAFE_PARCEL(input.readInt64, &startTimeNanos); return NO_ERROR; } Loading @@ -48,16 +50,19 @@ void FrameTimelineInfo::merge(const FrameTimelineInfo& other) { if (other.vsyncId > vsyncId) { vsyncId = other.vsyncId; inputEventId = other.inputEventId; startTimeNanos = other.startTimeNanos; } } else if (vsyncId == INVALID_VSYNC_ID) { vsyncId = other.vsyncId; inputEventId = other.inputEventId; startTimeNanos = other.startTimeNanos; } } void FrameTimelineInfo::clear() { vsyncId = INVALID_VSYNC_ID; inputEventId = IInputConstants::INVALID_INPUT_EVENT_ID; startTimeNanos = 0; } }; // namespace android
libs/gui/Surface.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -1846,9 +1846,10 @@ int Surface::dispatchSetFrameTimelineInfo(va_list args) { ATRACE_CALL(); auto frameTimelineVsyncId = static_cast<int64_t>(va_arg(args, int64_t)); auto inputEventId = static_cast<int32_t>(va_arg(args, int32_t)); auto startTimeNanos = static_cast<int64_t>(va_arg(args, int64_t)); ALOGV("Surface::%s", __func__); return setFrameTimelineInfo({frameTimelineVsyncId, inputEventId}); return setFrameTimelineInfo({frameTimelineVsyncId, inputEventId, startTimeNanos}); } bool Surface::transformToDisplayInverse() const { Loading
libs/gui/include/gui/FrameTimelineInfo.h +3 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ struct FrameTimelineInfo { // not directly vendor available. int32_t inputEventId = 0; // The current time in nanoseconds the application started to render the frame. int64_t startTimeNanos = 0; status_t write(Parcel& output) const; status_t read(const Parcel& input); Loading
libs/nativewindow/include/system/window.h +5 −4 Original line number Diff line number Diff line Loading @@ -1026,9 +1026,10 @@ static inline int native_window_set_frame_rate(struct ANativeWindow* window, flo static inline int native_window_set_frame_timeline_info(struct ANativeWindow* window, int64_t frameTimelineVsyncId, int32_t inputEventId) { return window->perform(window, NATIVE_WINDOW_SET_FRAME_TIMELINE_INFO, frameTimelineVsyncId, inputEventId); int32_t inputEventId, int64_t startTimeNanos) { return window->perform(window, NATIVE_WINDOW_SET_FRAME_TIMELINE_INFO, frameTimelineVsyncId, inputEventId, startTimeNanos); } // ------------------------------------------------------------------------------------------------ Loading