diff --git a/frameworks/core/components_ng/pattern/image/image_pattern.cpp b/frameworks/core/components_ng/pattern/image/image_pattern.cpp index 4e1502b6e15..e65e118e05e 100644 --- a/frameworks/core/components_ng/pattern/image/image_pattern.cpp +++ b/frameworks/core/components_ng/pattern/image/image_pattern.cpp @@ -581,6 +581,12 @@ void ImagePattern::CreateObscuredImage() void ImagePattern::LoadImage(const ImageSourceInfo& src, const PropertyChangeFlag& propertyChangeFlag) { + if (loadingCtx_) { + auto srcPixelMap = src.GetPixmap(); + auto loadPixelMap = loadingCtx_->GetSourceInfo().GetPixmap(); + isPixelMapChanged_ = !srcPixelMap || !loadPixelMap || srcPixelMap->GetRawPixelMapPtr() != + loadPixelMap->GetRawPixelMapPtr(); + } LoadNotifier loadNotifier(CreateDataReadyCallback(), CreateLoadSuccessCallback(), CreateLoadFailCallback()); loadNotifier.onDataReadyComplete_ = CreateCompleteCallBackInDataReady(); @@ -615,12 +621,6 @@ void ImagePattern::LoadImageDataIfNeed() auto src = imageLayoutProperty->GetImageSourceInfo().value_or(ImageSourceInfo("")); UpdateInternalResource(src); - if (loadingCtx_) { - auto srcPixelMap = src.GetPixmap(); - auto loadPixelMap = loadingCtx_->GetSourceInfo().GetPixmap(); - isPixelMapChanged_ = !srcPixelMap || !loadPixelMap || srcPixelMap->GetRawPixelMapPtr() != - loadPixelMap->GetRawPixelMapPtr(); - } if (!loadingCtx_ || loadingCtx_->GetSourceInfo() != src || isImageQualityChange_) { LoadImage(src, imageLayoutProperty->GetPropertyChangeFlag()); } else if (IsSupportImageAnalyzerFeature()) { diff --git a/frameworks/core/components_ng/pattern/video/video_pattern.cpp b/frameworks/core/components_ng/pattern/video/video_pattern.cpp index 577a58221b8..f776075bf36 100755 --- a/frameworks/core/components_ng/pattern/video/video_pattern.cpp +++ b/frameworks/core/components_ng/pattern/video/video_pattern.cpp @@ -1566,11 +1566,11 @@ void VideoPattern::OnFullScreenChange(bool isFullScreen) break; } } - if (isFullScreen && isEnableAnalyzer_ && isAnalyzerCreated_) { + if (isEnableAnalyzer_) { if (!imageAnalyzerManager_) { EnableAnalyzer(isEnableAnalyzer_); } - if (imageAnalyzerManager_) { + if (imageAnalyzerManager_ && isAnalyzerCreated_) { StartImageAnalyzer(); } }