mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 01:00:50 +00:00
!17319 Canvas UIFirst sync error
Merge pull request !17319 from redermens/syncfirst
This commit is contained in:
commit
a0cc051cf2
@ -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_;
|
||||
|
@ -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(
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user