diff --git a/rosen/modules/render_service/core/drawable/rs_display_render_node_drawable.cpp b/rosen/modules/render_service/core/drawable/rs_display_render_node_drawable.cpp index 28e2c21115..25e786439d 100644 --- a/rosen/modules/render_service/core/drawable/rs_display_render_node_drawable.cpp +++ b/rosen/modules/render_service/core/drawable/rs_display_render_node_drawable.cpp @@ -514,11 +514,12 @@ void RSDisplayRenderNodeDrawable::ProcessVirtualScreen(RSDisplayRenderNode& disp auto mirroredParams = static_cast(mirroredNode->GetRenderParams().get()); auto hasSecSurface = mirroredParams->GetDisplayHasSecSurface(); auto hasSkipSurface = mirroredParams->GetDisplayHasSkipSurface(); + auto hasProtectedSurface = mirroredParams->GetDisplayHasProtectedSurface(); auto hasCaptureWindow = mirroredParams->GethasCaptureWindow(); auto mirroredProcessor = std::static_pointer_cast(processor); bool hasSpicalLayer = (hasSecSurface[mirroredNode->GetScreenId()] || hasSkipSurface[mirroredNode->GetScreenId()] || - hasCaptureWindow[mirroredNode->GetScreenId()] || !params.GetScreenInfo().filteredAppSet.empty() || - RSMainThread::Instance()->IsCurtainScreenOn()); + hasProtectedSurface[mirroredNode->GetScreenId()] || hasCaptureWindow[mirroredNode->GetScreenId()] || + !params.GetScreenInfo().filteredAppSet.empty() || RSMainThread::Instance()->IsCurtainScreenOn()); if (mirroredNode->GetSecurityDisplay() != displayNodeSp.GetSecurityDisplay() && mirroredProcessor && hasSpicalLayer) { curCanvas_ = mirroredProcessor->GetCanvas(); @@ -713,7 +714,8 @@ void RSDisplayRenderNodeDrawable::OnCapture(Drawing::Canvas& canvas) Drawing::AutoCanvasRestore acr(canvas, true); - if (params->HasSecurityLayer() || params->HasSkipLayer() || params->HasCaptureWindow()) { + if (params->HasSecurityLayer() || params->HasSkipLayer() || + params->HasProtectedLayer() || params->HasCaptureWindow()) { RS_LOGD("RSDisplayRenderNodeDrawable::OnCapture: params %{public}s \ process RSDisplayRenderNode(id:[%{public}" PRIu64 "]) Not using UniRender buffer.", params->ToString().c_str(), params->GetId()); diff --git a/rosen/modules/render_service/core/drawable/rs_surface_render_node_drawable.cpp b/rosen/modules/render_service/core/drawable/rs_surface_render_node_drawable.cpp index aee5c90fce..55ea341e18 100644 --- a/rosen/modules/render_service/core/drawable/rs_surface_render_node_drawable.cpp +++ b/rosen/modules/render_service/core/drawable/rs_surface_render_node_drawable.cpp @@ -371,7 +371,7 @@ void RSSurfaceRenderNodeDrawable::CaptureSingleSurfaceNode(RSSurfaceRenderNode& return; } - if (!(surfaceParams.HasSecurityLayer() || surfaceParams.HasSkipLayer()) && + if (!(surfaceParams.HasSecurityLayer() || surfaceParams.HasSkipLayer() || surfaceParams.HasProtectedLayer()) && DealWithUIFirstCache(surfaceNode, canvas, surfaceParams, *uniParams)) { return; } @@ -391,6 +391,23 @@ void RSSurfaceRenderNodeDrawable::CaptureSingleSurfaceNode(RSSurfaceRenderNode& } else { surfaceParams.ApplyAlphaAndMatrixToCanvas(canvas); } + + if (surfaceParams.GetIsProtectedLayer()) { + RS_LOGD("RSSurfaceRenderNodeDrawable::CaptureSingleSurfaceNode: \ + process RSSurfaceRenderNode(id:[%{public}" PRIu64 "]) clear black since it is protected layer.", + surfaceParams.GetId()); + Drawing::Brush rectBrush; + rectBrush.SetColor(Drawing::Color::COLOR_BLACK); + canvas.AttachBrush(rectBrush); + canvas.DrawRect(Drawing::Rect(0, 0, surfaceParams.GetBounds().GetWidth(), + surfaceParams.GetBounds().GetHeight())); + canvas.DetachBrush(); + if (isSelfDrawingSurface && !surfaceParams.IsSpherizeValid()) { + canvas.Restore(); + } + return; + } + auto parentSurfaceMatrix = RSRenderParams::parentSurfaceMatrix_; RSRenderParams::parentSurfaceMatrix_ = canvas.GetTotalMatrix(); @@ -442,7 +459,7 @@ void RSSurfaceRenderNodeDrawable::CaptureSurfaceInDisplay(RSSurfaceRenderNode& s return; } - if (!(surfaceParams.HasSecurityLayer() || surfaceParams.HasSkipLayer()) && + if (!(surfaceParams.HasSecurityLayer() || surfaceParams.HasSkipLayer() || surfaceParams.HasProtectedLayer()) && DealWithUIFirstCache(surfaceNode, canvas, surfaceParams, *uniParams)) { return; } @@ -455,6 +472,23 @@ void RSSurfaceRenderNodeDrawable::CaptureSurfaceInDisplay(RSSurfaceRenderNode& s } surfaceParams.ApplyAlphaAndMatrixToCanvas(canvas); + + if (surfaceParams.GetIsProtectedLayer()) { + RS_LOGD("RSSurfaceRenderNodeDrawable::CaptureSurfaceInDisplay: \ + process RSSurfaceRenderNode(id:[%{public}" PRIu64 "]) clear black since it is protected layer.", + surfaceParams.GetId()); + Drawing::Brush rectBrush; + rectBrush.SetColor(Drawing::Color::COLOR_BLACK); + canvas.AttachBrush(rectBrush); + canvas.DrawRect(Drawing::Rect(0, 0, surfaceParams.GetBounds().GetWidth(), + surfaceParams.GetBounds().GetHeight())); + canvas.DetachBrush(); + if (isSelfDrawingSurface && !surfaceParams.IsSpherizeValid()) { + canvas.Restore(); + } + return; + } + auto parentSurfaceMatrix = RSRenderParams::parentSurfaceMatrix_; RSRenderParams::parentSurfaceMatrix_ = canvas.GetTotalMatrix(); diff --git a/rosen/modules/render_service/core/pipeline/rs_main_thread.cpp b/rosen/modules/render_service/core/pipeline/rs_main_thread.cpp index 352dd75cb9..7ab4db9f3f 100644 --- a/rosen/modules/render_service/core/pipeline/rs_main_thread.cpp +++ b/rosen/modules/render_service/core/pipeline/rs_main_thread.cpp @@ -1102,6 +1102,14 @@ void RSMainThread::ConsumeAndUpdateAllNodes() } } + const auto& surfaceBuffer = surfaceNode->GetBuffer(); + if (deviceType_ == DeviceType::PHONE && surfaceBuffer && + (surfaceBuffer->GetUsage() & BUFFER_USAGE_PROTECTED)) { + if (!surfaceNode->GetProtectedLayer()) { + surfaceNode->SetProtectedLayer(true); + } + } + // still have buffer(s) to consume. if (surfaceHandler.GetAvailableBufferCount() > 0) { needRequestNextVsync = true; diff --git a/rosen/modules/render_service/core/pipeline/rs_surface_capture_task.cpp b/rosen/modules/render_service/core/pipeline/rs_surface_capture_task.cpp index f465be0abf..4da56f3eb0 100644 --- a/rosen/modules/render_service/core/pipeline/rs_surface_capture_task.cpp +++ b/rosen/modules/render_service/core/pipeline/rs_surface_capture_task.cpp @@ -63,9 +63,9 @@ bool RSSurfaceCaptureTask::Run(sptr callback) pixelmap = CreatePixelMapBySurfaceNode(surfaceNode, visitor_->IsUniRender()); visitor_->IsDisplayNode(false); } else if (auto displayNode = node->ReinterpretCastTo()) { - visitor_->SetHasingSecurityOrSkipLayer(FindSecurityOrSkipLayer()); + visitor_->SetHasingSecurityOrSkipOrProtectedLayer(FindSecurityOrSkipOrProtectedLayer()); pixelmap = CreatePixelMapByDisplayNode(displayNode, visitor_->IsUniRender(), - visitor_->GetHasingSecurityOrSkipLayer()); + visitor_->GetHasingSecurityOrSkipOrProtectedLayer()); visitor_->IsDisplayNode(true); } else { RS_LOGE("RSSurfaceCaptureTask::Run: Invalid RSRenderNodeType!"); @@ -284,7 +284,7 @@ std::unique_ptr RSSurfaceCaptureTask::CreatePixelMapBySurfaceNo } std::unique_ptr RSSurfaceCaptureTask::CreatePixelMapByDisplayNode( - std::shared_ptr node, bool isUniRender, bool hasSecurityOrSkipLayer) + std::shared_ptr node, bool isUniRender, bool hasSecurityOrSkipOrProtectedLayer) { if (node == nullptr) { RS_LOGE("RSSurfaceCaptureTask::CreatePixelMapByDisplayNode: node is nullptr"); @@ -429,22 +429,22 @@ std::shared_ptr RSSurfaceCaptureTask::CreateSurface(const std: return Drawing::Surface::MakeRasterDirect(info, address, pixelmap->GetRowBytes()); } -bool RSSurfaceCaptureTask::FindSecurityOrSkipLayer() +bool RSSurfaceCaptureTask::FindSecurityOrSkipOrProtectedLayer() { const auto& nodeMap = RSMainThread::Instance()->GetContext().GetNodeMap(); - bool hasSecurityOrSkipLayer = false; + bool hasSecurityOrSkipOrProtectedLayer = false; nodeMap.TraverseSurfaceNodes([this, - &hasSecurityOrSkipLayer](const std::shared_ptr& surfaceNode) + &hasSecurityOrSkipOrProtectedLayer](const std::shared_ptr& surfaceNode) mutable { if (surfaceNode == nullptr || !surfaceNode->IsOnTheTree()) { return; } - if (surfaceNode->GetSecurityLayer() || surfaceNode->GetSkipLayer()) { - hasSecurityOrSkipLayer = true; + if (surfaceNode->GetSecurityLayer() || surfaceNode->GetSkipLayer() || surfaceNode->GetProtectedLayer()) { + hasSecurityOrSkipOrProtectedLayer = true; return; } }); - return hasSecurityOrSkipLayer; + return hasSecurityOrSkipOrProtectedLayer; } RSSurfaceCaptureVisitor::RSSurfaceCaptureVisitor(float scaleX, float scaleY, bool isUniRender) @@ -496,7 +496,7 @@ void RSSurfaceCaptureVisitor::ProcessDisplayRenderNode(RSDisplayRenderNode &node if (IsUniRender()) { bool isCurtainScreenOn = RSMainThread::Instance()->IsCurtainScreenOn(); - if (hasSecurityOrSkipLayer_ || isCurtainScreenOn) { + if (hasSecurityOrSkipOrProtectedLayer_ || isCurtainScreenOn) { RS_LOGD("RSSurfaceCaptureVisitor::ProcessDisplayRenderNode: \ process RSDisplayRenderNode(id:[%{public}" PRIu64 "]) Not using UniRender buffer.", node.GetId()); @@ -672,6 +672,20 @@ void RSSurfaceCaptureVisitor::CaptureSingleSurfaceNodeWithUni(RSSurfaceRenderNod return; } + if (node.GetProtectedLayer()) { + RS_LOGD("RSSurfaceCaptureVisitor::CaptureSingleSurfaceNodeWithUni: \ + process RSSurfaceRenderNode(id:[%{public}" PRIu64 "]) clear black since it is protected layer.", + node.GetId()); + Drawing::Brush rectBrush; + rectBrush.SetColor(Drawing::Color::COLOR_BLACK); + canvas_->AttachBrush(rectBrush); + canvas_->DrawRect(Drawing::Rect(0, 0, property.GetBoundsWidth(), property.GetBoundsHeight())); + canvas_->DetachBrush(); + canvas_->Restore(); + canvas_->Restore(); + return; + } + if (isSelfDrawingSurface) { RSPropertiesPainter::DrawBackground(property, *canvas_); RSPropertiesPainter::DrawMask(property, *canvas_); @@ -695,7 +709,7 @@ void RSSurfaceCaptureVisitor::CaptureSingleSurfaceNodeWithUni(RSSurfaceRenderNod canvas_->Restore(); } - if (!node.GetHasSecurityLayer() && !node.GetHasSkipLayer() && + if (!node.GetHasSecurityLayer() && !node.GetHasSkipLayer() && !node.GetProtectedLayer() && isUIFirst_ && RSUniRenderUtil::HandleCaptureNode(node, *canvas_)) { RS_LOGD("RSSurfaceCaptureVisitor::CaptureSingleSurfaceNodeWithUni: \ process RSSurfaceRenderNode [%{public}s, %{public}" PRIu64 "] use cache texture.", @@ -721,7 +735,7 @@ void RSSurfaceCaptureVisitor::CaptureSurfaceInDisplayWithUni(RSSurfaceRenderNode canvas_->SetMatrix(geoPtr->GetAbsMatrix()); } - if (!node.GetHasSecurityLayer() && !node.GetHasSkipLayer() && + if (!node.GetHasSecurityLayer() && !node.GetHasSkipLayer() && !node.GetProtectedLayer() && isUIFirst_ && RSUniRenderUtil::HandleSubThreadNode(node, *canvas_)) { RS_LOGD("RSSurfaceCaptureVisitor::CaptureSurfaceInDisplayWithUni: \ process RSSurfaceRenderNode [%{public}s, %{public}" PRIu64 "] use cache texture.", @@ -729,6 +743,18 @@ void RSSurfaceCaptureVisitor::CaptureSurfaceInDisplayWithUni(RSSurfaceRenderNode return; } + if (node.GetProtectedLayer()) { + RS_LOGD("RSSurfaceCaptureVisitor::CaptureSurfaceInDisplayWithUni: \ + process RSSurfaceRenderNode(id:[%{public}" PRIu64 "]) clear black since it is protected layer.", + node.GetId()); + Drawing::Brush rectBrush; + rectBrush.SetColor(Drawing::Color::COLOR_BLACK); + canvas_->AttachBrush(rectBrush); + canvas_->DrawRect(Drawing::Rect(0, 0, property.GetBoundsWidth(), property.GetBoundsHeight())); + canvas_->DetachBrush(); + return; + } + bool isSelfDrawingSurface = node.GetSurfaceNodeType() == RSSurfaceNodeType::SELF_DRAWING_NODE; if (isSelfDrawingSurface) { canvas_->Save(); diff --git a/rosen/modules/render_service/core/pipeline/rs_surface_capture_task.h b/rosen/modules/render_service/core/pipeline/rs_surface_capture_task.h index 762f1ce3dc..78d6168313 100644 --- a/rosen/modules/render_service/core/pipeline/rs_surface_capture_task.h +++ b/rosen/modules/render_service/core/pipeline/rs_surface_capture_task.h @@ -65,14 +65,14 @@ class RSSurfaceCaptureVisitor : public RSNodeVisitor { return isUniRender_; } - bool GetHasingSecurityOrSkipLayer() const + bool GetHasingSecurityOrSkipOrProtectedLayer() const { - return hasSecurityOrSkipLayer_; + return hasSecurityOrSkipOrProtectedLayer_; } - void SetHasingSecurityOrSkipLayer(const bool &hasSecurityOrSkipLayer) + void SetHasingSecurityOrSkipOrProtectedLayer(const bool &hasSecurityOrSkipOrProtectedLayer) { - hasSecurityOrSkipLayer_ = hasSecurityOrSkipLayer; + hasSecurityOrSkipOrProtectedLayer_ = hasSecurityOrSkipOrProtectedLayer; } private: @@ -100,7 +100,7 @@ class RSSurfaceCaptureVisitor : public RSNodeVisitor { float scaleX_ = 1.0f; float scaleY_ = 1.0f; bool isUniRender_ = false; - bool hasSecurityOrSkipLayer_ = false; + bool hasSecurityOrSkipOrProtectedLayer_ = false; bool isUIFirst_ = false; std::unordered_set curCacheFilterRects_ = {}; @@ -131,9 +131,9 @@ private: bool isUniRender = false); std::unique_ptr CreatePixelMapByDisplayNode(std::shared_ptr node, - bool isUniRender = false, bool hasSecurityOrSkipLayer = false); + bool isUniRender = false, bool hasSecurityOrSkipOrProtectedLayer = false); - bool FindSecurityOrSkipLayer(); + bool FindSecurityOrSkipOrProtectedLayer(); // It is currently only used on folding screen. int32_t ScreenCorrection(ScreenRotation screenRotation); diff --git a/rosen/modules/render_service/core/pipeline/rs_surface_capture_task_parallel.cpp b/rosen/modules/render_service/core/pipeline/rs_surface_capture_task_parallel.cpp index d727346162..f9d69bb70c 100644 --- a/rosen/modules/render_service/core/pipeline/rs_surface_capture_task_parallel.cpp +++ b/rosen/modules/render_service/core/pipeline/rs_surface_capture_task_parallel.cpp @@ -80,9 +80,9 @@ bool RSSurfaceCaptureTaskParallel::Run(sptr callback) pixelmap = CreatePixelMapBySurfaceNode(curNode, visitor_->IsUniRender()); visitor_->IsDisplayNode(false); } else if (auto displayNode = node->ReinterpretCastTo()) { - visitor_->SetHasingSecurityOrSkipLayer(FindSecurityOrSkipLayer()); + visitor_->SetHasingSecurityOrSkipOrProtectedLayer(FindSecurityOrSkipOrProtectedLayer()); pixelmap = CreatePixelMapByDisplayNode(displayNode, visitor_->IsUniRender(), - visitor_->GetHasingSecurityOrSkipLayer()); + visitor_->GetHasingSecurityOrSkipOrProtectedLayer()); visitor_->IsDisplayNode(true); displayNodeDrawable = std::static_pointer_cast( DrawableV2::RSRenderNodeDrawableAdapter::OnGenerate(displayNode)); @@ -381,22 +381,22 @@ std::shared_ptr RSSurfaceCaptureTaskParallel::CreateSurface( return Drawing::Surface::MakeRasterDirect(info, address, pixelmap->GetRowBytes()); } -bool RSSurfaceCaptureTaskParallel::FindSecurityOrSkipLayer() +bool RSSurfaceCaptureTaskParallel::FindSecurityOrSkipOrProtectedLayer() { const auto& nodeMap = RSMainThread::Instance()->GetContext().GetNodeMap(); - bool hasSecurityOrSkipLayer = false; + bool hasSecurityOrSkipOrProtectedLayer = false; nodeMap.TraverseSurfaceNodes([this, - &hasSecurityOrSkipLayer](const std::shared_ptr& surfaceNode) + &hasSecurityOrSkipOrProtectedLayer](const std::shared_ptr& surfaceNode) mutable { if (surfaceNode == nullptr || !surfaceNode->IsOnTheTree()) { return; } - if (surfaceNode->GetSecurityLayer() || surfaceNode->GetSkipLayer()) { - hasSecurityOrSkipLayer = true; + if (surfaceNode->GetSecurityLayer() || surfaceNode->GetSkipLayer() || surfaceNode->GetProtectedLayer()) { + hasSecurityOrSkipOrProtectedLayer = true; return; } }); - return hasSecurityOrSkipLayer; + return hasSecurityOrSkipOrProtectedLayer; } } // namespace Rosen diff --git a/rosen/modules/render_service/core/pipeline/rs_surface_capture_task_parallel.h b/rosen/modules/render_service/core/pipeline/rs_surface_capture_task_parallel.h index 55240bba18..92604163e3 100644 --- a/rosen/modules/render_service/core/pipeline/rs_surface_capture_task_parallel.h +++ b/rosen/modules/render_service/core/pipeline/rs_surface_capture_task_parallel.h @@ -44,7 +44,7 @@ private: std::unique_ptr CreatePixelMapByDisplayNode(std::shared_ptr node, bool isUniRender = false, bool hasSecurityOrSkipLayer = false); - bool FindSecurityOrSkipLayer(); + bool FindSecurityOrSkipOrProtectedLayer(); // It is currently only used on folding screen. int32_t ScreenCorrection(ScreenRotation screenRotation); diff --git a/rosen/modules/render_service/core/pipeline/rs_uni_render_visitor.cpp b/rosen/modules/render_service/core/pipeline/rs_uni_render_visitor.cpp index 169b973a9e..0e88dd66b0 100644 --- a/rosen/modules/render_service/core/pipeline/rs_uni_render_visitor.cpp +++ b/rosen/modules/render_service/core/pipeline/rs_uni_render_visitor.cpp @@ -237,6 +237,7 @@ RSUniRenderVisitor::RSUniRenderVisitor(const RSUniRenderVisitor& visitor) : RSUn screenInfo_ = visitor.screenInfo_; displayHasSecSurface_ = visitor.displayHasSecSurface_; displayHasSkipSurface_ = visitor.displayHasSkipSurface_; + displayHasProtectedSurface_ = visitor.displayHasProtectedSurface_; hasCaptureWindow_ = visitor.hasCaptureWindow_; parentSurfaceNodeMatrix_ = visitor.parentSurfaceNodeMatrix_; curAlpha_ = visitor.curAlpha_; @@ -260,6 +261,7 @@ void RSUniRenderVisitor::CopyVisitorInfos(std::shared_ptr vi screenInfo_ = visitor->screenInfo_; displayHasSecSurface_ = visitor->displayHasSecSurface_; displayHasSkipSurface_ = visitor->displayHasSkipSurface_; + displayHasProtectedSurface_ = visitor->displayHasProtectedSurface_; hasCaptureWindow_ = visitor->hasCaptureWindow_; parentSurfaceNodeMatrix_ = visitor->parentSurfaceNodeMatrix_; curAlpha_ = visitor->curAlpha_; @@ -767,6 +769,7 @@ void RSUniRenderVisitor::PrepareDisplayRenderNode(RSDisplayRenderNode& node) currentVisitDisplay_ = node.GetScreenId(); displayHasSecSurface_.emplace(currentVisitDisplay_, false); displayHasSkipSurface_.emplace(currentVisitDisplay_, false); + displayHasProtectedSurface_.emplace(currentVisitDisplay_, false); hasCaptureWindow_.emplace(currentVisitDisplay_, false); node.GetDirtySurfaceNodeMap().clear(); @@ -1128,7 +1131,7 @@ void RSUniRenderVisitor::PrepareTypesOfSurfaceRenderNodeAfterUpdate(RSSurfaceRen } } -void RSUniRenderVisitor::UpdateSecurityAndSkipLayerRecord(RSSurfaceRenderNode& node) +void RSUniRenderVisitor::UpdateSecuritySkipAndProtectedLayersRecord(RSSurfaceRenderNode& node) { if (node.GetHasSecurityLayer()) { displayHasSecSurface_[currentVisitDisplay_] = true; @@ -1136,6 +1139,9 @@ void RSUniRenderVisitor::UpdateSecurityAndSkipLayerRecord(RSSurfaceRenderNode& n if (node.GetHasSkipLayer() && node.GetName().find(CAPTURE_WINDOW_NAME) == std::string::npos) { displayHasSkipSurface_[currentVisitDisplay_] = true; } + if (node.GetHasProtectedLayer()) { + displayHasProtectedSurface_[currentVisitDisplay_] = true; + } } void RSUniRenderVisitor::UpdateForegroundFilterCacheWithDirty(RSRenderNode& node, @@ -1204,7 +1210,7 @@ void RSUniRenderVisitor::QuickPrepareDisplayRenderNode(RSDisplayRenderNode& node SurfaceOcclusionCallbackToWMS(); curDisplayNode_->UpdatePartialRenderParams(); curDisplayNode_->UpdateScreenRenderParams(screenInfo_, displayHasSecSurface_, displayHasSkipSurface_, - hasCaptureWindow_); + displayHasProtectedSurface_, hasCaptureWindow_); HandleColorGamuts(node, screenManager_); HandlePixelFormat(node, screenManager_); if (UNLIKELY(!SharedTransitionParam::unpairedShareTransitions_.empty())) { @@ -1463,6 +1469,7 @@ bool RSUniRenderVisitor::InitDisplayInfo(RSDisplayRenderNode& node) currentVisitDisplay_ = node.GetScreenId(); displayHasSecSurface_.emplace(currentVisitDisplay_, false); displayHasSkipSurface_.emplace(currentVisitDisplay_, false); + displayHasProtectedSurface_.emplace(currentVisitDisplay_, false); hasCaptureWindow_.emplace(currentVisitDisplay_, false); curDisplayDirtyManager_ = node.GetDirtyManager(); curDisplayNode_ = node.shared_from_this()->ReinterpretCastTo(); @@ -1530,7 +1537,7 @@ bool RSUniRenderVisitor::BeforeUpdateSurfaceDirtyCalc(RSSurfaceRenderNode& node) } // only need collect first level node's security & skip layer info if (node.GetId() == node.GetFirstLevelNodeId()) { - UpdateSecurityAndSkipLayerRecord(node); + UpdateSecuritySkipAndProtectedLayersRecord(node); } if (node.IsMainWindowType() || node.IsLeashWindow()) { // UpdateCurCornerRadius must process before curSurfaceNode_ update @@ -2481,7 +2488,7 @@ void RSUniRenderVisitor::PrepareSurfaceRenderNode(RSSurfaceRenderNode& node) CheckPixelFormat(node); // only need collect first level node's security & skip layer info if (nodeId == node.GetFirstLevelNodeId()) { - UpdateSecurityAndSkipLayerRecord(node); + UpdateSecuritySkipAndProtectedLayersRecord(node); } // stop traversal if node keeps static if (isQuickSkipPreparationEnabled_ && CheckIfSurfaceRenderNodeStatic(node)) { @@ -3582,8 +3589,9 @@ void RSUniRenderVisitor::ProcessDisplayRenderNode(RSDisplayRenderNode& node) auto processor = std::static_pointer_cast(processor_); if (mirrorNode->GetSecurityDisplay() != isSecurityDisplay_ && processor && (hasCaptureWindow_[mirrorNode->GetScreenId()] || displayHasSecSurface_[mirrorNode->GetScreenId()] || - displayHasSkipSurface_[mirrorNode->GetScreenId()] || !screenInfo_.filteredAppSet.empty() || - isCurtainScreenOn_)) { + displayHasSkipSurface_[mirrorNode->GetScreenId()] || + displayHasProtectedSurface_[mirrorNode->GetScreenId()] || + !screenInfo_.filteredAppSet.empty() || isCurtainScreenOn_)) { if (isPc_&& hasCaptureWindow_[mirrorNode->GetScreenId()]) { processor->MirrorScenePerf(); } @@ -3603,7 +3611,8 @@ void RSUniRenderVisitor::ProcessDisplayRenderNode(RSDisplayRenderNode& node) std::shared_ptr cacheImageProcessed = GetCacheImageFromMirrorNode(mirrorNode); bool canvasRotation = screenManager->GetCanvasRotation(node.GetScreenId()); if (cacheImageProcessed && !displayHasSkipSurface_[mirrorNode->GetScreenId()] && - !displayHasSecSurface_[mirrorNode->GetScreenId()] && screenInfo_.filteredAppSet.empty()) { + !displayHasSecSurface_[mirrorNode->GetScreenId()] && + !displayHasProtectedSurface_[mirrorNode->GetScreenId()] && screenInfo_.filteredAppSet.empty()) { RS_LOGD("RSUniRenderVisitor::ProcessDisplayRenderNode screen recording optimization is enable"); ScaleMirrorIfNeed(node, canvasRotation); RotateMirrorCanvasIfNeed(node, canvasRotation); @@ -4070,7 +4079,8 @@ void RSUniRenderVisitor::AssignGlobalZOrderAndCreateLayer( iter = childHardwareEnabledNodes.erase(iter); continue; } - if (childNode->GetBuffer() != nullptr && !childNode->IsHardwareForcedDisabled()) { + if (childNode->GetBuffer() != nullptr && + (!childNode->IsHardwareForcedDisabled() || childNode->GetProtectedLayer())) { // SetGlobalZOrder here to ensure zOrder committed to composer is continuous childNode->SetGlobalZOrder(globalZOrder_++); RS_LOGD("createLayer: %{public}" PRIu64 "", childNode->GetId()); @@ -5036,7 +5046,7 @@ bool RSUniRenderVisitor::ForceHardwareComposer(RSSurfaceRenderNode& node) const !isUpdateCachedSurface_; } -bool RSUniRenderVisitor::UpdateSrcRectForHwcNode(RSSurfaceRenderNode& node) +bool RSUniRenderVisitor::UpdateSrcRectForHwcNode(RSSurfaceRenderNode& node, bool isProtected) { Drawing::AutoCanvasRestore acr(*canvas_.get(), true); @@ -5055,7 +5065,7 @@ bool RSUniRenderVisitor::UpdateSrcRectForHwcNode(RSSurfaceRenderNode& node) hasRotation = rotation == GRAPHIC_ROTATE_90 || rotation == GRAPHIC_ROTATE_270; } node.UpdateSrcRect(*canvas_, dst, hasRotation); - return !node.IsHardwareDisabledBySrcRect(); + return isProtected ? true : !node.IsHardwareDisabledBySrcRect(); } void RSUniRenderVisitor::ProcessSurfaceRenderNode(RSSurfaceRenderNode& node) @@ -5163,6 +5173,15 @@ void RSUniRenderVisitor::ProcessSurfaceRenderNode(RSSurfaceRenderNode& node) } } + if (isSecurityDisplay_ && node.GetProtectedLayer()) { + Drawing::Brush rectBrush; + rectBrush.SetColor(Drawing::Color::COLOR_BLACK); + canvas_->AttachBrush(rectBrush); + canvas_->DrawRect(Drawing::Rect(0, 0, property.GetBoundsWidth(), property.GetBoundsHeight())); + canvas_->DetachBrush(); + return; + } + // when surfacenode named "CapsuleWindow", cache the current canvas as SkImage for screen recording if (!isSecurityDisplay_ && canvas_->GetSurface() != nullptr && node.GetName().find(CAPTURE_WINDOW_NAME) != std::string::npos) { @@ -5256,8 +5275,9 @@ void RSUniRenderVisitor::ProcessSurfaceRenderNode(RSSurfaceRenderNode& node) IsHardwareComposerEnabled(), node.IsHardwareForcedDisabled()); } // if this window is in freeze state, disable hardware composer for its child surfaceView - if (IsHardwareComposerEnabled() && node.IsHardwareEnabledType() && (!node.IsHardwareForcedDisabled() || - ForceHardwareComposer(node)) && UpdateSrcRectForHwcNode(node)) { + if (IsHardwareComposerEnabled() && UpdateSrcRectForHwcNode(node, node.GetProtectedLayer()) && + (node.GetProtectedLayer() || (node.IsHardwareEnabledType() && (!node.IsHardwareForcedDisabled() || + ForceHardwareComposer(node))))) { if (!node.IsHardwareEnabledTopSurface()) { canvas_->Clear(Drawing::Color::COLOR_TRANSPARENT); } diff --git a/rosen/modules/render_service/core/pipeline/rs_uni_render_visitor.h b/rosen/modules/render_service/core/pipeline/rs_uni_render_visitor.h index f436d337e9..5036cb1e66 100644 --- a/rosen/modules/render_service/core/pipeline/rs_uni_render_visitor.h +++ b/rosen/modules/render_service/core/pipeline/rs_uni_render_visitor.h @@ -367,7 +367,7 @@ private: // mark surfaceNode's child surfaceView nodes hardware forced disabled void MarkSubHardwareEnableNodeState(RSSurfaceRenderNode& surfaceNode); void CollectAppNodeForHwc(std::shared_ptr surfaceNode); - void UpdateSecurityAndSkipLayerRecord(RSSurfaceRenderNode& node); + void UpdateSecuritySkipAndProtectedLayersRecord(RSSurfaceRenderNode& node); void PrepareEffectNodeIfCacheReuse(const std::shared_ptr& cacheRootNode, std::shared_ptr effectNode); @@ -381,7 +381,7 @@ private: bool IsFirstVisitedCacheForced() const; bool IsRosenWebHardwareDisabled(RSSurfaceRenderNode& node, int rotation) const; bool ForceHardwareComposer(RSSurfaceRenderNode& node) const; - bool UpdateSrcRectForHwcNode(RSSurfaceRenderNode& node); // return if srcRect is allowed by dss restriction + bool UpdateSrcRectForHwcNode(RSSurfaceRenderNode& node, bool isProtected = false); // return if srcRect is allowed by dss restriction std::shared_ptr GetCacheImageFromMirrorNode(std::shared_ptr mirrorNode); void SwitchColorFilterDrawing(int currentSaveCount); @@ -443,6 +443,7 @@ private: ScreenId currentVisitDisplay_ = INVALID_SCREEN_ID; std::map displayHasSecSurface_; std::map displayHasSkipSurface_; + std::map displayHasProtectedSurface_; std::map hasCaptureWindow_; std::set mirroredDisplays_; bool isSecurityDisplay_ = false; diff --git a/rosen/modules/render_service_base/include/params/rs_display_render_params.h b/rosen/modules/render_service_base/include/params/rs_display_render_params.h index 6c26895220..40392724cd 100644 --- a/rosen/modules/render_service_base/include/params/rs_display_render_params.h +++ b/rosen/modules/render_service_base/include/params/rs_display_render_params.h @@ -78,6 +78,10 @@ public: { return displayHasSkipSurface_; } + const std::map& GetDisplayHasProtectedSurface() const + { + return displayHasProtectedSurface_; + } const std::map& GethasCaptureWindow() const { return hasCaptureWindow_; @@ -94,6 +98,7 @@ public: bool GetMainAndLeashSurfaceDirty() const; bool HasSecurityLayer(); bool HasSkipLayer(); + bool HasProtectedLayer(); bool HasCaptureWindow(); void SetRotationChanged(bool changed); @@ -105,6 +110,7 @@ public: private: std::map displayHasSecSurface_; std::map displayHasSkipSurface_; + std::map displayHasProtectedSurface_; std::map hasCaptureWindow_; std::vector allMainAndLeashSurfaces_; int32_t offsetX_ = -1; diff --git a/rosen/modules/render_service_base/include/params/rs_surface_render_params.h b/rosen/modules/render_service_base/include/params/rs_surface_render_params.h index c866cd0d9a..ff962283ea 100644 --- a/rosen/modules/render_service_base/include/params/rs_surface_render_params.h +++ b/rosen/modules/render_service_base/include/params/rs_surface_render_params.h @@ -110,6 +110,10 @@ public: { return isSkipLayer_; } + bool GetIsProtectedLayer() const + { + return isProtectedLayer_; + } const std::set& GetSecurityLayerIds() const { return securityLayerIds_; @@ -126,6 +130,10 @@ public: { return skipLayerIds_.size() != 0; } + bool HasProtectedLayer() + { + return protectedLayerIds_.size() != 0; + } std::string GetName() const { @@ -259,8 +267,10 @@ private: bool isLastFrameHardwareEnabled_ = false; bool isSecurityLayer_ = false; bool isSkipLayer_ = false; + bool isProtectedLayer_ = false; std::set skipLayerIds_= {}; std::set securityLayerIds_= {}; + std::set protectedLayerIds_= {}; std::set bufferCacheSet_ = {}; std::string name_= ""; diff --git a/rosen/modules/render_service_base/include/pipeline/rs_display_render_node.h b/rosen/modules/render_service_base/include/pipeline/rs_display_render_node.h index 3c734f8c3f..dee21880a9 100644 --- a/rosen/modules/render_service_base/include/pipeline/rs_display_render_node.h +++ b/rosen/modules/render_service_base/include/pipeline/rs_display_render_node.h @@ -261,7 +261,8 @@ public: void UpdateRenderParams() override; void UpdatePartialRenderParams(); void UpdateScreenRenderParams(ScreenInfo& screenInfo, std::map& displayHasSecSurface, - std::map& displayHasSkipSurface, std::map& hasCaptureWindow); + std::map& displayHasSkipSurface, std::map& displayHasProtectedSurface, + std::map& hasCaptureWindow); void RecordMainAndLeashSurfaces(RSBaseRenderNode::SharedPtr surface); std::vector& GetAllMainAndLeashSurfaces() { return curMainAndLeashSurfaceNodes_;} diff --git a/rosen/modules/render_service_base/include/pipeline/rs_surface_render_node.h b/rosen/modules/render_service_base/include/pipeline/rs_surface_render_node.h index 1b6aa5f02c..f2a9773176 100644 --- a/rosen/modules/render_service_base/include/pipeline/rs_surface_render_node.h +++ b/rosen/modules/render_service_base/include/pipeline/rs_surface_render_node.h @@ -426,17 +426,21 @@ public: void SetSecurityLayer(bool isSecurityLayer); void SetSkipLayer(bool isSkipLayer); + void SetProtectedLayer(bool isProtectedLayer); // get whether it is a security/skip layer itself bool GetSecurityLayer() const; bool GetSkipLayer() const; + bool GetProtectedLayer() const; // get whether it and it's subtree contain security layer bool GetHasSecurityLayer() const; bool GetHasSkipLayer() const; + bool GetHasProtectedLayer() const; void SyncSecurityInfoToFirstLevelNode(); void SyncSkipInfoToFirstLevelNode(); + void SyncProtectedInfoToFirstLevelNode(); void SetFingerprint(bool hasFingerprint); bool GetFingerprint() const; @@ -1088,8 +1092,10 @@ private: bool isSecurityLayer_ = false; bool isSkipLayer_ = false; + bool isProtectedLayer_ = false; std::set skipLayerIds_= {}; std::set securityLayerIds_= {}; + std::set protectedLayerIds_= {}; bool hasFingerprint_ = false; RectI srcRect_; diff --git a/rosen/modules/render_service_base/src/params/rs_display_render_params.cpp b/rosen/modules/render_service_base/src/params/rs_display_render_params.cpp index 79ee3da4c8..178c65f1d1 100644 --- a/rosen/modules/render_service_base/src/params/rs_display_render_params.cpp +++ b/rosen/modules/render_service_base/src/params/rs_display_render_params.cpp @@ -68,6 +68,7 @@ void RSDisplayRenderParams::OnSync(const std::unique_ptr& target targetDisplayParams->allMainAndLeashSurfaces_ = allMainAndLeashSurfaces_; targetDisplayParams->displayHasSecSurface_ = displayHasSecSurface_; targetDisplayParams->displayHasSkipSurface_ = displayHasSkipSurface_; + targetDisplayParams->displayHasProtectedSurface_ = displayHasProtectedSurface_; targetDisplayParams->hasCaptureWindow_ = hasCaptureWindow_; targetDisplayParams->offsetX_ = offsetX_; targetDisplayParams->offsetY_ = offsetY_; @@ -119,6 +120,16 @@ bool RSDisplayRenderParams::HasSkipLayer() return hasSkipLayerFlag; } +bool RSDisplayRenderParams::HasProtectedLayer() +{ + bool hasProtectedLayerFlag = false; + auto iter = displayHasProtectedSurface_.find(screenId_); + if (iter != displayHasProtectedSurface_.end()) { + hasProtectedLayerFlag = iter->second; + } + return hasProtectedLayerFlag; +} + bool RSDisplayRenderParams::HasCaptureWindow() { bool hasCaptureWindow = false; diff --git a/rosen/modules/render_service_base/src/params/rs_surface_render_params.cpp b/rosen/modules/render_service_base/src/params/rs_surface_render_params.cpp index eb7e4b0dfb..ebcf8e5639 100644 --- a/rosen/modules/render_service_base/src/params/rs_surface_render_params.cpp +++ b/rosen/modules/render_service_base/src/params/rs_surface_render_params.cpp @@ -232,8 +232,10 @@ void RSSurfaceRenderParams::OnSync(const std::unique_ptr& target targetSurfaceParams->isOccludedByFilterCache_ = isOccludedByFilterCache_; targetSurfaceParams->isSecurityLayer_ = isSecurityLayer_; targetSurfaceParams->isSkipLayer_ = isSkipLayer_; + targetSurfaceParams->isProtectedLayer_ = isProtectedLayer_; targetSurfaceParams->skipLayerIds_= skipLayerIds_; targetSurfaceParams->securityLayerIds_= securityLayerIds_; + targetSurfaceParams->protectedLayerIds_ = protectedLayerIds_; targetSurfaceParams->name_ = name_; targetSurfaceParams->surfaceCacheContentStatic_ = surfaceCacheContentStatic_; targetSurfaceParams->bufferCacheSet_ = bufferCacheSet_; diff --git a/rosen/modules/render_service_base/src/pipeline/rs_display_render_node.cpp b/rosen/modules/render_service_base/src/pipeline/rs_display_render_node.cpp index 38cc5f80e1..49f335bcdc 100644 --- a/rosen/modules/render_service_base/src/pipeline/rs_display_render_node.cpp +++ b/rosen/modules/render_service_base/src/pipeline/rs_display_render_node.cpp @@ -206,7 +206,7 @@ void RSDisplayRenderNode::UpdateRenderParams() void RSDisplayRenderNode::UpdateScreenRenderParams(ScreenInfo& screenInfo, std::map& displayHasSecSurface, std::map& displayHasSkipSurface, - std::map& hasCaptureWindow) + std::map& displayHasProtectedSurface, std::map& hasCaptureWindow) { auto displayParams = static_cast(stagingRenderParams_.get()); if (displayParams == nullptr) { @@ -219,6 +219,7 @@ void RSDisplayRenderNode::UpdateScreenRenderParams(ScreenInfo& screenInfo, displayParams->screenInfo_ = std::move(screenInfo); displayParams->displayHasSecSurface_ = std::move(displayHasSecSurface); displayParams->displayHasSkipSurface_ = std::move(displayHasSkipSurface); + displayParams->displayHasProtectedSurface_ = std::move(displayHasProtectedSurface); displayParams->hasCaptureWindow_ = std::move(hasCaptureWindow); } diff --git a/rosen/modules/render_service_base/src/pipeline/rs_surface_render_node.cpp b/rosen/modules/render_service_base/src/pipeline/rs_surface_render_node.cpp index 1e856c5faf..de559de442 100644 --- a/rosen/modules/render_service_base/src/pipeline/rs_surface_render_node.cpp +++ b/rosen/modules/render_service_base/src/pipeline/rs_surface_render_node.cpp @@ -209,7 +209,8 @@ bool RSSurfaceRenderNode::ShouldPrepareSubnodes() void RSSurfaceRenderNode::StoreMustRenewedInfo() { - mustRenewedInfo_ = RSRenderNode::HasMustRenewedInfo() || GetHasSecurityLayer() || GetHasSkipLayer(); + mustRenewedInfo_ = RSRenderNode::HasMustRenewedInfo() || GetHasSecurityLayer() || + GetHasSkipLayer() || GetHasProtectedLayer(); } std::string RSSurfaceRenderNode::DirtyRegionDump() const @@ -393,6 +394,7 @@ void RSSurfaceRenderNode::OnTreeStateChanged() // sync skip & security info SyncSecurityInfoToFirstLevelNode(); SyncSkipInfoToFirstLevelNode(); + SyncProtectedInfoToFirstLevelNode(); } void RSSurfaceRenderNode::OnResetParent() @@ -670,6 +672,18 @@ void RSSurfaceRenderNode::SetSkipLayer(bool isSkipLayer) SyncSkipInfoToFirstLevelNode(); } +void RSSurfaceRenderNode::SetProtectedLayer(bool isProtectedLayer) +{ + isProtectedLayer_ = isProtectedLayer; + SetDirty(); + if (isProtectedLayer) { + protectedLayerIds_.insert(GetId()); + } else { + protectedLayerIds_.erase(GetId()); + } + SyncProtectedInfoToFirstLevelNode(); +} + bool RSSurfaceRenderNode::GetSecurityLayer() const { return isSecurityLayer_; @@ -681,6 +695,11 @@ bool RSSurfaceRenderNode::GetSkipLayer() const return isSkipLayer_; } +bool RSSurfaceRenderNode::GetProtectedLayer() const +{ + return isProtectedLayer_; +} + bool RSSurfaceRenderNode::GetHasSecurityLayer() const { return securityLayerIds_.size() != 0; @@ -691,6 +710,10 @@ bool RSSurfaceRenderNode::GetHasSkipLayer() const return skipLayerIds_.size() != 0; } +bool RSSurfaceRenderNode::GetHasProtectedLayer() const +{ + return protectedLayerIds_.size() != 0; +} void RSSurfaceRenderNode::SyncSecurityInfoToFirstLevelNode() { @@ -732,6 +755,23 @@ void RSSurfaceRenderNode::SyncSkipInfoToFirstLevelNode() } } +void RSSurfaceRenderNode::SyncProtectedInfoToFirstLevelNode() +{ + if (isProtectedLayer_) { + auto firstLevelNode = RSBaseRenderNode::ReinterpretCast(GetFirstLevelNode()); + // firstLevelNode is the nearest app window / leash node + if (firstLevelNode && GetFirstLevelNodeId() != GetId()) { + firstLevelNode->SetDirty(); + // should always sync protectedLayerIds_ to firstLevelNode + if (isProtectedLayer_ && IsOnTheTree()) { + firstLevelNode->protectedLayerIds_.insert(GetId()); + } else { + firstLevelNode->protectedLayerIds_.erase(GetId()); + } + } + } +} + void RSSurfaceRenderNode::SetFingerprint(bool hasFingerprint) { hasFingerprint_ = hasFingerprint; @@ -2336,8 +2376,10 @@ void RSSurfaceRenderNode::UpdateRenderParams() surfaceParams->SetAncestorDisplayNode(ancestorDisplayNode_); surfaceParams->isSecurityLayer_ = isSecurityLayer_; surfaceParams->isSkipLayer_ = isSkipLayer_; + surfaceParams->isProtectedLayer_ = isProtectedLayer_; surfaceParams->skipLayerIds_= skipLayerIds_; surfaceParams->securityLayerIds_= securityLayerIds_; + surfaceParams->protectedLayerIds_= protectedLayerIds_; surfaceParams->name_= name_; surfaceParams->positionZ_ = properties.GetPositionZ(); surfaceParams->SetNeedSync(true); diff --git a/rosen/test/render_service/render_service/unittest/pipeline/rs_surface_capture_task_test.cpp b/rosen/test/render_service/render_service/unittest/pipeline/rs_surface_capture_task_test.cpp index f3a8f068f5..054bf425f8 100644 --- a/rosen/test/render_service/render_service/unittest/pipeline/rs_surface_capture_task_test.cpp +++ b/rosen/test/render_service/render_service/unittest/pipeline/rs_surface_capture_task_test.cpp @@ -431,18 +431,18 @@ HWTEST_F(RSSurfaceCaptureTaskTest, CreateSurface002, Function | SmallTest | Leve } /* - * @tc.name: FindSecurityOrSkipLayer001 + * @tc.name: FindSecurityOrSkipOrProtectedLayer001 * @tc.desc: Test RSSurfaceCaptureTaskTest.CreateSurface002 * @tc.type: FUNC * @tc.require: issueI794H6 */ -HWTEST_F(RSSurfaceCaptureTaskTest, FindSecurityOrSkipLayer001, Function | SmallTest | Level2) +HWTEST_F(RSSurfaceCaptureTaskTest, FindSecurityOrSkipOrProtectedLayer001, Function | SmallTest | Level2) { NodeId id = 0; float scaleX = 0.f; float scaleY = 0.f; RSSurfaceCaptureTask task(id, scaleX, scaleY); - EXPECT_EQ(false, task.FindSecurityOrSkipLayer()); + EXPECT_EQ(false, task.FindSecurityOrSkipOrProtectedLayer()); } /* @@ -978,13 +978,13 @@ HWTEST_F(RSSurfaceCaptureTaskTest, ProcessDisplayRenderNode002, Function | Small HWTEST_F(RSSurfaceCaptureTaskTest, ProcessDisplayRenderNode003, Function | SmallTest | Level2) { ASSERT_NE(nullptr, visitor_); - auto hasSecurityOrSkipLayer = visitor_->hasSecurityOrSkipLayer_; - visitor_->hasSecurityOrSkipLayer_ = true; + auto hasSecurityOrSkipOrProtectedLayer = visitor_->hasSecurityOrSkipOrProtectedLayer_; + visitor_->hasSecurityOrSkipOrProtectedLayer_ = true; NodeId id = 1; RSDisplayNodeConfig config; RSDisplayRenderNode node(id, config); visitor_->ProcessDisplayRenderNode(node); - visitor_->hasSecurityOrSkipLayer_ = hasSecurityOrSkipLayer; + visitor_->hasSecurityOrSkipOrProtectedLayer_ = hasSecurityOrSkipOrProtectedLayer; } /* @@ -996,8 +996,8 @@ HWTEST_F(RSSurfaceCaptureTaskTest, ProcessDisplayRenderNode003, Function | Small HWTEST_F(RSSurfaceCaptureTaskTest, ProcessDisplayRenderNode004, Function | SmallTest | Level2) { ASSERT_NE(nullptr, visitor_); - auto hasSecurityOrSkipLayer = visitor_->hasSecurityOrSkipLayer_; - visitor_->hasSecurityOrSkipLayer_ = true; + auto hasSecurityOrSkipOrProtectedLayer = visitor_->hasSecurityOrSkipOrProtectedLayer_; + visitor_->hasSecurityOrSkipOrProtectedLayer_ = true; NodeId id = 1; RSDisplayNodeConfig config; RSDisplayRenderNode node(id, config); @@ -1009,7 +1009,7 @@ HWTEST_F(RSSurfaceCaptureTaskTest, ProcessDisplayRenderNode004, Function | Small sptr buffer = new SurfaceBufferImpl(0); node.SetBuffer(buffer, acquireFence, damage, timestamp); visitor_->ProcessDisplayRenderNode(node); - visitor_->hasSecurityOrSkipLayer_ = hasSecurityOrSkipLayer; + visitor_->hasSecurityOrSkipOrProtectedLayer_ = hasSecurityOrSkipOrProtectedLayer; } /* @@ -1066,12 +1066,12 @@ HWTEST_F(RSSurfaceCaptureTaskTest, AdjustZOrderAndDrawSurfaceNode, Function | Sm } /* - * @tc.name: FindSecurityOrSkipLayer - * @tc.desc: Test RSSurfaceCaptureTaskTest.FindSecurityOrSkipLayer + * @tc.name: FindSecurityOrSkipOrProtectedLayer + * @tc.desc: Test RSSurfaceCaptureTaskTest.FindSecurityOrSkipOrProtectedLayer * @tc.type: FUNC * @tc.require: issueI7G9F0 */ -HWTEST_F(RSSurfaceCaptureTaskTest, FindSecurityOrSkipLayer, Function | SmallTest | Level2) +HWTEST_F(RSSurfaceCaptureTaskTest, FindSecurityOrSkipOrProtectedLayer, Function | SmallTest | Level2) { float scaleX = 0.f; float scaleY = 0.f; @@ -1090,7 +1090,7 @@ HWTEST_F(RSSurfaceCaptureTaskTest, FindSecurityOrSkipLayer, Function | SmallTest node3->SetIsOnTheTree(true); node3->isSecurityLayer_ = true; nodeMap.surfaceNodeMap_[3] = node3; - ASSERT_TRUE(task.FindSecurityOrSkipLayer()); + ASSERT_TRUE(task.FindSecurityOrSkipOrProtectedLayer()); nodeMap.surfaceNodeMap_.clear(); }