fixup ClearResource Error in NotUniRender

Signed-off-by: redermens <zhangpeng516@h-partners.com>
This commit is contained in:
redermens 2024-10-21 10:20:10 +08:00
parent 5bcf860d2a
commit 11c4d98131
2 changed files with 6 additions and 4 deletions

View File

@ -35,6 +35,7 @@
#include "pipeline/rs_paint_filter_canvas.h" #include "pipeline/rs_paint_filter_canvas.h"
#include "pipeline/rs_recording_canvas.h" #include "pipeline/rs_recording_canvas.h"
#include "pipeline/rs_task_dispatcher.h" #include "pipeline/rs_task_dispatcher.h"
#include "pipeline/rs_uni_render_judgement.h"
#include "pipeline/sk_resource_manager.h" #include "pipeline/sk_resource_manager.h"
#include "platform/common/rs_log.h" #include "platform/common/rs_log.h"
#include "property/rs_properties_painter.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) //update content_style when node not on tree, need check (waitSync_ false, not on tree, surface not changed)
if (IsWaitSync() || IsOnTheTree() || isNeverOnTree_ || !stagingRenderParams_ || if (IsWaitSync() || IsOnTheTree() || isNeverOnTree_ || !stagingRenderParams_ ||
stagingRenderParams_->GetCanvasDrawingSurfaceChanged()) { stagingRenderParams_->GetCanvasDrawingSurfaceChanged() || RSUniRenderJudgement::IsUniRender()) {
return; return;
} }
@ -566,8 +567,10 @@ const std::map<RSModifierType, std::list<Drawing::DrawCmdListPtr>>& RSCanvasDraw
void RSCanvasDrawingRenderNode::ClearResource() void RSCanvasDrawingRenderNode::ClearResource()
{ {
std::lock_guard<std::mutex> lock(drawCmdListsMutex_); if (RSUniRenderJudgement::IsUniRender()) {
drawCmdLists_.clear(); std::lock_guard<std::mutex> lock(drawCmdListsMutex_);
drawCmdLists_.clear();
}
} }
void RSCanvasDrawingRenderNode::ClearNeverOnTree() void RSCanvasDrawingRenderNode::ClearNeverOnTree()

View File

@ -2565,7 +2565,6 @@ void RSRenderNode::UpdateDrawableVecV2()
} }
waitSync_ = true; waitSync_ = true;
ClearResource();
} }
void RSRenderNode::UpdateDrawableVecInternal(std::unordered_set<RSPropertyDrawableSlot> dirtySlots) void RSRenderNode::UpdateDrawableVecInternal(std::unordered_set<RSPropertyDrawableSlot> dirtySlots)