mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-27 17:11:51 +00:00
可见性增量上报修改
Signed-off-by: zhengleran <zhengleran@huawei.com>
This commit is contained in:
parent
521ae2a071
commit
c6e33e3a61
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user