diff --git a/frameworks/core/components_ng/pattern/image/image_dfx.h b/frameworks/core/components_ng/pattern/image/image_dfx.h index 40316f7ca607472e208dc233627f298ce8535ce6..9b1ce779135b444fa044c72568da0134322b9bba 100644 --- a/frameworks/core/components_ng/pattern/image/image_dfx.h +++ b/frameworks/core/components_ng/pattern/image/image_dfx.h @@ -31,8 +31,8 @@ struct ImageNodeId { class ImageDfxConfig { public: ImageDfxConfig( - const ImageNodeId& nodeInfo, int32_t srcType, std::string imageSrc, bool isTrimMemRecycle = false) - : nodeInfo_(nodeInfo), srcType_(srcType), imageSrc_(imageSrc), isTrimMemRecycle_(isTrimMemRecycle) + const ImageNodeId& nodeInfo, int32_t srcType, std::string imageSrc, bool isTrimMemRecycle = false, bool autoResize = false) + : nodeInfo_(nodeInfo), srcType_(srcType), imageSrc_(imageSrc), isTrimMemRecycle_(isTrimMemRecycle), autoResize_(autoResize) { InitToStringWithoutSrc(); InitToStringWithSrc(); @@ -55,6 +55,11 @@ public: return isTrimMemRecycle_; } + bool GetAutoResize() const + { + return autoResize_; + } + int32_t GetNodeId() const { return nodeInfo_.nodeId_; @@ -63,7 +68,9 @@ public: int64_t GetAccessibilityId() const { return nodeInfo_.accessibilityId_; - } + } + + std::string GetImageSrc() const { @@ -95,6 +102,7 @@ private: std::string withSrcInfo_ = ""; float frameSizeWidth_ = 0.0f; float frameSizeHeight_ = 0.0f; + bool autoResize_ = false; void InitToStringWithoutSrc() { @@ -106,6 +114,7 @@ private: .append(std::to_string(nodeInfo_.canvasNodeId_)) .append("-") .append(std::to_string(srcType_)) + .append(autoResize_ ? "true" : "false") .append("]"); } @@ -121,6 +130,7 @@ private: .append(std::to_string(srcType_)) .append("]-[") .append(imageSrc_) + .append(autoResize_ ? "true" : "false") .append("]"); } };