mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-24 07:30:38 +00:00
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:
parent
cda3df9c5d
commit
d54c74ea5f
@ -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_,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
void SortZOrder(RSBaseRenderNode &node);
|
||||
|
||||
private:
|
||||
float zOrder_ = 0.0f;
|
||||
std::shared_ptr<RSProcessor> processor_ = nullptr;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user