已开启
user #33
wangdi创建于 11 天前
wangdi
7 天前 评论:
7 天前 评论:
struct ScreenSessionSnapshot {
ScreenId screenId = 0;
uint64_t sessionId = 0;
std::string name;
std::string innerName;
bool isExtend = false;
bool isRealScreen = false;
DisplayGroupId displayGroupId = 0;
ScreenId mainDisplayIdOfGroup = 0;
bool isRotationLocked = false;
int32_t rotation = 0;
std::map<int32_t, int32_t> rotationOrientationMap;
float densityInCurResolution = 0.0f;
};
static napi_value
Create(napi_env env, const sptr<ScreenSession>& screenSession, const ScreenSessionSnapshot& snapshot);
static ScreenSessionSnapshot MakeSnapshot(const sptr<ScreenSession>& screenSession);


wangdi
6 天前 评论:
6 天前 评论:
auto& nodeMap = userDisplayNodeMap_[userId];
auto it = nodeMap.find(screenId);
if (it != nodeMap.end() && it->second != nullptr && it->second != displayNode) {
TLOGW(WmsLogTag::DMS, "Remove stale displayNode: %{public}" PRIu64 " from tree.", it->second->GetId());
it->second->RemoveDisplayNodeFromTree();
displayNodePidMap_.erase(it->second->GetId());
RSTransactionAdapter::FlushImplicitTransaction(it->second);
}
nodeMap.insert_or_assign(screenId, displayNode);
TLOGNFI(WmsLogTag::DMS, "success");


wangdi
5 天前 评论:
5 天前 评论:
/*
* Hold screenModeChangeMutex_ to prevent ScreenPhysicalInfoChange (which swaps rsId/phyScreenId
* between ScreenSessions) from racing with the RS call and the subsequent
* UpdateSessionByActiveModeChange.
*/


wangdi
1 天前 评论:
1 天前 评论:
if (!HasInternalScreen()) {
std::vector<sptr<ScreenSession>> externalSessions = GetExternalSessions();
for (auto& session : externalSessions) {
if (session->GetScreenCombination() == ScreenCombination::SCREEN_MAIN) {
innerSession = session;
} else {
externalSession = session;
}
}
TLOGNFE(WmsLogTag::DMS, "innerSession screenId: %{public}" PRIu64 ", rsId: %{public}" PRIu64,
innerSession->GetScreenId(), innerSession->GetRSScreenId());
TLOGNFE(WmsLogTag::DMS, "externalSession screenId: %{public}" PRIu64 ", rsId: %{public}" PRIu64,
externalSession->GetScreenId(), externalSession->GetRSScreenId());
// The screenSession with the smallest rsId is used as the anchor to avoid inconsistency
// between the primary and secondary relationships of the foundation and clients of different users.
if (innerSession->GetRSScreenId() > externalSession->GetRSScreenId()) {
auto tmpSession = externalSession;
externalSession = innerSession;
innerSession = tmpSession;
}
} else {
GetInternalAndExternalSession(innerSession, externalSession);
}


user