1 /*
2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "pipeline/rs_display_render_node.h"
17
18 #include "common/rs_obj_abs_geometry.h"
19 #include "common/rs_optional_trace.h"
20 #include "params/rs_display_render_params.h"
21 #include "pipeline/rs_render_node.h"
22 #include "pipeline/rs_surface_render_node.h"
23 #include "platform/common/rs_log.h"
24 #include "screen_manager/screen_types.h"
25 #include "visitor/rs_node_visitor.h"
26 #include "transaction/rs_render_service_client.h"
27 namespace OHOS {
28 namespace Rosen {
29 constexpr int64_t MAX_JITTER_NS = 2000000; // 2ms
30
RSDisplayRenderNode(NodeId id,const RSDisplayNodeConfig & config,const std::weak_ptr<RSContext> & context)31 RSDisplayRenderNode::RSDisplayRenderNode(
32 NodeId id, const RSDisplayNodeConfig& config, const std::weak_ptr<RSContext>& context)
33 : RSRenderNode(id, context), screenId_(config.screenId), offsetX_(0), offsetY_(0),
34 isMirroredDisplay_(config.isMirrored), dirtyManager_(std::make_shared<RSDirtyRegionManager>(true))
35 {
36 RS_LOGI("RSDisplayRenderNode ctor id:%{public}" PRIu64 "", id);
37 MemoryInfo info = {sizeof(*this), ExtractPid(id), id, MEMORY_TYPE::MEM_RENDER_NODE};
38 MemoryTrack::Instance().AddNodeRecord(id, info);
39 MemorySnapshot::Instance().AddCpuMemory(ExtractPid(id), sizeof(*this));
40 }
41
~RSDisplayRenderNode()42 RSDisplayRenderNode::~RSDisplayRenderNode()
43 {
44 RS_LOGI("RSDisplayRenderNode dtor id:%{public}" PRIu64 "", GetId());
45 MemoryTrack::Instance().RemoveNodeRecord(GetId());
46 MemorySnapshot::Instance().RemoveCpuMemory(ExtractPid(GetId()), sizeof(*this));
47 }
48
CollectSurface(const std::shared_ptr<RSBaseRenderNode> & node,std::vector<RSBaseRenderNode::SharedPtr> & vec,bool isUniRender,bool onlyFirstLevel)49 void RSDisplayRenderNode::CollectSurface(
50 const std::shared_ptr<RSBaseRenderNode>& node, std::vector<RSBaseRenderNode::SharedPtr>& vec, bool isUniRender,
51 bool onlyFirstLevel)
52 {
53 for (auto& child : *node->GetSortedChildren()) {
54 child->CollectSurface(child, vec, isUniRender, onlyFirstLevel);
55 }
56 }
57
QuickPrepare(const std::shared_ptr<RSNodeVisitor> & visitor)58 void RSDisplayRenderNode::QuickPrepare(const std::shared_ptr<RSNodeVisitor>& visitor)
59 {
60 if (!visitor) {
61 return;
62 }
63 ApplyModifiers();
64 visitor->QuickPrepareDisplayRenderNode(*this);
65 }
66
Prepare(const std::shared_ptr<RSNodeVisitor> & visitor)67 void RSDisplayRenderNode::Prepare(const std::shared_ptr<RSNodeVisitor>& visitor)
68 {
69 if (!visitor) {
70 return;
71 }
72 ApplyModifiers();
73 visitor->PrepareDisplayRenderNode(*this);
74 }
75
Process(const std::shared_ptr<RSNodeVisitor> & visitor)76 void RSDisplayRenderNode::Process(const std::shared_ptr<RSNodeVisitor>& visitor)
77 {
78 if (!visitor) {
79 return;
80 }
81 RSRenderNode::RenderTraceDebug();
82 visitor->ProcessDisplayRenderNode(*this);
83 }
84
SetIsOnTheTree(bool flag,NodeId instanceRootNodeId,NodeId firstLevelNodeId,NodeId cacheNodeId,NodeId uifirstRootNodeId,NodeId displayNodeId)85 void RSDisplayRenderNode::SetIsOnTheTree(bool flag, NodeId instanceRootNodeId, NodeId firstLevelNodeId,
86 NodeId cacheNodeId, NodeId uifirstRootNodeId, NodeId displayNodeId)
87 {
88 // if node is marked as cacheRoot, update subtree status when update surface
89 // in case prepare stage upper cacheRoot cannot specify dirty subnode
90 RSRenderNode::SetIsOnTheTree(flag, GetId(), firstLevelNodeId, cacheNodeId, uifirstRootNodeId, GetId());
91 }
92
GetCompositeType() const93 RSDisplayRenderNode::CompositeType RSDisplayRenderNode::GetCompositeType() const
94 {
95 return compositeType_;
96 }
97
SetCompositeType(RSDisplayRenderNode::CompositeType type)98 void RSDisplayRenderNode::SetCompositeType(RSDisplayRenderNode::CompositeType type)
99 {
100 compositeType_ = type;
101 }
102
SetForceSoftComposite(bool flag)103 void RSDisplayRenderNode::SetForceSoftComposite(bool flag)
104 {
105 forceSoftComposite_ = flag;
106 }
107
IsForceSoftComposite() const108 bool RSDisplayRenderNode::IsForceSoftComposite() const
109 {
110 return forceSoftComposite_;
111 }
112
SetMirrorSource(SharedPtr node)113 void RSDisplayRenderNode::SetMirrorSource(SharedPtr node)
114 {
115 if (!isMirroredDisplay_ || node == nullptr) {
116 return;
117 }
118 mirrorSource_ = node;
119 }
120
ResetMirrorSource()121 void RSDisplayRenderNode::ResetMirrorSource()
122 {
123 mirrorSource_.reset();
124 }
125
IsMirrorDisplay() const126 bool RSDisplayRenderNode::IsMirrorDisplay() const
127 {
128 return isMirroredDisplay_;
129 }
130
SetSecurityDisplay(bool isSecurityDisplay)131 void RSDisplayRenderNode::SetSecurityDisplay(bool isSecurityDisplay)
132 {
133 isSecurityDisplay_ = isSecurityDisplay;
134 }
135
GetSecurityDisplay() const136 bool RSDisplayRenderNode::GetSecurityDisplay() const
137 {
138 return isSecurityDisplay_;
139 }
140
SetIsMirrorDisplay(bool isMirror)141 void RSDisplayRenderNode::SetIsMirrorDisplay(bool isMirror)
142 {
143 if (isMirroredDisplay_ != isMirror) {
144 hasMirroredDisplayChanged_ = true;
145 }
146 isMirroredDisplay_ = isMirror;
147 RS_LOGD("RSDisplayRenderNode::SetIsMirrorDisplay, node id:[%{public}" PRIu64 "], isMirrorDisplay: [%{public}s]",
148 GetId(), IsMirrorDisplay() ? "true" : "false");
149 }
150
SetBootAnimation(bool isBootAnimation)151 void RSDisplayRenderNode::SetBootAnimation(bool isBootAnimation)
152 {
153 ROSEN_LOGD("SetBootAnimation:: id:[%{public}" PRIu64 ", isBootAnimation:%{public}d",
154 GetId(), isBootAnimation);
155 isBootAnimation_ = isBootAnimation;
156
157 auto parent = GetParent().lock();
158 if (parent == nullptr) {
159 return;
160 }
161 if (isBootAnimation) {
162 parent->SetContainBootAnimation(true);
163 }
164 }
165
GetBootAnimation() const166 bool RSDisplayRenderNode::GetBootAnimation() const
167 {
168 return isBootAnimation_;
169 }
170
InitRenderParams()171 void RSDisplayRenderNode::InitRenderParams()
172 {
173 stagingRenderParams_ = std::make_unique<RSDisplayRenderParams>(GetId());
174 DrawableV2::RSRenderNodeDrawableAdapter::OnGenerate(shared_from_this());
175 if (renderDrawable_ == nullptr) {
176 RS_LOGE("RSDisplayRenderNode::InitRenderParams failed");
177 return;
178 }
179 }
180
OnSync()181 void RSDisplayRenderNode::OnSync()
182 {
183 RS_OPTIONAL_TRACE_NAME_FMT("RSDisplayRenderNode::OnSync global dirty[%s]",
184 dirtyManager_->GetCurrentFrameDirtyRegion().ToString().c_str());
185 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
186 if (displayParams == nullptr) {
187 RS_LOGE("RSDisplayRenderNode::OnSync displayParams is null");
188 return;
189 }
190 if (!renderDrawable_) {
191 return;
192 }
193 auto syncDirtyManager = renderDrawable_->GetSyncDirtyManager();
194 dirtyManager_->OnSync(syncDirtyManager);
195 displayParams->SetZoomed(curZoomState_);
196 displayParams->SetNeedSync(true);
197 RSRenderNode::OnSync();
198 HandleCurMainAndLeashSurfaceNodes();
199 }
200
HandleCurMainAndLeashSurfaceNodes()201 void RSDisplayRenderNode::HandleCurMainAndLeashSurfaceNodes()
202 {
203 surfaceCountForMultiLayersPerf_ = 0;
204 for (const auto& surface : curMainAndLeashSurfaceNodes_) {
205 auto surfaceNode = RSBaseRenderNode::ReinterpretCast<RSSurfaceRenderNode>(surface);
206 if (!surfaceNode || surfaceNode->IsLeashWindow()) {
207 continue;
208 }
209 surfaceCountForMultiLayersPerf_++;
210 }
211 curMainAndLeashSurfaceNodes_.clear();
212 }
213
RecordMainAndLeashSurfaces(RSBaseRenderNode::SharedPtr surface)214 void RSDisplayRenderNode::RecordMainAndLeashSurfaces(RSBaseRenderNode::SharedPtr surface)
215 {
216 curMainAndLeashSurfaceNodes_.push_back(surface);
217 }
218
UpdateRenderParams()219 void RSDisplayRenderNode::UpdateRenderParams()
220 {
221 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
222 if (displayParams == nullptr) {
223 RS_LOGE("RSDisplayRenderNode::UpdateRenderParams displayParams is null");
224 return;
225 }
226 displayParams->offsetX_ = GetDisplayOffsetX();
227 displayParams->offsetY_ = GetDisplayOffsetY();
228 displayParams->nodeRotation_ = GetRotation();
229 auto mirroredNode = GetMirrorSource().lock();
230 if (mirroredNode) {
231 displayParams->mirrorSourceDrawable_ = mirroredNode->GetRenderDrawable();
232 }
233 displayParams->isSecurityExemption_ = isSecurityExemption_;
234 displayParams->mirrorSourceId_ = mirroredNode ? mirroredNode->GetId() : INVALID_NODEID;
235
236 RSRenderNode::UpdateRenderParams();
237 }
238
UpdateScreenRenderParams(ScreenRenderParams & screenRenderParams)239 void RSDisplayRenderNode::UpdateScreenRenderParams(ScreenRenderParams& screenRenderParams)
240 {
241 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
242 if (displayParams == nullptr) {
243 RS_LOGE("RSDisplayRenderNode::UpdateScreenRenderParams displayParams is null");
244 return;
245 }
246 displayParams->screenId_ = GetScreenId();
247 displayParams->screenRotation_ = GetScreenRotation();
248 displayParams->compositeType_ = GetCompositeType();
249 displayParams->isMirrorScreen_ = IsMirrorScreen();
250 displayParams->isSecurityDisplay_ = GetSecurityDisplay();
251 displayParams->screenInfo_ = std::move(screenRenderParams.screenInfo);
252 displayParams->displayHasSecSurface_ = std::move(screenRenderParams.displayHasSecSurface);
253 displayParams->displayHasSkipSurface_ = std::move(screenRenderParams.displayHasSkipSurface);
254 displayParams->displayHasSnapshotSkipSurface_ = std::move(screenRenderParams.displayHasSnapshotSkipSurface);
255 displayParams->displayHasProtectedSurface_ = std::move(screenRenderParams.displayHasProtectedSurface);
256 displayParams->displaySpecailSurfaceChanged_ = std::move(screenRenderParams.displaySpecailSurfaceChanged);
257 displayParams->hasCaptureWindow_ = std::move(screenRenderParams.hasCaptureWindow);
258 }
259
UpdateOffscreenRenderParams(bool needOffscreen)260 void RSDisplayRenderNode::UpdateOffscreenRenderParams(bool needOffscreen)
261 {
262 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
263 if (displayParams == nullptr) {
264 RS_LOGE("RSDisplayRenderNode::UpdateOffscreenRenderParams displayParams is null");
265 return;
266 }
267 displayParams->SetNeedOffscreen(needOffscreen);
268 }
269
UpdatePartialRenderParams()270 void RSDisplayRenderNode::UpdatePartialRenderParams()
271 {
272 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
273 if (displayParams == nullptr) {
274 RS_LOGE("RSDisplayRenderNode::UpdatePartialRenderParams displayParams is null");
275 return;
276 }
277 displayParams->SetAllMainAndLeashSurfaces(curMainAndLeashSurfaceNodes_);
278 }
279
SkipFrame(uint32_t refreshRate,uint32_t skipFrameInterval)280 bool RSDisplayRenderNode::SkipFrame(uint32_t refreshRate, uint32_t skipFrameInterval)
281 {
282 if (refreshRate == 0 || skipFrameInterval <= 1) {
283 return false;
284 }
285 int64_t currentTime = std::chrono::duration_cast<std::chrono::nanoseconds>(
286 std::chrono::steady_clock::now().time_since_epoch()).count();
287 // when refreshRate % skipFrameInterval != 0 means the skipFrameInterval is the virtual screen refresh rate
288 if (refreshRate % skipFrameInterval != 0) {
289 int64_t minFrameInterval = 1000000000LL / skipFrameInterval;
290 if (minFrameInterval == 0) {
291 return false;
292 }
293 // lastRefreshTime_ is next frame expected refresh time for virtual display
294 if (lastRefreshTime_ <= 0) {
295 lastRefreshTime_ = currentTime + minFrameInterval;
296 return false;
297 }
298 if (currentTime < (lastRefreshTime_ - MAX_JITTER_NS)) {
299 return true;
300 }
301 int64_t intervalNums = (currentTime - lastRefreshTime_ + MAX_JITTER_NS) / minFrameInterval;
302 lastRefreshTime_ += (intervalNums + 1) * minFrameInterval;
303 return false;
304 }
305 // the skipFrameInterval is equal to 60 divide the virtual screen refresh rate
306 int64_t refreshInterval = currentTime - lastRefreshTime_;
307 // 1000000000ns == 1s, 110/100 allows 10% over.
308 bool needSkip = refreshInterval < (1000000000LL / refreshRate) * (skipFrameInterval - 1) * 110 / 100;
309 if (!needSkip) {
310 lastRefreshTime_ = currentTime;
311 }
312 return needSkip;
313 }
314
SetDisplayGlobalZOrder(float zOrder)315 void RSDisplayRenderNode::SetDisplayGlobalZOrder(float zOrder)
316 {
317 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
318 if (displayParams == nullptr) {
319 RS_LOGE("RSDisplayRenderNode::SetDisplayGlobalZOrder displayParams is null");
320 return;
321 }
322 displayParams->SetGlobalZOrder(zOrder);
323 }
324
325
GetRotation() const326 ScreenRotation RSDisplayRenderNode::GetRotation() const
327 {
328 auto& boundsGeoPtr = (GetRenderProperties().GetBoundsGeometry());
329 if (boundsGeoPtr == nullptr) {
330 return ScreenRotation::ROTATION_0;
331 }
332 // -90.0f: convert rotation degree to 4 enum values
333 return static_cast<ScreenRotation>(static_cast<int32_t>(std::roundf(boundsGeoPtr->GetRotation() / -90.0f)) % 4);
334 }
335
IsRotationChanged() const336 bool RSDisplayRenderNode::IsRotationChanged() const
337 {
338 auto& boundsGeoPtr = (GetRenderProperties().GetBoundsGeometry());
339 if (boundsGeoPtr == nullptr) {
340 return false;
341 }
342 // boundsGeoPtr->IsNeedClientCompose() return false if rotation degree is times of 90
343 // which means rotation is end.
344 bool isRotationEnd = !boundsGeoPtr->IsNeedClientCompose();
345 return !(ROSEN_EQ(boundsGeoPtr->GetRotation(), lastRotation_) && isRotationEnd);
346 }
347
UpdateRotation()348 void RSDisplayRenderNode::UpdateRotation()
349 {
350 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
351 if (displayParams == nullptr) {
352 RS_LOGE("%{public}s displayParams is nullptr", __func__);
353 return;
354 }
355 AddToPendingSyncList();
356
357 auto& boundsGeoPtr = (GetRenderProperties().GetBoundsGeometry());
358 if (boundsGeoPtr == nullptr) {
359 return;
360 }
361 lastRotationChanged = IsRotationChanged();
362 lastRotation_ = boundsGeoPtr->GetRotation();
363 preRotationStatus_ = curRotationStatus_;
364 curRotationStatus_ = IsRotationChanged();
365 displayParams->SetRotationChanged(curRotationStatus_);
366 }
367
UpdateDisplayDirtyManager(int32_t bufferage,bool useAlignedDirtyRegion)368 void RSDisplayRenderNode::UpdateDisplayDirtyManager(int32_t bufferage, bool useAlignedDirtyRegion)
369 {
370 dirtyManager_->SetBufferAge(bufferage);
371 dirtyManager_->UpdateDirty(useAlignedDirtyRegion);
372 }
373
ClearCurrentSurfacePos()374 void RSDisplayRenderNode::ClearCurrentSurfacePos()
375 {
376 lastFrameSurfacePos_ = std::move(currentFrameSurfacePos_);
377 lastFrameSurfacesByDescZOrder_ = std::move(currentFrameSurfacesByDescZOrder_);
378 }
379
SetMainAndLeashSurfaceDirty(bool isDirty)380 void RSDisplayRenderNode::SetMainAndLeashSurfaceDirty(bool isDirty)
381 {
382 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
383 if (displayParams == nullptr) {
384 RS_LOGE("%{public}s displayParams is nullptr", __func__);
385 return;
386 }
387 displayParams->SetMainAndLeashSurfaceDirty(isDirty);
388 if (stagingRenderParams_->NeedSync()) {
389 AddToPendingSyncList();
390 }
391 }
392
SetHDRPresent(bool hdrPresent)393 void RSDisplayRenderNode::SetHDRPresent(bool hdrPresent)
394 {
395 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
396 if (displayParams == nullptr) {
397 RS_LOGE("%{public}s displayParams is nullptr", __func__);
398 return;
399 }
400 displayParams->SetHDRPresent(hdrPresent);
401 if (stagingRenderParams_->NeedSync()) {
402 AddToPendingSyncList();
403 }
404 }
405
SetBrightnessRatio(float brightnessRatio)406 void RSDisplayRenderNode::SetBrightnessRatio(float brightnessRatio)
407 {
408 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
409 displayParams->SetBrightnessRatio(brightnessRatio);
410 if (stagingRenderParams_->NeedSync()) {
411 AddToPendingSyncList();
412 }
413 }
414
SetColorSpace(const GraphicColorGamut & colorSpace)415 void RSDisplayRenderNode::SetColorSpace(const GraphicColorGamut& colorSpace)
416 {
417 auto displayParams = static_cast<RSDisplayRenderParams*>(stagingRenderParams_.get());
418 if (displayParams == nullptr) {
419 RS_LOGE("%{public}s displayParams is nullptr", __func__);
420 return;
421 }
422 displayParams->SetNewColorSpace(colorSpace);
423 if (stagingRenderParams_->NeedSync()) {
424 AddToPendingSyncList();
425 }
426 colorSpace_ = colorSpace;
427 }
428
GetColorSpace() const429 GraphicColorGamut RSDisplayRenderNode::GetColorSpace() const
430 {
431 return colorSpace_;
432 }
433
GetSortedChildren() const434 RSRenderNode::ChildrenListSharedPtr RSDisplayRenderNode::GetSortedChildren() const
435 {
436 int32_t currentScbPid = GetCurrentScbPid();
437 ChildrenListSharedPtr fullChildrenList = RSRenderNode::GetSortedChildren();
438 if (currentScbPid < 0) {
439 return fullChildrenList;
440 }
441 if (isNeedWaitNewScbPid_) {
442 for (auto it = (*fullChildrenList).rbegin(); it != (*fullChildrenList).rend(); ++it) {
443 auto& child = *it;
444 auto childPid = ExtractPid(child->GetId());
445 if (childPid == currentScbPid) {
446 RS_LOGI("child scb pid equals current scb pid");
447 isNeedWaitNewScbPid_ = false;
448 break;
449 }
450 }
451 }
452 if (isNeedWaitNewScbPid_) {
453 return fullChildrenList;
454 }
455 std::vector<int32_t> oldScbPids = GetOldScbPids();
456 currentChildrenList_->clear();
457 for (auto& child : *fullChildrenList) {
458 if (child == nullptr) {
459 continue;
460 }
461 auto childPid = ExtractPid(child->GetId());
462 auto pidIter = std::find(oldScbPids.begin(), oldScbPids.end(), childPid);
463 if (pidIter != oldScbPids.end()) {
464 child->SetIsOntheTreeOnlyFlag(false);
465 continue;
466 } else if (childPid == currentScbPid) {
467 child->SetIsOntheTreeOnlyFlag(true);
468 }
469 currentChildrenList_->emplace_back(child);
470 }
471 return std::atomic_load_explicit(¤tChildrenList_, std::memory_order_acquire);
472 }
473
GetDisappearedSurfaceRegionBelowCurrent(NodeId currentSurface) const474 Occlusion::Region RSDisplayRenderNode::GetDisappearedSurfaceRegionBelowCurrent(NodeId currentSurface) const
475 {
476 Occlusion::Region result;
477 auto it = std::find_if(lastFrameSurfacesByDescZOrder_.begin(), lastFrameSurfacesByDescZOrder_.end(),
478 [currentSurface](const std::pair<NodeId, RectI>& surface) { return surface.first == currentSurface; });
479 if (it == lastFrameSurfacesByDescZOrder_.end()) {
480 return result;
481 }
482
483 for (++it; it != lastFrameSurfacesByDescZOrder_.end(); ++it) {
484 if (currentFrameSurfacePos_.count(it->first) != 0) {
485 break;
486 }
487 Occlusion::Region disappearedSurface{ Occlusion::Rect{ it->second } };
488 result.OrSelf(disappearedSurface);
489 }
490 return result;
491 }
492
IsZoomStateChange() const493 bool RSDisplayRenderNode::IsZoomStateChange() const
494 {
495 return preZoomState_ != curZoomState_;
496 }
497
SetWindowContainer(std::shared_ptr<RSBaseRenderNode> container)498 void RSDisplayRenderNode::SetWindowContainer(std::shared_ptr<RSBaseRenderNode> container)
499 {
500 if (auto oldContainer = std::exchange(windowContainer_, container)) {
501 if (container) {
502 RS_LOGD("RSDisplayRenderNode::SetWindowContainer oldContainer: %{public}" PRIu64
503 ", newContainer: %{public}" PRIu64, oldContainer->GetId(), container->GetId());
504 } else {
505 RS_LOGD("RSDisplayRenderNode::SetWindowContainer oldContainer: %{public}" PRIu64,
506 oldContainer->GetId());
507 }
508 }
509 }
510
SetScreenStatusNotifyTask(ScreenStatusNotifyTask task)511 void RSDisplayRenderNode::SetScreenStatusNotifyTask(ScreenStatusNotifyTask task)
512 {
513 screenStatusNotifyTask_ = task;
514 }
515
NotifyScreenNotSwitching()516 void RSDisplayRenderNode::NotifyScreenNotSwitching()
517 {
518 if (screenStatusNotifyTask_) {
519 screenStatusNotifyTask_(false);
520 ROSEN_LOGI("RSDisplayRenderNode::NotifyScreenNotSwitching SetScreenSwitchStatus true");
521 RS_TRACE_NAME_FMT("NotifyScreenNotSwitching");
522 }
523 }
524
GetWindowContainer() const525 std::shared_ptr<RSBaseRenderNode> RSDisplayRenderNode::GetWindowContainer() const
526 {
527 return windowContainer_;
528 }
529 } // namespace Rosen
530 } // namespace OHOS
531