fixPrivateSrc

Signed-off-by: hw_wyx <wuyinxiao@huawei.com>
Change-Id: I930bcda99fedbcd3c4db1c5d8c03fafe1bc74874
This commit is contained in:
hw_wyx 2024-08-19 09:42:05 +08:00
parent 7932912e07
commit 56f79c7bf3
10 changed files with 28 additions and 28 deletions

View File

@ -80,7 +80,7 @@ RefPtr<CanvasImage> ImageDecoder::MakePixmapImage(AIImageQuality imageQuality, b
auto source = ImageSource::Create(static_cast<const uint8_t*>(data_->GetData()), data_->GetSize());
if (!source) {
TAG_LOGE(AceLogTag::ACE_IMAGE,
"ImageSouce Create Fail, id = %{public}d, accessId = %{public}lld, src = %{public}s.",
"ImageSouce Create Fail, id = %{public}d, accessId = %{public}lld, src = %{private}s.",
imageDfxConfig.nodeId_, static_cast<long long>(imageDfxConfig.accessibilityId_),
imageDfxConfig.imageSrc_.c_str());
return nullptr;
@ -98,7 +98,7 @@ RefPtr<CanvasImage> ImageDecoder::MakePixmapImage(AIImageQuality imageQuality, b
auto pixmap = source->CreatePixelMap({ width, height }, imageQuality, isHdrDecoderNeed);
if (!pixmap) {
TAG_LOGE(AceLogTag::ACE_IMAGE,
"PixelMap Create Fail, id = %{public}d, accessId = %{public}lld, src = %{public}s.", imageDfxConfig.nodeId_,
"PixelMap Create Fail, id = %{public}d-%{public}lld, src = %{private}s.", imageDfxConfig.nodeId_,
static_cast<long long>(imageDfxConfig.accessibilityId_), imageDfxConfig.imageSrc_.c_str());
return nullptr;
}
@ -106,7 +106,7 @@ RefPtr<CanvasImage> ImageDecoder::MakePixmapImage(AIImageQuality imageQuality, b
if (SystemProperties::GetDebugEnabled()) {
TAG_LOGD(AceLogTag::ACE_IMAGE,
"decode to pixmap, src=%{public}s, resolutionQuality = %{public}s, desiredSize = %{public}s, pixmap size = "
"decode to pixmap, src=%{private}s, resolutionQuality=%{public}s, desiredSize=%{public}s, pixmap size = "
"%{public}d x %{public}d",
obj_->GetSourceInfo().ToString().c_str(), GetResolutionQuality(imageQuality).c_str(),
desiredSize_.ToString().c_str(), image->GetWidth(), image->GetHeight());
@ -192,7 +192,7 @@ RefPtr<CanvasImage> ImageDecoder::QueryCompressedCache()
auto rosenImageData = AceType::DynamicCast<DrawingImageData>(cachedData);
CHECK_NULL_RETURN(rosenImageData, {});
auto stripped = ImageCompressor::StripFileHeader(rosenImageData->GetRSData());
TAG_LOGI(AceLogTag::ACE_IMAGE, "use astc cache %{public}s", key.c_str());
TAG_LOGI(AceLogTag::ACE_IMAGE, "use astc cache %{private}s", key.c_str());
// create encoded SkImage to use its uniqueId
CHECK_NULL_RETURN(data_, {});

View File

@ -244,7 +244,7 @@ std::set<WeakPtr<ImageLoadingContext>> ImageProvider::EndTask(const std::string&
}
auto ctxs = it->second.ctxs_;
if (ctxs.empty()) {
TAG_LOGW(AceLogTag::ACE_IMAGE, "registered task has empty context %{public}s", key.c_str());
TAG_LOGW(AceLogTag::ACE_IMAGE, "registered task has empty context %{private}s", key.c_str());
}
tasks_.erase(it);
return ctxs;
@ -292,7 +292,7 @@ RefPtr<ImageObject> ImageProvider::BuildImageObject(const ImageSourceInfo& src,
auto imageDfxConfig = src.GetImageDfxConfig();
if (!data) {
TAG_LOGW(AceLogTag::ACE_IMAGE,
"data is null when try ParseImageObjectType, src: %{public}s, nodeID = %{public}d-%{public}lld.",
"data is null when try ParseImageObjectType, src: %{private}s, nodeID = %{public}d-%{public}lld.",
imageDfxConfig.imageSrc_.c_str(), imageDfxConfig.nodeId_,
static_cast<long long>(imageDfxConfig.accessibilityId_));
return nullptr;
@ -317,7 +317,7 @@ RefPtr<ImageObject> ImageProvider::BuildImageObject(const ImageSourceInfo& src,
if (!size.IsPositive()) {
TAG_LOGW(AceLogTag::ACE_IMAGE,
"Image of src: %{private}s, imageData's size = %{public}d is invalid, and the parsed size is invalid "
"%{public}s, frameCount is %{public}d, nodeId = %{public}d-%{public}lld.",
"%{private}s, frameCount is %{public}d, nodeId = %{public}d-%{public}lld.",
src.ToString().c_str(), static_cast<int32_t>(data->GetSize()), size.ToString().c_str(), frameCount,
imageDfxConfig.nodeId_, static_cast<long long>(imageDfxConfig.accessibilityId_));
return nullptr;

View File

@ -52,7 +52,7 @@ RefPtr<PixelMapImageObject> PixelMapImageObject::Create(const ImageSourceInfo& s
auto&& pixelMap = pixmapData->GetPixmap();
if (!pixelMap) {
TAG_LOGW(AceLogTag::ACE_IMAGE,
"ImageData has no pixel map data when try CreateImageEncodedInfoForDecodedPixelMap, src: %{public}s",
"ImageData has no pixel map data when try CreateImageEncodedInfoForDecodedPixelMap, src: %{private}s",
src.ToString().c_str());
return nullptr;
}

View File

@ -55,7 +55,7 @@ bool SvgImageObject::MakeSvgDom(const RefPtr<ImageData>& data, const ImageSource
imageSize_ = svgDomBase_->GetContainerSize();
if (imageSize_.IsNonPositive()) {
TAG_LOGI(AceLogTag::ACE_IMAGE,
"[Engine Log] [Image] %{public}s doesn't have an intrinsic size. The developer must set a size for it.",
"[Engine Log] [Image] %{private}s doesn't have an intrinsic size. The developer must set a size for it.",
GetSourceInfo().ToString().c_str());
}
return true;

View File

@ -142,7 +142,7 @@ bool ImageCompressor::CheckImageQuality(std::string key, uint32_t sumErr, uint32
std::lock_guard<std::mutex> mLock(recordsMutex_);
failedRecords_.insert(key);
}
LOGI("compress quality %{public}s [%{public}u, %{public}.2f] size(%{public}d×%{public}d) %{public}s",
LOGI("compress quality %{private}s [%{public}u, %{public}.2f] size(%{public}d×%{public}d) %{public}s",
key.c_str(), maxErr, psnr, width, height, isOk ? "ok" : "no");
return isOk;
}

View File

@ -267,12 +267,12 @@ void ImageFileCache::ConvertToAstcAndWriteToFile(const std::string& fileCacheKey
ACE_FUNCTION_TRACE();
RefPtr<ImageSource> imageSource = ImageSource::Create(filePath);
if (!imageSource || imageSource->GetFrameCount() != 1) {
TAG_LOGI(AceLogTag::ACE_IMAGE, "Image frame count is not 1, will not convert to astc. %{public}s",
TAG_LOGI(AceLogTag::ACE_IMAGE, "Image frame count is not 1, will not convert to astc. %{private}s",
fileCacheKey.c_str());
return;
}
if (imageSource->GetEncodedFormat() == SVG_FORMAT) {
TAG_LOGI(AceLogTag::ACE_IMAGE, "Image is svg, will not convert to astc. %{public}s",
TAG_LOGI(AceLogTag::ACE_IMAGE, "Image is svg, will not convert to astc. %{private}s",
fileCacheKey.c_str());
return;
}
@ -282,7 +282,7 @@ void ImageFileCache::ConvertToAstcAndWriteToFile(const std::string& fileCacheKey
option.format = CONVERT_ASTC_FORMAT;
auto pixelMap = imageSource->CreatePixelMap({-1, -1});
if (pixelMap == nullptr) {
TAG_LOGW(AceLogTag::ACE_IMAGE, "Get pixel map failed, will not convert to astc. %{public}s",
TAG_LOGW(AceLogTag::ACE_IMAGE, "Get pixel map failed, will not convert to astc. %{private}s",
fileCacheKey.c_str());
return;
}
@ -293,12 +293,12 @@ void ImageFileCache::ConvertToAstcAndWriteToFile(const std::string& fileCacheKey
imagePacker->AddImage(*pixelMap);
int64_t packedSize = 0;
if (imagePacker->FinalizePacking(packedSize)) {
TAG_LOGW(AceLogTag::ACE_IMAGE, "convert to astc failed. %{public}s", fileCacheKey.c_str());
TAG_LOGW(AceLogTag::ACE_IMAGE, "convert to astc failed. %{private}s", fileCacheKey.c_str());
return;
}
#if !defined(WINDOWS_PLATFORM) && !defined(ACE_UNITTEST)
if (chmod(astcFilePath.c_str(), CHOWN_RW_UG) != 0) {
TAG_LOGW(AceLogTag::ACE_IMAGE, "convert to astc chmod failed: %{public}s %{private}s",
TAG_LOGW(AceLogTag::ACE_IMAGE, "convert to astc chmod failed: %{private}s %{private}s",
url.c_str(), astcFilePath.c_str());
}
#endif
@ -315,7 +315,7 @@ void ImageFileCache::ConvertToAstcAndWriteToFile(const std::string& fileCacheKey
}
// remove the old file before convert
ClearCacheFile(removeVector);
TAG_LOGI(AceLogTag::ACE_IMAGE, "write image astc cache: %{public}s %{private}s", url.c_str(), astcFilePath.c_str());
TAG_LOGI(AceLogTag::ACE_IMAGE, "write astc cache: %{private}s %{private}s", url.c_str(), astcFilePath.c_str());
}
void ImageFileCache::ClearCacheFile(const std::vector<std::string>& removeFiles)

View File

@ -653,7 +653,7 @@ std::shared_ptr<RSData> ResourceImageLoader::LoadImageData(
if (GetResourceId(uri, rawFile)) {
// must fit raw file firstly, as file name may contains number
if (!resourceWrapper->GetRawFileData(rawFile, dataLen, data, bundleName, moudleName)) {
TAG_LOGW(AceLogTag::ACE_IMAGE, "get image data by name failed, uri:%{private}s, rawFile:%{public}s",
TAG_LOGW(AceLogTag::ACE_IMAGE, "get image data by name failed, uri:%{private}s, rawFile:%{private}s",
uri.c_str(), rawFile.c_str());
return nullptr;
}
@ -683,7 +683,7 @@ std::shared_ptr<RSData> ResourceImageLoader::LoadImageData(
std::string resName;
if (GetResourceName(uri, resName)) {
if (!resourceWrapper->GetMediaData(resName, dataLen, data, bundleName, moudleName)) {
TAG_LOGW(AceLogTag::ACE_IMAGE, "get image data by name failed, uri:%{private}s, resName:%{public}s",
TAG_LOGW(AceLogTag::ACE_IMAGE, "get image data by name failed, uri:%{private}s, resName:%{private}s",
uri.c_str(), resName.c_str());
return nullptr;
}
@ -865,7 +865,7 @@ std::shared_ptr<RSData> SharedMemoryImageLoader::LoadImageData(
void SharedMemoryImageLoader::UpdateData(const std::string& uri, const std::vector<uint8_t>& memData)
{
TAG_LOGI(AceLogTag::ACE_IMAGE, "SharedMemory image data is ready %{public}s", uri.c_str());
TAG_LOGI(AceLogTag::ACE_IMAGE, "SharedMemory image data is ready %{private}s", uri.c_str());
{
std::scoped_lock<std::mutex> lock(mtx_);
data_ = memData;

View File

@ -190,7 +190,7 @@ void StaticImageObject::UploadToGpuForRender(const WeakPtr<PipelineBase>& contex
auto key = GenerateCacheKey(imageSource, imageSize);
// is already uploaded
if (!ImageProvider::TryUploadingImage(key, successCallback, failedCallback)) {
LOGI("other thread is uploading same image to gpu : %{public}s", imageSource.ToString().c_str());
LOGI("other thread is uploading same image to gpu : %{private}s", imageSource.ToString().c_str());
return;
}

View File

@ -126,7 +126,7 @@ void AnimatedImageObject::UploadToGpuForRender(
dstHeight);
ClearData();
} else if (animatedPlayer_ && forceResize && imageSize.IsValid()) {
LOGI("animated player has been constructed, forceResize: %{public}s", imageSize.ToString().c_str());
LOGI("animated player has been constructed, forceResize: %{private}s", imageSize.ToString().c_str());
int32_t dstWidth = static_cast<int32_t>(imageSize.Width() + SizeOffset);
int32_t dstHeight = static_cast<int32_t>(imageSize.Height() + SizeOffset);
animatedPlayer_->SetTargetSize(dstWidth, dstHeight);

View File

@ -66,7 +66,7 @@ bool ImageProvider::TrySetLoadingImage(const ImageSourceInfo& imageInfo, const I
loadingImage_.emplace(key, callbacks);
return true;
} else {
LOGI("other thread is loading same image: %{public}s", imageInfo.ToString().c_str());
LOGI("other thread is loading same image: %{private}s", imageInfo.ToString().c_str());
iter->second.emplace_back(successCallback, uploadCallback, failedCallback);
return false;
}
@ -108,7 +108,7 @@ void ImageProvider::ProccessLoadingResult(const RefPtr<TaskExecutor>& taskExecut
}
}
} else {
LOGW("no loading image: %{public}s", imageInfo.ToString().c_str());
LOGW("no loading image: %{private}s", imageInfo.ToString().c_str());
}
loadingImage_.erase(key);
}
@ -149,7 +149,7 @@ void ImageProvider::ProccessUploadResult(const RefPtr<TaskExecutor>& taskExecuto
},
TaskExecutor::TaskType::UI, "ArkUIImageProviderUploadResult");
} else {
LOGW("no uploading image: %{public}s", imageInfo.ToString().c_str());
LOGW("no uploading image: %{private}s", imageInfo.ToString().c_str());
}
uploadingImage_.erase(key);
}
@ -400,7 +400,7 @@ void ImageProvider::UploadImageToGPUForRender(const WeakPtr<PipelineBase> contex
callback(image, nullptr);
#else
if (data && ImageCompressor::GetInstance()->CanCompress()) {
LOGI("use astc cache %{public}s %{public}d * %{public}d", src.c_str(), image->width(), image->height());
LOGI("use astc cache %{private}s %{public}d * %{public}d", src.c_str(), image->width(), image->height());
callback(image, data);
return;
}
@ -458,7 +458,7 @@ void ImageProvider::UploadImageToGPUForRender(const WeakPtr<PipelineBase> contex
callback(image, nullptr);
#else
if (data && ImageCompressor::GetInstance()->CanCompress()) {
LOGI("use astc cache %{public}s %{public}d * %{public}d", src.c_str(), image->GetWidth(), image->GetHeight());
LOGI("use astc cache %{private}s %{public}d * %{public}d", src.c_str(), image->GetWidth(), image->GetHeight());
callback(image, data);
return;
}
@ -696,7 +696,7 @@ sk_sp<SkImage> ImageProvider::GetSkImage(const std::string& src, const WeakPtr<P
ImageSourceInfo info(src);
auto imageLoader = ImageLoader::CreateImageLoader(info);
if (!imageLoader) {
LOGE("Invalid src, src is %{public}s", src.c_str());
LOGE("Invalid src, src is %{private}s", src.c_str());
return nullptr;
}
auto imageSkData = imageLoader->LoadImageData(info, context);
@ -719,7 +719,7 @@ std::shared_ptr<RSImage> ImageProvider::GetDrawingImage(
ImageSourceInfo info(src);
auto imageLoader = ImageLoader::CreateImageLoader(info);
if (!imageLoader) {
LOGE("Invalid src, src is %{public}s", src.c_str());
LOGE("Invalid src, src is %{private}s", src.c_str());
return nullptr;
}
auto imageData = imageLoader->LoadImageData(info, context);