!17319 Canvas UIFirst sync error

Merge pull request !17319 from redermens/syncfirst
This commit is contained in:
openharmony_ci 2024-11-21 12:59:02 +00:00 committed by Gitee
commit a0cc051cf2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 31 additions and 0 deletions

View File

@ -47,6 +47,15 @@ struct DirtyRegionInfoForDFX {
};
struct RSLayerInfo;
struct ScreenInfo;
typedef enum {
RS_PARAM_DEFAULT,
RS_PARAM_OWNED_BY_NODE,
RS_PARAM_OWNED_BY_DRAWABLE,
RS_PARAM_OWNED_BY_DRAWABLE_UIFIRST,
RS_PARAM_INVALID,
} RSRenderParamsType;
class RSB_EXPORT RSRenderParams {
public:
RSRenderParams(NodeId id) : id_(id) {}
@ -98,6 +107,16 @@ public:
return id_;
}
void SetParamsType(RSRenderParamsType paramsType)
{
paramsType_ = paramsType;
}
inline RSRenderParamsType GetParamsType() const
{
return paramsType_;
}
Gravity GetFrameGravity() const
{
return frameGravity_;
@ -320,6 +339,7 @@ protected:
private:
NodeId id_;
RSRenderParamsType paramsType_ = RSRenderParamsType::RS_PARAM_DEFAULT;
RSRenderNodeType renderNodeType_ = RSRenderNodeType::RS_NODE;
Drawing::Matrix matrix_;
Drawing::RectF boundsRect_;

View File

@ -141,6 +141,8 @@ void RSRenderNodeDrawableAdapter::InitRenderParams(const std::shared_ptr<const R
sharedPtr->uifirstRenderParams_ = std::make_unique<RSRenderParams>(sharedPtr->nodeId_);
break;
}
sharedPtr->renderParams_->SetParamsType(RSRenderParamsType::RS_PARAM_OWNED_BY_DRAWABLE);
sharedPtr->uifirstRenderParams_->SetParamsType(RSRenderParamsType::RS_PARAM_OWNED_BY_DRAWABLE_UIFIRST);
}
RSRenderNodeDrawableAdapter::SharedPtr RSRenderNodeDrawableAdapter::OnGenerateShadowDrawable(

View File

@ -413,6 +413,9 @@ void RSRenderParams::OnCanvasDrawingSurfaceChange(const std::unique_ptr<RSRender
target->canvasDrawingNodeSurfaceChanged_ = true;
target->surfaceParams_.width = surfaceParams_.width;
target->surfaceParams_.height = surfaceParams_.height;
if (GetParamsType() == RSRenderParamsType::RS_PARAM_OWNED_BY_DRAWABLE) {
return;
}
canvasDrawingNodeSurfaceChanged_ = false;
}

View File

@ -242,6 +242,9 @@ void RSSurfaceRenderParams::SetBuffer(const sptr<SurfaceBuffer>& buffer, const R
buffer_ = buffer;
damageRect_ = damageRect;
needSync_ = true;
if (GetParamsType() == RSRenderParamsType::RS_PARAM_OWNED_BY_DRAWABLE) {
return;
}
dirtyType_.set(RSRenderParamsDirtyType::BUFFER_INFO_DIRTY);
}
@ -259,6 +262,9 @@ void RSSurfaceRenderParams::SetPreBuffer(const sptr<SurfaceBuffer>& preBuffer)
{
preBuffer_ = preBuffer;
needSync_ = true;
if (GetParamsType() == RSRenderParamsType::RS_PARAM_OWNED_BY_DRAWABLE) {
return;
}
dirtyType_.set(RSRenderParamsDirtyType::BUFFER_INFO_DIRTY);
}