From 11c4d98131af488c27295ac069a24b87ab852ce9 Mon Sep 17 00:00:00 2001 From: redermens Date: Mon, 21 Oct 2024 10:20:10 +0800 Subject: [PATCH] fixup ClearResource Error in NotUniRender Signed-off-by: redermens --- .../src/pipeline/rs_canvas_drawing_render_node.cpp | 9 ++++++--- .../render_service_base/src/pipeline/rs_render_node.cpp | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rosen/modules/render_service_base/src/pipeline/rs_canvas_drawing_render_node.cpp b/rosen/modules/render_service_base/src/pipeline/rs_canvas_drawing_render_node.cpp index 93e3daef9d..b74a4f59d7 100644 --- a/rosen/modules/render_service_base/src/pipeline/rs_canvas_drawing_render_node.cpp +++ b/rosen/modules/render_service_base/src/pipeline/rs_canvas_drawing_render_node.cpp @@ -35,6 +35,7 @@ #include "pipeline/rs_paint_filter_canvas.h" #include "pipeline/rs_recording_canvas.h" #include "pipeline/rs_task_dispatcher.h" +#include "pipeline/rs_uni_render_judgement.h" #include "pipeline/sk_resource_manager.h" #include "platform/common/rs_log.h" #include "property/rs_properties_painter.h" @@ -209,7 +210,7 @@ void RSCanvasDrawingRenderNode::ContentStyleSlotUpdate() { //update content_style when node not on tree, need check (waitSync_ false, not on tree, surface not changed) if (IsWaitSync() || IsOnTheTree() || isNeverOnTree_ || !stagingRenderParams_ || - stagingRenderParams_->GetCanvasDrawingSurfaceChanged()) { + stagingRenderParams_->GetCanvasDrawingSurfaceChanged() || RSUniRenderJudgement::IsUniRender()) { return; } @@ -566,8 +567,10 @@ const std::map>& RSCanvasDraw void RSCanvasDrawingRenderNode::ClearResource() { - std::lock_guard lock(drawCmdListsMutex_); - drawCmdLists_.clear(); + if (RSUniRenderJudgement::IsUniRender()) { + std::lock_guard lock(drawCmdListsMutex_); + drawCmdLists_.clear(); + } } void RSCanvasDrawingRenderNode::ClearNeverOnTree() diff --git a/rosen/modules/render_service_base/src/pipeline/rs_render_node.cpp b/rosen/modules/render_service_base/src/pipeline/rs_render_node.cpp index 6e6c46dbb6..c68c987507 100755 --- a/rosen/modules/render_service_base/src/pipeline/rs_render_node.cpp +++ b/rosen/modules/render_service_base/src/pipeline/rs_render_node.cpp @@ -2565,7 +2565,6 @@ void RSRenderNode::UpdateDrawableVecV2() } waitSync_ = true; - ClearResource(); } void RSRenderNode::UpdateDrawableVecInternal(std::unordered_set dirtySlots)