From 8ef302cfe02f34d61cabbd90480dc3086584d5af Mon Sep 17 00:00:00 2001 From: huangzhongyan Date: Fri, 5 Sep 2025 17:08:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangzhongyan Change-Id: I3ed594996653913c2431ee579a15a7d81b9ee077 --- .../core/components_ng/pattern/image/image_dfx.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/frameworks/core/components_ng/pattern/image/image_dfx.h b/frameworks/core/components_ng/pattern/image/image_dfx.h index 40316f7ca60..9b1ce779135 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("]"); } }; -- Gitee