Signed-off-by: hsc <husichao1@huawei.com>
This commit is contained in:
hsc 2024-09-05 20:47:06 +08:00
parent 810b4fdc83
commit 8ffa48224a
3 changed files with 11 additions and 7 deletions

View File

@ -30,7 +30,8 @@ public:
class VSyncControllerCallback : public VSyncController::Callback {
public:
void OnVSyncEvent(int64_t now, int64_t period, uint32_t refreshRate, VSyncMode vsyncMode) override;
void OnVSyncEvent(int64_t now, int64_t period,
uint32_t refreshRate, VSyncMode vsyncMode, uint32_t vsyncMaxRefreshRate) override;
void OnConnsRefreshRateChanged(const std::vector<std::pair<uint64_t, uint32_t>> &refreshRates) override;
};
@ -48,7 +49,8 @@ void VSyncControllerTest::TearDownTestCase()
vsyncController_ = nullptr;
}
void VSyncControllerCallback::OnVSyncEvent(int64_t now, int64_t period, uint32_t refreshRate, VSyncMode vsyncMode) {}
void VSyncControllerCallback::OnVSyncEvent(int64_t now, int64_t period,
uint32_t refreshRate, VSyncMode vsyncMode, uint32_t vsyncMaxRefreshRate) {}
void VSyncControllerCallback::OnConnsRefreshRateChanged(const std::vector<std::pair<uint64_t, uint32_t>> &refreshRates)
{

View File

@ -437,7 +437,7 @@ HWTEST_F(VSyncDistributorTest, OnVSyncTriggerTest001, Function | MediumTest| Lev
ASSERT_EQ(vsyncDistributor->AddConnection(conn, 1), VSYNC_ERROR_OK);
conns.emplace_back(conn);
}
vsyncDistributor->OnVSyncTrigger(1000000000, 8333333, 120, VSYNC_MODE_LTPO);
vsyncDistributor->OnVSyncTrigger(1000000000, 8333333, 120, VSYNC_MODE_LTPO, 360);
for (int i = 0; i < conns.size(); i++) {
ASSERT_EQ(vsyncDistributor->RemoveConnection(conns[i]), VSYNC_ERROR_OK);
}
@ -458,7 +458,7 @@ HWTEST_F(VSyncDistributorTest, OnVSyncTriggerTest002, Function | MediumTest| Lev
ASSERT_EQ(vsyncDistributor->AddConnection(conn, 1), VSYNC_ERROR_OK);
conns.emplace_back(conn);
}
vsyncDistributor->OnVSyncTrigger(1000000000, -8333333, 120, VSYNC_MODE_LTPO);
vsyncDistributor->OnVSyncTrigger(1000000000, -8333333, 120, VSYNC_MODE_LTPO, 360);
for (int i = 0; i < conns.size(); i++) {
ASSERT_EQ(vsyncDistributor->RemoveConnection(conns[i]), VSYNC_ERROR_OK);
}
@ -479,7 +479,7 @@ HWTEST_F(VSyncDistributorTest, OnVSyncTriggerTest003, Function | MediumTest| Lev
ASSERT_EQ(vsyncDistributor->AddConnection(conn, 1), VSYNC_ERROR_OK);
conns.emplace_back(conn);
}
vsyncDistributor->OnVSyncTrigger(1000000000, 8333333, 120, VSYNC_MODE_LTPS);
vsyncDistributor->OnVSyncTrigger(1000000000, 8333333, 120, VSYNC_MODE_LTPS, 360);
for (int i = 0; i < conns.size(); i++) {
ASSERT_EQ(vsyncDistributor->RemoveConnection(conns[i]), VSYNC_ERROR_OK);
}

View File

@ -78,12 +78,14 @@ void VSyncGeneratorTest::TearDownTestCase()
class VSyncGeneratorTestCallback : public VSyncGenerator::Callback {
public:
void OnVSyncEvent(int64_t now, int64_t period, uint32_t refreshRate, VSyncMode vsyncMode) override;
void OnVSyncEvent(int64_t now, int64_t period,
uint32_t refreshRate, VSyncMode vsyncMode, uint32_t vsyncMaxRefreshRate) override;
void OnPhaseOffsetChanged(int64_t phaseOffset) override;
void OnConnsRefreshRateChanged(const std::vector<std::pair<uint64_t, uint32_t>> &refreshRates) override;
};
void VSyncGeneratorTestCallback::OnVSyncEvent(int64_t now, int64_t period, uint32_t refreshRate, VSyncMode vsyncMode)
void VSyncGeneratorTestCallback::OnVSyncEvent(int64_t now, int64_t period,
uint32_t refreshRate, VSyncMode vsyncMode, uint32_t vsyncMaxRefreshRate)
{
}