Loading services/surfaceflinger/Scheduler/EventThread.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,12 @@ void EventThread::requestNextVsync(const sp<EventThreadConnection>& connection) VsyncEventData EventThread::getLatestVsyncEventData( const sp<EventThreadConnection>& connection) const { // Resync so that the vsync is accurate with hardware. getLatestVsyncEventData is an alternate // way to get vsync data (instead of posting callbacks to Choreographer). if (connection->resyncCallback) { connection->resyncCallback(); } VsyncEventData vsyncEventData; nsecs_t frameInterval = mGetVsyncPeriodFunction(connection->mOwnerUid); vsyncEventData.frameInterval = frameInterval; Loading services/surfaceflinger/tests/unittests/EventThreadTest.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -415,6 +415,10 @@ TEST_F(EventThreadTest, getLatestVsyncEventData) { EXPECT_CALL(*mVSyncSource, getLatestVSyncData()).WillOnce(Return(preferredData)); VsyncEventData vsyncEventData = mThread->getLatestVsyncEventData(mConnection); // Check EventThread immediately requested a resync. EXPECT_TRUE(mResyncCallRecorder.waitForCall().has_value()); EXPECT_GT(vsyncEventData.frameTimelines[0].deadlineTimestamp, now) << "Deadline timestamp should be greater than frame time"; for (size_t i = 0; i < VsyncEventData::kFrameTimelinesLength; i++) { Loading Loading
services/surfaceflinger/Scheduler/EventThread.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,12 @@ void EventThread::requestNextVsync(const sp<EventThreadConnection>& connection) VsyncEventData EventThread::getLatestVsyncEventData( const sp<EventThreadConnection>& connection) const { // Resync so that the vsync is accurate with hardware. getLatestVsyncEventData is an alternate // way to get vsync data (instead of posting callbacks to Choreographer). if (connection->resyncCallback) { connection->resyncCallback(); } VsyncEventData vsyncEventData; nsecs_t frameInterval = mGetVsyncPeriodFunction(connection->mOwnerUid); vsyncEventData.frameInterval = frameInterval; Loading
services/surfaceflinger/tests/unittests/EventThreadTest.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -415,6 +415,10 @@ TEST_F(EventThreadTest, getLatestVsyncEventData) { EXPECT_CALL(*mVSyncSource, getLatestVSyncData()).WillOnce(Return(preferredData)); VsyncEventData vsyncEventData = mThread->getLatestVsyncEventData(mConnection); // Check EventThread immediately requested a resync. EXPECT_TRUE(mResyncCallRecorder.waitForCall().has_value()); EXPECT_GT(vsyncEventData.frameTimelines[0].deadlineTimestamp, now) << "Deadline timestamp should be greater than frame time"; for (size_t i = 0; i < VsyncEventData::kFrameTimelinesLength; i++) { Loading