From 54f95a733f5e6ea275408a645ea982c938c518cc Mon Sep 17 00:00:00 2001 From: thelastking Date: Mon, 21 Feb 2022 11:42:16 +0800 Subject: [PATCH] bugfix about lower log level Signed-off-by: thelastking Change-Id: I5a1c9ba503ed56cf91bcf7c264e1bb7ff8afd0d1 --- .../core/pipeline/rs_hardware_processor.cpp | 10 ++++------ .../render_service/core/pipeline/rs_main_thread.cpp | 4 ++-- .../core/pipeline/rs_render_service_connection.cpp | 4 ++++ .../core/pipeline/rs_render_service_util.cpp | 10 +++++++--- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/rosen/modules/render_service/core/pipeline/rs_hardware_processor.cpp b/rosen/modules/render_service/core/pipeline/rs_hardware_processor.cpp index b6ce1790cd..612805d3df 100644 --- a/rosen/modules/render_service/core/pipeline/rs_hardware_processor.cpp +++ b/rosen/modules/render_service/core/pipeline/rs_hardware_processor.cpp @@ -40,10 +40,8 @@ void RSHardwareProcessor::Init(ScreenId id) ROSEN_LOGE("RSHardwareProcessor::Init output_ is nullptr"); return; } - currScreenInfo_ = screenManager_->QueryScreenInfo(id); - ROSEN_LOGI("RSHardwareProcessor::Init screen w:%{public}d, w:%{public}d", - currScreenInfo_.width, currScreenInfo_.height); + ROSEN_LOGI("RSHardwareProcessor::Init screen w:%d, w:%d", currScreenInfo_.width, currScreenInfo_.height); IRect damageRect; damageRect.x = 0; damageRect.y = 0; @@ -114,8 +112,8 @@ void RSHardwareProcessor::CropLayers() void RSHardwareProcessor::ProcessSurface(RSSurfaceRenderNode &node) { - ROSEN_LOGE("RsDebug RSHardwareProcessor::ProcessSurface start node id:%llu available buffer:%d", node.GetId(), - node.GetAvailableBufferCount()); + ROSEN_LOGI("RsDebug RSHardwareProcessor::ProcessSurface start node id:%llu available buffer:%d name:[%s]", + node.GetId(), node.GetAvailableBufferCount(), node.GetName().c_str()); if (!output_) { ROSEN_LOGE("RSHardwareProcessor::ProcessSurface output is nullptr"); return; @@ -129,7 +127,7 @@ void RSHardwareProcessor::ProcessSurface(RSSurfaceRenderNode &node) RSProcessor::SpecialTask task = [] () -> void{}; bool ret = ConsumeAndUpdateBuffer(node, task, cbuffer); if (!ret) { - ROSEN_LOGE("RsDebug RSHardwareProcessor::ProcessSurface consume buffer fail"); + ROSEN_LOGI("RsDebug RSHardwareProcessor::ProcessSurface consume buffer fail"); return; } if (!node.IsBufferAvailable()) { 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 2039f1837a..4db986bc0b 100644 --- a/rosen/modules/render_service/core/pipeline/rs_main_thread.cpp +++ b/rosen/modules/render_service/core/pipeline/rs_main_thread.cpp @@ -42,13 +42,13 @@ RSMainThread::~RSMainThread() noexcept void RSMainThread::Init() { mainLoop_ = [&]() { - ROSEN_LOGE("RsDebug mainLoop start"); + ROSEN_LOGI("RsDebug mainLoop start"); ROSEN_TRACE_BEGIN(BYTRACE_TAG_GRAPHIC_AGP, "RSMainThread::DoComposition"); ProcessCommand(); Animate(timestamp_); Draw(); ROSEN_TRACE_END(BYTRACE_TAG_GRAPHIC_AGP); - ROSEN_LOGE("RsDebug mainLoop end"); + ROSEN_LOGI("RsDebug mainLoop end"); }; threadLooper_ = RSThreadLooper::Create(); diff --git a/rosen/modules/render_service/core/pipeline/rs_render_service_connection.cpp b/rosen/modules/render_service/core/pipeline/rs_render_service_connection.cpp index e5b57a491e..7944bf1ec1 100644 --- a/rosen/modules/render_service/core/pipeline/rs_render_service_connection.cpp +++ b/rosen/modules/render_service/core/pipeline/rs_render_service_connection.cpp @@ -232,6 +232,10 @@ sptr RSRenderServiceConnection::CreateNodeAndSurface(const RSSurfaceRen ROSEN_LOGE("RSRenderService::CreateNodeAndSurface get consumer surface fail"); return nullptr; } + std::string surfaceName; + surface->GetName(surfaceName); + ROSEN_LOGE("RsDebug RSRenderService::CreateNodeAndSurface node id:%llu name:%s surface id:%llu name:%s", + node->GetId(), node->GetName().c_str(), surface->GetUniqueId(), surfaceName.c_str()); node->SetConsumer(surface); std::function registerNode = [node, this]() -> void { this->mainThread_->GetContext().GetMutableNodeMap().RegisterRenderNode(node); diff --git a/rosen/modules/render_service/core/pipeline/rs_render_service_util.cpp b/rosen/modules/render_service/core/pipeline/rs_render_service_util.cpp index 59ebc8ce82..26949d6e0f 100644 --- a/rosen/modules/render_service/core/pipeline/rs_render_service_util.cpp +++ b/rosen/modules/render_service/core/pipeline/rs_render_service_util.cpp @@ -507,10 +507,14 @@ void RsRenderServiceUtil::DrawBuffer(SkCanvas* canvas, sptr ROSEN_LOGE("RsRenderServiceUtil::DrawBuffer buffer is nullptr"); return; } - auto addr = buffer->GetVirAddr(); - if (addr == nullptr || buffer->GetWidth() <= 0 || buffer->GetHeight() <= 0) { - ROSEN_LOGE("RsRenderServiceUtil::DrawBuffer this buffer have no vir add or width or height is negative"); + if (addr == nullptr) { + ROSEN_LOGE("RsRenderServiceUtil::DrawBuffer this buffer have no vir addr"); + return; + } + if (buffer->GetWidth() <= 0 || buffer->GetHeight() <= 0) { + ROSEN_LOGE("RsRenderServiceUtil::DrawBuffer this buffer width or height is negative [%d %d]", + buffer->GetWidth(), buffer->GetHeight()); return; }