可见性增量上报修改

Signed-off-by: zhengleran <zhengleran@huawei.com>
This commit is contained in:
zhengleran 2024-11-06 17:49:17 +08:00
parent 521ae2a071
commit c6e33e3a61
2 changed files with 12 additions and 3 deletions

View File

@ -7600,9 +7600,10 @@ std::vector<std::pair<uint64_t, WindowVisibilityState>> SceneSessionManager::Get
if (lastVisibleData_[i].first < currVisibleData[j].first) {
visibilityChangeInfo.emplace_back(lastVisibleData_[i].first, WINDOW_VISIBILITY_STATE_TOTALLY_OCCUSION);
i++;
} else if (lastVisibleData_[i].first > currVisibleData[j].first &&
currVisibleData[j].second != WINDOW_VISIBILITY_STATE_TOTALLY_OCCUSION) {
visibilityChangeInfo.emplace_back(currVisibleData[j].first, currVisibleData[j].second);
} else if (lastVisibleData_[i].first > currVisibleData[j].first) {
if (currVisibleData[j].second != WINDOW_VISIBILITY_STATE_TOTALLY_OCCUSION) {
visibilityChangeInfo.emplace_back(currVisibleData[j].first, currVisibleData[j].second);
}
j++;
} else {
if (lastVisibleData_[i].second != currVisibleData[j].second) {

View File

@ -233,6 +233,14 @@ HWTEST_F(SceneSessionManagerTest6, GetWindowVisibilityChangeInfo03, Function | S
std::make_pair(2, WindowVisibilityState::WINDOW_VISIBILITY_STATE_PARTICALLY_OCCLUSION));
visibilityChangeInfos = ssm_->GetWindowVisibilityChangeInfo(currVisibleData);
ASSERT_EQ(visibilityChangeInfos.size(), 1);
currVisibleData.clear();
ssm_->lastVisibleData_.clear();
currVisibleData.push_back(std::make_pair(1, WindowVisibilityState::WINDOW_VISIBILITY_STATE_TOTALLY_OCCUSION));
ssm_->lastVisibleData_.push_back(
std::make_pair(2, WindowVisibilityState::WINDOW_VISIBILITY_STATE_NO_OCCLUSION));
visibilityChangeInfos = ssm_->GetWindowVisibilityChangeInfo(currVisibleData);
ASSERT_EQ(visibilityChangeInfos.size(), 1);
ASSERT_EQ(visibilityChangeInfos[0].first, 2);
}
/**