1.Using AbsRect in hardware processor 2.Global Z-order

Signed-off-by: AliceGao <gaobinbin3@huawei.com>
Change-Id: I7e31ff8855bec3ad6136426ac361e8d0bdc6cdb1
This commit is contained in:
AliceGao 2022-01-13 11:01:31 +08:00
parent cda3df9c5d
commit d54c74ea5f
3 changed files with 15 additions and 4 deletions

View File

@ -21,6 +21,7 @@
#include "pipeline/rs_render_service_util.h"
#include "platform/common/rs_log.h"
#include "common/rs_obj_abs_geometry.h"
namespace OHOS {
namespace Rosen {
@ -88,6 +89,12 @@ void RSHardwareProcessor::ProcessSurface(RSSurfaceRenderNode &node)
ROSEN_LOGE("RsDebug RSHardwareProcessor::ProcessSurface consume buffer fail");
return;
}
auto geoPtr = std::static_pointer_cast<RSObjAbsGeometry>(node.GetRenderProperties().GetBoundsGeometry());
if (geoPtr == nullptr) {
ROSEN_LOGE("RsDebug RSHardwareProcessor::ProcessSurface geoPtr == nullptr");
return;
}
ComposeInfo info = {
.srcRect = {
.x = 0,
@ -96,10 +103,10 @@ void RSHardwareProcessor::ProcessSurface(RSSurfaceRenderNode &node)
.h = node.GetBuffer()->GetHeight(),
},
.dstRect = {
.x = node.GetRenderProperties().GetBoundsPositionX(),
.y = node.GetRenderProperties().GetBoundsPositionY(),
.w = node.GetRenderProperties().GetBoundsWidth(),
.h = node.GetRenderProperties().GetBoundsHeight(),
.x = geoPtr->GetAbsRect().left_,
.y = geoPtr->GetAbsRect().top_,
.w = geoPtr->GetAbsRect().width_,
.h = geoPtr->GetAbsRect().height_,
},
.zOrder = node.GetRenderProperties().GetPositionZ(),
.alpha = alpha_,

View File

@ -88,6 +88,7 @@ void RSRenderServiceVisitor::PrepareDisplayRenderNode(RSDisplayRenderNode &node)
void RSRenderServiceVisitor::ProcessDisplayRenderNode(RSDisplayRenderNode &node)
{
ROSEN_LOGI("RsDebug RSRenderServiceVisitor::ProcessDisplayRenderNode child size:%d", node.GetChildren().size());
zOrder_ = 0.0;
sptr<RSScreenManager> screenManager = CreateOrGetScreenManager();
if (!screenManager) {
ROSEN_LOGE("RSRenderServiceVisitor::ProcessDisplayRenderNode ScreenManager is nullptr");
@ -156,6 +157,8 @@ void RSRenderServiceVisitor::ProcessSurfaceRenderNode(RSSurfaceRenderNode &node)
ROSEN_LOGE("RSRenderServiceVisitor::ProcessSurfaceRenderNode processor is nullptr");
return;
}
node.GetRenderProperties().SetPositionZ(zOrder_);
zOrder_ = zOrder_ + 1;
processor_->ProcessSurface(node);
ProcessBaseRenderNode(node);
}

View File

@ -43,6 +43,7 @@ public:
void SortZOrder(RSBaseRenderNode &node);
private:
float zOrder_ = 0.0f;
std::shared_ptr<RSProcessor> processor_ = nullptr;
};