From ff1fde56ea546e8ee2a53ed9d105ce61adc87e90 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Fri, 4 Apr 2025 13:49:36 +0900 Subject: [PATCH] Add more SystemError print logs + Do not use DALI_LOG_WARNING Print some more system error logs where using fread / fseek / ftell. + DALI_LOG_WARNINGS print some logs only for debug modes. Let we print some critical logs as error level, and verbose logs as debug level. Change-Id: I3e7c87882ee1bd72a123b71435e8861c6ad3949b Signed-off-by: Eunki, Hong --- .../adaptor-framework/bitmap-saver.cpp | 4 +- .../adaptor-framework/image-loading.cpp | 11 +++-- .../tizen-wayland/tts-player-impl-tizen.cpp | 4 +- .../android/file-loader-impl-android.cpp | 5 +- .../android/file-stream-impl-android.cpp | 31 +++++++----- .../generic/file-stream-impl-generic.cpp | 12 ++--- dali/internal/adaptor/common/adaptor-impl.cpp | 11 ++++- .../internal/imaging/common/file-download.cpp | 6 +-- dali/internal/imaging/common/gif-loading.cpp | 29 +++++++++-- dali/internal/imaging/common/image-loader.cpp | 5 +- .../imaging/common/image-operations.cpp | 4 +- dali/internal/imaging/common/loader-astc.cpp | 8 ++- dali/internal/imaging/common/loader-bmp.cpp | 42 +++++++++++++++- dali/internal/imaging/common/loader-gif.cpp | 14 ++++-- dali/internal/imaging/common/loader-ico.cpp | 13 +++-- .../imaging/common/loader-jpeg-turbo.cpp | 16 ++++-- dali/internal/imaging/common/loader-ktx.cpp | 15 ++++-- dali/internal/imaging/common/loader-pkm.cpp | 8 ++- dali/internal/imaging/common/loader-png.cpp | 4 +- dali/internal/imaging/common/loader-wbmp.cpp | 9 +++- dali/internal/imaging/common/webp-loading.cpp | 18 ++++++- .../tizen/native-image-source-impl-tizen.cpp | 14 +++--- .../native-image-source-queue-impl-tizen.cpp | 4 +- .../ubuntu-x11/native-image-source-impl-x.cpp | 4 +- .../imaging/windows/file-download-win.cpp | 4 +- .../x11/native-image-source-impl-x.cpp | 4 +- .../input-method-context-impl-ecore-wl.cpp | 8 +-- .../input-method-context-impl-x.cpp | 6 +-- .../common/tizen-platform-abstraction.cpp | 2 +- dali/internal/system/common/file-closer.h | 6 +-- dali/internal/system/common/trigger-event.cpp | 4 +- .../macos/file-descriptor-monitor-macos.cpp | 4 +- .../file-descriptor-monitor-windows.cpp | 4 +- .../internal/system/windows/trigger-event.cpp | 4 +- .../text/text-abstraction/cairo-renderer.cpp | 2 +- .../plugin/font-client-plugin-impl.cpp | 49 +++++++++---------- .../android/window-system-android.cpp | 4 +- 37 files changed, 271 insertions(+), 121 deletions(-) diff --git a/dali/devel-api/adaptor-framework/bitmap-saver.cpp b/dali/devel-api/adaptor-framework/bitmap-saver.cpp index 3aa86d4ec..3d9ca98a2 100644 --- a/dali/devel-api/adaptor-framework/bitmap-saver.cpp +++ b/dali/devel-api/adaptor-framework/bitmap-saver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ FileFormat GetFormatFromFileName(const std::string& filename) { if(filename.length() < 5) { - DALI_LOG_WARNING("Invalid (short) filename.\n"); + DALI_LOG_ERROR("Invalid (short) filename.\n"); } FileFormat format(INVALID_FORMAT); diff --git a/dali/devel-api/adaptor-framework/image-loading.cpp b/dali/devel-api/adaptor-framework/image-loading.cpp index bef7d7891..0740b2f19 100644 --- a/dali/devel-api/adaptor-framework/image-loading.cpp +++ b/dali/devel-api/adaptor-framework/image-loading.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include #include +#include #include namespace Dali @@ -195,13 +196,13 @@ Devel::PixelBuffer DownloadImageSynchronously(const std::string& url, ImageDimen } else { - DALI_LOG_WARNING("Unable to decode bitmap supplied as in-memory blob.\n"); + DALI_LOG_ERROR("Unable to decode bitmap supplied as in-memory blob.\n"); auto prefixSize = std::min(static_cast(0x200), blobSize); // maximum 512 bytes. auto errorString = ConvertDataReadable(reinterpret_cast(dataBuffer.Begin()), prefixSize, 0x40); - DALI_LOG_WARNING("URL: %s\n", url.c_str()); - DALI_LOG_WARNING("Downloaded data (prefix %zu bytes of %zu bytes):\n", prefixSize, blobSize); - DALI_LOG_WARNING("%s\n", errorString.c_str()); + DALI_LOG_DEBUG_INFO("URL: %s\n", url.c_str()); + DALI_LOG_DEBUG_INFO("Downloaded data (prefix %zu bytes of %zu bytes):\n", prefixSize, blobSize); + DALI_LOG_DEBUG_INFO("%s\n", errorString.c_str()); } } else diff --git a/dali/internal/accessibility/tizen-wayland/tts-player-impl-tizen.cpp b/dali/internal/accessibility/tizen-wayland/tts-player-impl-tizen.cpp index aeb04a95b..7c30f6ef3 100644 --- a/dali/internal/accessibility/tizen-wayland/tts-player-impl-tizen.cpp +++ b/dali/internal/accessibility/tizen-wayland/tts-player-impl-tizen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -378,7 +378,7 @@ void TtsPlayerTizen::LogErrorCode(tts_error_e reason) if(reason != TTS_ERROR_NONE) { - DALI_LOG_WARNING("[%s:%d] tts error : %s\n", __FUNCTION__, __LINE__, error_string.c_str()); + DALI_LOG_ERROR("[%s:%d] tts error : %s\n", __FUNCTION__, __LINE__, error_string.c_str()); } } diff --git a/dali/internal/adaptor-framework/android/file-loader-impl-android.cpp b/dali/internal/adaptor-framework/android/file-loader-impl-android.cpp index a65bf92fb..549734577 100644 --- a/dali/internal/adaptor-framework/android/file-loader-impl-android.cpp +++ b/dali/internal/adaptor-framework/android/file-loader-impl-android.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ // INTERNAL INCLUDES #include #include +#include namespace Dali { @@ -125,6 +126,7 @@ int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector else { DALI_LOG_ERROR("File not found %s\n", filename.c_str()); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } @@ -163,6 +165,7 @@ std::streampos GetFileSize(const std::string& filename) else { DALI_LOG_ERROR("File not found %s\n", filename.c_str()); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } diff --git a/dali/internal/adaptor-framework/android/file-stream-impl-android.cpp b/dali/internal/adaptor-framework/android/file-stream-impl-android.cpp index a99ac9231..d7c747405 100644 --- a/dali/internal/adaptor-framework/android/file-stream-impl-android.cpp +++ b/dali/internal/adaptor-framework/android/file-stream-impl-android.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,17 +20,17 @@ // EXTERNAL INCLUDES #include #include -#include -#include #include +#include +#include // INTERNAL INCLUDES #include #include +#include namespace Dali { - /// Extends streambuf so that we can use the buffer in Dali::Vector class VectorStreamBuffer : public std::streambuf { @@ -38,7 +38,7 @@ public: VectorStreamBuffer(char* buffer, size_t length) { char* begin = buffer; - char* end = begin + length; + char* end = begin + length; setg(begin, begin, end); setp(begin, end); } @@ -81,7 +81,7 @@ struct FileStream::Impl::PlatformSpecificImpl } std::unique_ptr mVectorStream; - std::streambuf* mStreamBuffer{nullptr}; + std::streambuf* mStreamBuffer{nullptr}; }; FileStream::Impl::Impl(const std::string& filename, uint8_t mode) @@ -137,7 +137,8 @@ FileStream::Impl::~Impl() const int closeFailed = fclose(mFile); if(closeFailed) { - DALI_LOG_WARNING("File close failed for FILE: \"%p\".\n", static_cast(mFile)); + DALI_LOG_ERROR("File close failed for FILE: \"%p\".\n", static_cast(mFile)); + DALI_PRINT_SYSTEM_ERROR_LOG(); } mFile = nullptr; @@ -202,9 +203,9 @@ std::iostream& FileStream::Impl::GetStream() if(!(mMode & Dali::FileStream::WRITE) && !(mMode & Dali::FileStream::APPEND)) { std::streampos fileSize; - if (ReadFile(mFileName, fileSize, mFileBuffer, (mMode & Dali::FileStream::BINARY) ? Dali::FileLoader::BINARY : Dali::FileLoader::TEXT)) + if(ReadFile(mFileName, fileSize, mFileBuffer, (mMode & Dali::FileStream::BINARY) ? Dali::FileLoader::BINARY : Dali::FileLoader::TEXT)) { - mBuffer = reinterpret_cast(&mFileBuffer[0]); + mBuffer = reinterpret_cast(&mFileBuffer[0]); mDataSize = fileSize; // For some reason on Android, calling mBufferStream.rdbuf()->pubsetbuf(...) has no effect. @@ -212,19 +213,21 @@ std::iostream& FileStream::Impl::GetStream() mPlatformSpecificImpl->mStreamBuffer = new VectorStreamBuffer(mFileBuffer); mPlatformSpecificImpl->mVectorStream.reset(new std::iostream(mPlatformSpecificImpl->mStreamBuffer)); - if (!mPlatformSpecificImpl->mVectorStream->rdbuf()->in_avail()) + if(!mPlatformSpecificImpl->mVectorStream->rdbuf()->in_avail()) { DALI_LOG_ERROR( "File open failed for memory buffer at location: \"%p\", of size: \"%u\", in mode: \"%d\".\n", - static_cast(mBuffer), + static_cast(mBuffer), static_cast(mDataSize), static_cast(openMode)); + DALI_PRINT_SYSTEM_ERROR_LOG(); } return *mPlatformSpecificImpl->mVectorStream.get(); } else { DALI_LOG_ERROR("stream open failed for: \"%s\", in mode: \"%d\".\n", mFileName.c_str(), static_cast(openMode)); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } else @@ -233,6 +236,7 @@ std::iostream& FileStream::Impl::GetStream() if(!mFileStream.is_open()) { DALI_LOG_ERROR("stream open failed for: \"%s\", in mode: \"%d\".\n", mFileName.c_str(), static_cast(openMode)); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } return mFileStream; @@ -249,6 +253,7 @@ std::iostream& FileStream::Impl::GetStream() static_cast(mBuffer), static_cast(mDataSize), static_cast(openMode)); + DALI_PRINT_SYSTEM_ERROR_LOG(); } return *mPlatformSpecificImpl->mVectorStream.get(); } @@ -308,11 +313,13 @@ FILE* FileStream::Impl::GetFile() static_cast(mBuffer), static_cast(mDataSize), openMode); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } else { DALI_LOG_ERROR("read file failed for: \"%s\", in mode: \"%s\".\n", mFileName.c_str(), openMode); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } else @@ -321,6 +328,7 @@ FILE* FileStream::Impl::GetFile() if(!mFile) { DALI_LOG_ERROR("file open failed for: \"%s\", in mode: \"%s\".\n", mFileName.c_str(), openMode); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } } @@ -333,6 +341,7 @@ FILE* FileStream::Impl::GetFile() static_cast(mBuffer), static_cast(mDataSize), openMode); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } diff --git a/dali/internal/adaptor-framework/generic/file-stream-impl-generic.cpp b/dali/internal/adaptor-framework/generic/file-stream-impl-generic.cpp index e34b7f06f..d129f1089 100644 --- a/dali/internal/adaptor-framework/generic/file-stream-impl-generic.cpp +++ b/dali/internal/adaptor-framework/generic/file-stream-impl-generic.cpp @@ -78,7 +78,7 @@ FileStream::Impl::~Impl() const int closeFailed = fclose(mFile); if(closeFailed) { - DALI_LOG_WARNING("File close failed for FILE: \"%p\".\n", static_cast(mFile)); + DALI_LOG_ERROR("File close failed for FILE: \"%p\".\n", static_cast(mFile)); DALI_PRINT_SYSTEM_ERROR_LOG(); } @@ -135,7 +135,7 @@ std::iostream& FileStream::Impl::GetStream() mFileStream.open(mFileName, static_cast(openMode)); if(!mFileStream.is_open()) { - DALI_LOG_WARNING("stream open failed for: \"%s\", in mode: \"%d\".\n", mFileName.c_str(), openMode); + DALI_LOG_ERROR("stream open failed for: \"%s\", in mode: \"%d\".\n", mFileName.c_str(), openMode); DALI_PRINT_SYSTEM_ERROR_LOG(); } return mFileStream; @@ -145,10 +145,10 @@ std::iostream& FileStream::Impl::GetStream() mBufferStream.rdbuf()->pubsetbuf(reinterpret_cast(mBuffer), static_cast(static_cast(mDataSize))); if(!mBufferStream.rdbuf()->in_avail()) { - DALI_LOG_WARNING("File open failed for memory buffer at location: \"%p\", of size: \"%u\", in mode: \"%d\".\n", - static_cast(mBuffer), - static_cast(mDataSize), - openMode); + DALI_LOG_ERROR("File open failed for memory buffer at location: \"%p\", of size: \"%u\", in mode: \"%d\".\n", + static_cast(mBuffer), + static_cast(mDataSize), + openMode); DALI_PRINT_SYSTEM_ERROR_LOG(); } } diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index d22764376..ac07f02fe 100644 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -134,6 +135,8 @@ void Adaptor::Initialize(GraphicsFactoryInterface& graphicsFactory) mEnvironmentOptions->SetLogFunction(logFunction); mEnvironmentOptions->InstallLogFunction(); // install logging for main thread + DALI_LOG_RELEASE_INFO("Adaptor::Initialize\n"); + mPlatformAbstraction = new TizenPlatform::TizenPlatformAbstraction; std::string path; @@ -316,21 +319,27 @@ void Adaptor::Initialize(GraphicsFactoryInterface& graphicsFactory) std::string systemCachePath = GetSystemCachePath(); if(!systemCachePath.empty()) { + DALI_LOG_RELEASE_INFO("Check and create dali system cache directory: %s\n", systemCachePath.c_str()); int dir_err = mkdir(systemCachePath.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); if(0 != dir_err && errno != EEXIST) { DALI_LOG_ERROR("Error creating system cache directory: %s!\n", systemCachePath.c_str()); + DALI_PRINT_SYSTEM_ERROR_LOG(); } std::string shaderCachePath = GetProgramBinaryPath(); + DALI_LOG_RELEASE_INFO("Check and create dali shader cache directory: %s\n", shaderCachePath.c_str()); dir_err = mkdir(shaderCachePath.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); if(0 != dir_err && errno != EEXIST) { DALI_LOG_ERROR("Error creating shader cache directory: %s!\n", shaderCachePath.c_str()); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } mConfigurationManager = Utils::MakeUnique(systemCachePath, mGraphics.get(), mThreadController); + + DALI_LOG_RELEASE_INFO("Adaptor::Initialize: Initialized\n"); } Adaptor::~Adaptor() diff --git a/dali/internal/imaging/common/file-download.cpp b/dali/internal/imaging/common/file-download.cpp index 4015bc07f..2f1606199 100644 --- a/dali/internal/imaging/common/file-download.cpp +++ b/dali/internal/imaging/common/file-download.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -385,7 +385,7 @@ bool DownloadFile(CURL* curlHandle, } else if(DALI_UNLIKELY(dataSize == 0u)) { - DALI_LOG_WARNING("Warning : Download data size is 0! url : %s\n", url.c_str()); + DALI_LOG_ERROR("Warning : Download data size is 0! url : %s\n", url.c_str()); } return true; } @@ -415,7 +415,7 @@ bool DownloadRemoteFileIntoMemory(const std::string& url, if(url.empty()) { - DALI_LOG_WARNING("empty url requested \n"); + DALI_LOG_ERROR("empty url requested \n"); return false; } diff --git a/dali/internal/imaging/common/gif-loading.cpp b/dali/internal/imaging/common/gif-loading.cpp index 6f84d4a17..f2527650f 100644 --- a/dali/internal/imaging/common/gif-loading.cpp +++ b/dali/internal/imaging/common/gif-loading.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #define IMG_TOO_BIG(w, h) \ @@ -306,6 +307,7 @@ bool LoaderInfo::FileData::LoadLocalFile() if(DALI_UNLIKELY(fseek(fp, 0, SEEK_END) <= -1)) { DALI_LOG_ERROR("Error seeking within file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -313,6 +315,7 @@ bool LoaderInfo::FileData::LoadLocalFile() if(DALI_UNLIKELY(length <= -1)) { DALI_LOG_ERROR("Could not determine GIF file size.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -324,11 +327,20 @@ bool LoaderInfo::FileData::LoadLocalFile() DALI_LOG_ERROR("malloc is failed. request malloc size : %llu\n", sizeof(GifByteType) * static_cast(length)); return false; } - length = fread(globalMap, sizeof(GifByteType), length, fp); + const long long bytesRead = fread(globalMap, sizeof(GifByteType), length, fp); + + // Check the size of loaded data is what we expected. + if(DALI_UNLIKELY(bytesRead != length)) + { + DALI_LOG_ERROR("Error read bytes (required : %lld, actual read : %lld)\n", length, bytesRead); + DALI_PRINT_SYSTEM_ERROR_LOG(); + return false; + } } else { DALI_LOG_ERROR("Error seeking within file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } return true; @@ -361,18 +373,29 @@ bool LoaderInfo::FileData::LoadRemoteFile() } else { - length = fread(globalMap, sizeof(GifByteType), blobSize, fp); - succeeded = true; + length = fread(globalMap, sizeof(GifByteType), blobSize, fp); + if(DALI_UNLIKELY(static_cast(static_cast(blobSize)) != length)) + { + DALI_LOG_ERROR("Error read bytes (required : %zu, actual read : %lld)\n", blobSize, length); + DALI_PRINT_SYSTEM_ERROR_LOG(); + length = 0; + } + else + { + succeeded = true; + } } } else { DALI_LOG_ERROR("Error seeking within file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } else { DALI_LOG_ERROR("Error reading file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } else diff --git a/dali/internal/imaging/common/image-loader.cpp b/dali/internal/imaging/common/image-loader.cpp index 081b3f714..0a9babc83 100644 --- a/dali/internal/imaging/common/image-loader.cpp +++ b/dali/internal/imaging/common/image-loader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ #include #include #include +#include using namespace Dali::Integration; @@ -179,6 +180,7 @@ bool GetBitmapLoaderFunctions(FILE* fp, if(DALI_UNLIKELY(fseek(fp, 0, SEEK_SET))) { DALI_LOG_ERROR("Error seeking to start of file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); } if(read != MAGIC_LENGTH) @@ -265,6 +267,7 @@ bool GetBitmapLoaderFunctions(FILE* fp, if(DALI_UNLIKELY(fseek(fp, 0, SEEK_SET))) { DALI_LOG_ERROR("Error seeking to start of file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); } return loaderFound; diff --git a/dali/internal/imaging/common/image-operations.cpp b/dali/internal/imaging/common/image-operations.cpp index cd2591ed6..8ab31f558 100644 --- a/dali/internal/imaging/common/image-operations.cpp +++ b/dali/internal/imaging/common/image-operations.cpp @@ -988,7 +988,7 @@ Dali::Devel::PixelBuffer CropAndPadForFittingMode(Dali::Devel::PixelBuffer& bitm if(desiredDimensions.GetWidth() < 1u || desiredDimensions.GetHeight() < 1u) { - DALI_LOG_WARNING("Image scaling aborted as desired dimensions too small (%u, %u).\n", desiredDimensions.GetWidth(), desiredDimensions.GetHeight()); + DALI_LOG_ERROR("Image scaling aborted as desired dimensions too small (%u, %u).\n", desiredDimensions.GetWidth(), desiredDimensions.GetHeight()); } else if(inputWidth != desiredDimensions.GetWidth() || inputHeight != desiredDimensions.GetHeight()) { @@ -1025,7 +1025,7 @@ Dali::Devel::PixelBuffer CropAndPadForFittingMode(Dali::Devel::PixelBuffer& bitm if((desiredWidth > MAXIMUM_TARGET_BITMAP_SIZE) || (desiredHeight > MAXIMUM_TARGET_BITMAP_SIZE) || (columnsToPad > MAXIMUM_TARGET_BITMAP_SIZE) || (scanlinesToPad > MAXIMUM_TARGET_BITMAP_SIZE)) { - DALI_LOG_WARNING("Image scaling aborted as final dimensions too large (%u, %u).\n", desiredWidth, desiredHeight); + DALI_LOG_ERROR("Image scaling aborted as final dimensions too large (%u, %u).\n", desiredWidth, desiredHeight); return bitmap; } diff --git a/dali/internal/imaging/common/loader-astc.cpp b/dali/internal/imaging/common/loader-astc.cpp index ac797a7c4..ab893e872 100644 --- a/dali/internal/imaging/common/loader-astc.cpp +++ b/dali/internal/imaging/common/loader-astc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -117,6 +118,7 @@ bool LoadAstcHeader(FILE* const filePointer, unsigned int& width, unsigned int& const unsigned int readLength = sizeof(AstcFileHeader); if(DALI_UNLIKELY(fread(&fileHeader, 1, readLength, filePointer) != readLength)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -193,6 +195,7 @@ bool LoadBitmapFromAstc(const Dali::ImageLoader::Input& input, Dali::Devel::Pixe if(DALI_UNLIKELY(fseek(filePointer, 0L, SEEK_END))) { DALI_LOG_ERROR("Could not seek through file.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -200,12 +203,14 @@ bool LoadBitmapFromAstc(const Dali::ImageLoader::Input& input, Dali::Devel::Pixe if(DALI_UNLIKELY(fileSize == -1L)) { DALI_LOG_ERROR("Could not determine ASTC file size.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(DALI_UNLIKELY(fseek(filePointer, sizeof(AstcFileHeader), SEEK_SET))) { DALI_LOG_ERROR("Could not seek through file.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -239,6 +244,7 @@ bool LoadBitmapFromAstc(const Dali::ImageLoader::Input& input, Dali::Devel::Pixe if(DALI_UNLIKELY(bytesRead != imageByteCount)) { DALI_LOG_ERROR("Read of image pixel data failed. (required image bytes : %zu, actual read from file : %zu\n", imageByteCount, bytesRead); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } diff --git a/dali/internal/imaging/common/loader-bmp.cpp b/dali/internal/imaging/common/loader-bmp.cpp index a01d07617..13008b867 100644 --- a/dali/internal/imaging/common/loader-bmp.cpp +++ b/dali/internal/imaging/common/loader-bmp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include #include namespace Dali @@ -84,6 +85,7 @@ inline bool ReadHeader(FILE* fp, T& header) // Load the information directly into our structure if(DALI_UNLIKELY(fread(&header, 1, readLength, fp) != readLength)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -144,6 +146,7 @@ bool DecodeRGB24V5(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking BMP_RGB24V5 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -161,6 +164,7 @@ bool DecodeRGB24V5(FILE* fp, if(DALI_UNLIKELY(fread(pixelsPtr, 1, rowStride, fp) != rowStride)) { DALI_LOG_ERROR("Error reading the BMP image\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } for(std::uint32_t i = 0; i < rowStride; i += 3) @@ -176,6 +180,7 @@ bool DecodeRGB24V5(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(padding)), SEEK_CUR))) { DALI_LOG_ERROR("Error moving past BMP_RGB24V5 padding\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } } @@ -211,6 +216,7 @@ bool DecodeBF32V4(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking BMP_BITFIELDS32V4 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -228,6 +234,7 @@ bool DecodeBF32V4(FILE* fp, if(DALI_UNLIKELY(fread(pixelsPtr, 1, rowStride, fp) != rowStride)) { DALI_LOG_ERROR("Error reading the BMP image\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } for(std::uint32_t i = 0; i < rowStride; i += 4) @@ -242,6 +249,7 @@ bool DecodeBF32V4(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(padding)), SEEK_CUR))) { DALI_LOG_ERROR("Error moving past BMP_BITFIELDS32V4 padding\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } } @@ -277,6 +285,7 @@ bool DecodeBF32(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking BMP_BITFIELDS32 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -297,6 +306,7 @@ bool DecodeBF32(FILE* fp, if(DALI_UNLIKELY(fread(pixelsPtr, 1, rowStride, fp) != rowStride)) { DALI_LOG_ERROR("Error reading the BMP image\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } for(std::uint32_t i = 0; i < rowStride; i += 4) @@ -312,6 +322,7 @@ bool DecodeBF32(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(padding)), SEEK_CUR))) { DALI_LOG_ERROR("Error moving past BMP_BITFIELDS32 padding\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } } @@ -343,6 +354,7 @@ bool DecodeBF565(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking RGB565 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -364,6 +376,7 @@ bool DecodeBF565(FILE* fp, } if(DALI_UNLIKELY(fread(pixelsPtr, 1, rowStride, fp) != rowStride)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } } @@ -397,6 +410,7 @@ bool DecodeBF555(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking BMP_BITFIELDS555 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -412,6 +426,7 @@ bool DecodeBF555(FILE* fp, rawPtr = &raw[0] + (j * rawStride); if(DALI_UNLIKELY(fread(rawPtr, 1, rawStride, fp) != rawStride)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } } @@ -466,6 +481,7 @@ bool DecodeRGB555(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking BMP_RGB555 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -480,6 +496,7 @@ bool DecodeRGB555(FILE* fp, rawPtr = &raw[0] + (j * rawStride); if(DALI_UNLIKELY(fread(rawPtr, 1, rawStride, fp) != rawStride)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } } @@ -532,6 +549,7 @@ bool DecodeRGB1(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking BMP_RGB1 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -543,6 +561,7 @@ bool DecodeRGB1(FILE* fp, if(DALI_UNLIKELY(fread(colorTable, 1, 8, fp) != 8)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -550,6 +569,7 @@ bool DecodeRGB1(FILE* fp, { if(DALI_UNLIKELY(fread(&cmd, 1, 1, fp) != 1)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -624,6 +644,7 @@ bool DecodeRGB4(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking BMP_RGB4 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -635,6 +656,7 @@ bool DecodeRGB4(FILE* fp, if(DALI_UNLIKELY(fread(colorTable, 1, 64, fp) != 64)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -642,6 +664,7 @@ bool DecodeRGB4(FILE* fp, { if(DALI_UNLIKELY(fread(&cmd, 1, 1, fp) != 1)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -700,6 +723,7 @@ bool DecodeRGB8(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking BMP_RGB8 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -710,10 +734,12 @@ bool DecodeRGB8(FILE* fp, if(DALI_UNLIKELY(fread(&colorTable[0], 1, 1024, fp) != 1024)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(DALI_UNLIKELY(fread(&colorIndex[0], 1, width * height, fp) != width * height)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } std::uint8_t ctIndex = 0; @@ -782,11 +808,13 @@ bool DecodeRLE4(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking BMP_RLE4 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(DALI_UNLIKELY(fread(colorTable, 1, 64, fp) != 64)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -798,6 +826,7 @@ bool DecodeRLE4(FILE* fp, } if(DALI_UNLIKELY(fread(cmd, 1, cmdStride, fp) != cmdStride)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(cmd[0] == 0) // ESCAPE @@ -815,6 +844,7 @@ bool DecodeRLE4(FILE* fp, if(DALI_UNLIKELY(fread(cmd, 1, cmdStride, fp) != cmdStride)) { DALI_LOG_ERROR("Error reading the BMP image\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } dx = cmd[0] & (0xFF); @@ -834,6 +864,7 @@ bool DecodeRLE4(FILE* fp, if(DALI_UNLIKELY(fread(&run[0], 1, bytesize, fp) != bytesize)) { DALI_LOG_ERROR("Error reading the BMP image\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if((x & 1) == 0) @@ -944,11 +975,13 @@ bool DecodeRLE8(FILE* fp, if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(offset)), SEEK_SET))) { DALI_LOG_ERROR("Error seeking BMP_RLE8 data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(DALI_UNLIKELY(fread(&colorTable[0], 1, 1024, fp) != 1024)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -966,6 +999,7 @@ bool DecodeRLE8(FILE* fp, } if(DALI_UNLIKELY(fread(cmd, 1, cmdStride, fp) != cmdStride)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -984,6 +1018,7 @@ bool DecodeRLE8(FILE* fp, if(DALI_UNLIKELY(fread(cmd, 1, cmdStride, fp) != cmdStride)) { DALI_LOG_ERROR("Error reading the BMP image\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } dx = cmd[0] & (0xFF); @@ -1001,6 +1036,7 @@ bool DecodeRLE8(FILE* fp, if(DALI_UNLIKELY(fread(&run[0], 1, length, fp) != length)) { DALI_LOG_ERROR("Error reading the BMP image\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -1146,12 +1182,14 @@ bool LoadBitmapFromBmp(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel { if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(14 + infoHeader.infoHeaderSize + 1)), SEEK_SET))) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } char mask; if(DALI_UNLIKELY(fread(&mask, 1, 1, fp) != 1)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -1346,6 +1384,7 @@ bool LoadBitmapFromBmp(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel if(DALI_UNLIKELY(fread(pixelsIterator, 1, rowStride, fp) != rowStride)) { DALI_LOG_ERROR("Error reading the BMP image\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); break; } @@ -1381,6 +1420,7 @@ bool LoadBitmapFromBmp(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel if(DALI_UNLIKELY(fseek(fp, static_cast(static_cast(padding)), SEEK_CUR))) // move past the padding. { DALI_LOG_ERROR("Error moving past BMP padding\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } } diff --git a/dali/internal/imaging/common/loader-gif.cpp b/dali/internal/imaging/common/loader-gif.cpp index c8e909188..5945ce1a0 100644 --- a/dali/internal/imaging/common/loader-gif.cpp +++ b/dali/internal/imaging/common/loader-gif.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include // We need to check if giflib has the new open and close API (including error parameter). @@ -85,8 +86,15 @@ const unsigned int INTERLACE_PAIR_TABLE_SIZE(sizeof(INTERLACE_PAIR_TABLE) / size /// Function used by Gif_Lib to read from the image file. int ReadDataFromGif(GifFileType* gifInfo, GifByteType* data, int length) { - FILE* fp = reinterpret_cast(gifInfo->UserData); - return fread(data, sizeof(GifByteType), length, fp); + FILE* fp = reinterpret_cast(gifInfo->UserData); + const int actualLength = fread(data, sizeof(GifByteType), length, fp); + if(DALI_UNLIKELY(actualLength != length)) + { + DALI_LOG_ERROR("Error read bytes (required : %d, actual read : %d)\n", length, actualLength); + DALI_PRINT_SYSTEM_ERROR_LOG(); + } + + return actualLength; } /// Loads the GIF Header. diff --git a/dali/internal/imaging/common/loader-ico.cpp b/dali/internal/imaging/common/loader-ico.cpp index b7d79b3e9..401dac6ed 100644 --- a/dali/internal/imaging/common/loader-ico.cpp +++ b/dali/internal/imaging/common/loader-ico.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,6 +57,7 @@ // INTERNAL INCLUDES #include #include +#include namespace Dali { @@ -175,6 +176,7 @@ bool LoadIcoHeaderHelper(FILE* fp, if(DALI_UNLIKELY(fseek(fp, 0, SEEK_END))) { DALI_LOG_ERROR("Error seeking ICO data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -189,12 +191,14 @@ bool LoadIcoHeaderHelper(FILE* fp, if(DALI_UNLIKELY(0u == fsize)) { DALI_LOG_ERROR("Error ICO data size is zero!\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(DALI_UNLIKELY(fseek(fp, 0, SEEK_SET))) { DALI_LOG_ERROR("Error seeking ICO data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -206,7 +210,8 @@ bool LoadIcoHeaderHelper(FILE* fp, map.ResizeUninitialized(fsize); if(DALI_UNLIKELY(fread(&map[0], 1, fsize, fp) != fsize)) { - DALI_LOG_WARNING("image file read opeation error!\n"); + DALI_LOG_ERROR("image file read opeation error!\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -496,7 +501,7 @@ bool HandleBitsPerPixel( default: { - DALI_LOG_WARNING("Image file contains unsupported bits-per-pixel %d\n", bitcount); + DALI_LOG_ERROR("Image file contains unsupported bits-per-pixel %d\n", bitcount); return false; } } @@ -652,7 +657,7 @@ bool LoadBitmapFromIco(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel } if(diff_size) { - DALI_LOG_WARNING("Broken ICO file!\n"); + DALI_LOG_ERROR("Broken ICO file!\n"); } if(DALI_UNLIKELY(!read_ushort(inputBufferPtr, fsize, &position, &word))) diff --git a/dali/internal/imaging/common/loader-jpeg-turbo.cpp b/dali/internal/imaging/common/loader-jpeg-turbo.cpp index 43b0a3364..1fb1040e4 100644 --- a/dali/internal/imaging/common/loader-jpeg-turbo.cpp +++ b/dali/internal/imaging/common/loader-jpeg-turbo.cpp @@ -41,6 +41,7 @@ #include #include #include +#include namespace { @@ -106,7 +107,7 @@ static bool IsSubsamplingFormatEnabled(int chrominanceSubsampling) if(DALI_UNLIKELY(chrominanceSubsampling >= TJ_NUMSAMP)) { - DALI_LOG_WARNING("WARNING! Input subsampling value [%d] is bigger than turbojpeg library support [%d]\n", chrominanceSubsampling, TJ_NUMSAMP); + DALI_LOG_ERROR("WARNING! Input subsampling value [%d] is bigger than turbojpeg library support [%d]\n", chrominanceSubsampling, TJ_NUMSAMP); } return chrominanceSubsampling < TJ_NUMSAMP ? gSubsamplingFormatTable[chrominanceSubsampling] : false; @@ -162,7 +163,7 @@ bool IsJpegDecodingFailed() } else { - DALI_LOG_WARNING("%s\n", errorString.c_str()); + DALI_LOG_DEBUG_INFO("%s\n", errorString.c_str()); return false; } } @@ -670,6 +671,7 @@ bool LoadJpegFile(const Dali::ImageLoader::Input& input, Vector& jpegBu if(DALI_UNLIKELY(fseek(fp, 0, SEEK_END))) { DALI_LOG_ERROR("Error seeking to end of file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -683,12 +685,14 @@ bool LoadJpegFile(const Dali::ImageLoader::Input& input, Vector& jpegBu if(DALI_UNLIKELY(0u == jpegBufferSize)) { DALI_LOG_ERROR("Jpeg buffer size error\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(DALI_UNLIKELY(fseek(fp, 0, SEEK_SET))) { DALI_LOG_ERROR("Error seeking to start of file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -707,12 +711,14 @@ bool LoadJpegFile(const Dali::ImageLoader::Input& input, Vector& jpegBu if(DALI_UNLIKELY(fread(jpegBufferPtr, 1, jpegBufferSize, fp) != jpegBufferSize)) { DALI_LOG_ERROR("Error on image file read.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(DALI_UNLIKELY(fseek(fp, 0, SEEK_SET))) { DALI_LOG_ERROR("Error seeking to start of file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -1177,7 +1183,7 @@ JpegTransform ConvertExifOrientation(ExifData* exifData) default: { // Try to keep loading the file, but let app developer know there was something fishy: - DALI_LOG_WARNING("Incorrect/Unknown Orientation setting found in EXIF header of JPEG image (%x). Orientation setting will be ignored.\n", entry); + DALI_LOG_DEBUG_INFO("Incorrect/Unknown Orientation setting found in EXIF header of JPEG image (%x). Orientation setting will be ignored.\n", entry); break; } } @@ -1207,7 +1213,7 @@ bool TransformSize(int requiredWidth, int requiredHeight, FittingMode::Type fitt tjscalingfactor* factors = tjGetScalingFactors(&numFactors); if(DALI_UNLIKELY(factors == NULL)) { - DALI_LOG_WARNING("TurboJpeg tjGetScalingFactors error!\n"); + DALI_LOG_DEBUG_INFO("TurboJpeg tjGetScalingFactors error!\n"); success = false; } else @@ -1319,6 +1325,7 @@ ExifHandle LoadExifData(FILE* fp) if(DALI_UNLIKELY(fseek(fp, 0, SEEK_SET))) { DALI_LOG_ERROR("Error seeking to start of file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); } else { @@ -1330,6 +1337,7 @@ ExifHandle LoadExifData(FILE* fp) int size = fread(dataBuffer, 1, sizeof(dataBuffer), fp); if(size <= 0) { + DALI_PRINT_SYSTEM_ERROR_LOG(); break; } if(!exif_loader_write(exifLoader.get(), dataBuffer, size)) diff --git a/dali/internal/imaging/common/loader-ktx.cpp b/dali/internal/imaging/common/loader-ktx.cpp index c876d5573..852096d32 100644 --- a/dali/internal/imaging/common/loader-ktx.cpp +++ b/dali/internal/imaging/common/loader-ktx.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,14 @@ #include // EXTERNAL INCLUDES -#include #include -#include #include +// INTERNAL INCLUDES +#include +#include +#include + namespace Dali { namespace TizenPlatform @@ -189,6 +192,7 @@ inline bool ReadHeader(FILE* filePointer, KtxFileHeader& header) // Load the information directly into our structure if(DALI_UNLIKELY(fread(&header, 1, readLength, filePointer) != readLength)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -506,7 +510,7 @@ bool LoadKtxHeader(FILE* const fp, unsigned int& width, unsigned int& height, Kt // Warn if there is space wasted in the file: if(fileHeader.bytesOfKeyValueData > 0U) { - DALI_LOG_WARNING("Loading of KTX file with key/value header data requested. This should be stripped in application asset/resource build.\n"); + DALI_LOG_DEBUG_INFO("Loading of KTX file with key/value header data requested. This should be stripped in application asset/resource build.\n"); } return headerIsValid; @@ -551,6 +555,7 @@ bool LoadBitmapFromKtx(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel if(DALI_UNLIKELY(fseek(fp, (long int)(imageSizeOffset), SEEK_SET))) { DALI_LOG_ERROR("Seek past key/vals in KTX compressed bitmap file failed.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -559,6 +564,7 @@ bool LoadBitmapFromKtx(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel if(DALI_UNLIKELY(fread(&imageByteCount, 1, 4, fp) != 4)) { DALI_LOG_ERROR("Read of image size failed.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } // Sanity-check the image size: @@ -601,6 +607,7 @@ bool LoadBitmapFromKtx(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel if(DALI_UNLIKELY(bytesRead != imageByteCount)) { DALI_LOG_ERROR("Read of image pixel data failed.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } diff --git a/dali/internal/imaging/common/loader-pkm.cpp b/dali/internal/imaging/common/loader-pkm.cpp index 71b140460..cee3908d8 100644 --- a/dali/internal/imaging/common/loader-pkm.cpp +++ b/dali/internal/imaging/common/loader-pkm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ // INTERNAL INCLUDES #include ///< for Internal::Adaptor::PixelBuffer::New() +#include namespace Dali { @@ -132,6 +133,7 @@ bool LoadPkmHeader(FILE* const filePointer, unsigned int& width, unsigned int& h const unsigned int readLength = sizeof(PkmFileHeader); if(DALI_UNLIKELY(fread(&fileHeader, 1, readLength, filePointer) != readLength)) { + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -206,6 +208,7 @@ bool LoadBitmapFromPkm(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel if(DALI_UNLIKELY(fseek(filePointer, 0L, SEEK_END))) { DALI_LOG_ERROR("Could not seek through file.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -213,12 +216,14 @@ bool LoadBitmapFromPkm(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel if(DALI_UNLIKELY(fileSize == -1L)) { DALI_LOG_ERROR("Could not determine PKM file size.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(DALI_UNLIKELY(fseek(filePointer, sizeof(PkmFileHeader), SEEK_SET))) { DALI_LOG_ERROR("Could not seek through file.\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } @@ -252,6 +257,7 @@ bool LoadBitmapFromPkm(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel if(DALI_UNLIKELY(bytesRead != imageByteCount)) { DALI_LOG_ERROR("Read of image pixel data failed. (required image bytes : %zu, actual read from file : %zu\n", imageByteCount, bytesRead); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } diff --git a/dali/internal/imaging/common/loader-png.cpp b/dali/internal/imaging/common/loader-png.cpp index fa855db1b..7bda02869 100644 --- a/dali/internal/imaging/common/loader-png.cpp +++ b/dali/internal/imaging/common/loader-png.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include #include +#include namespace Dali { @@ -62,6 +63,7 @@ bool LoadPngHeader(FILE* fp, unsigned int& width, unsigned int& height, png_stru if(DALI_UNLIKELY(size != 8)) { DALI_LOG_ERROR("fread failed\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } diff --git a/dali/internal/imaging/common/loader-wbmp.cpp b/dali/internal/imaging/common/loader-wbmp.cpp index 1f8f0c354..57b3a41c8 100644 --- a/dali/internal/imaging/common/loader-wbmp.cpp +++ b/dali/internal/imaging/common/loader-wbmp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ // INTERNAL INCLUDES #include #include +#include namespace Dali { @@ -130,6 +131,7 @@ bool LoadWbmpHeader(FILE* const fp, unsigned int& width, unsigned int& height, u if(DALI_UNLIKELY(fseek(fp, 0, SEEK_END))) { DALI_LOG_ERROR("Error seeking WBMP data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } long positionIndicator = ftell(fp); @@ -143,12 +145,14 @@ bool LoadWbmpHeader(FILE* const fp, unsigned int& width, unsigned int& height, u if(DALI_UNLIKELY(0u == fsize)) { DALI_LOG_ERROR("Error: filesize is 0!\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(DALI_UNLIKELY(fseek(fp, 0, SEEK_SET))) { DALI_LOG_ERROR("Error seeking WBMP data\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } if(DALI_UNLIKELY(fsize <= 4)) @@ -177,7 +181,8 @@ bool LoadWbmpHeader(FILE* const fp, unsigned int& width, unsigned int& height, u map.ResizeUninitialized(fsize); if(DALI_UNLIKELY(fread(&map[0], 1, readDataSize, fp) != readDataSize)) { - DALI_LOG_WARNING("image file read opeation error! fileSize : %u, readDataSize : %u\n", fsize, readDataSize); + DALI_LOG_ERROR("image file read opeation error! fileSize : %u, readDataSize : %u\n", fsize, readDataSize); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } diff --git a/dali/internal/imaging/common/webp-loading.cpp b/dali/internal/imaging/common/webp-loading.cpp index fe2a66f40..799cc2f0d 100644 --- a/dali/internal/imaging/common/webp-loading.cpp +++ b/dali/internal/imaging/common/webp-loading.cpp @@ -43,6 +43,7 @@ // INTERNAL INCLUDES #include #include +#include typedef uint8_t WebPByteType; @@ -209,9 +210,22 @@ public: if(DALI_UNLIKELY(fseek(fp, 0, SEEK_END) <= -1)) { DALI_LOG_ERROR("Error seeking within file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); + return false; + } + long positionIndicator = ftell(fp); + + if(positionIndicator > -1L) + { + mBufferSize = static_cast(positionIndicator); + } + + if(DALI_UNLIKELY(mBufferSize == 0u)) + { + DALI_LOG_ERROR("Error: filesize is 0!\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } - mBufferSize = ftell(fp); } if(DALI_LIKELY(!fseek(fp, 0, SEEK_SET))) @@ -225,6 +239,7 @@ public: if(DALI_UNLIKELY(fread(mBuffer, sizeof(WebPByteType), mBufferSize, fp) != mBufferSize)) { DALI_LOG_ERROR("Error read file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); return false; } return true; @@ -232,6 +247,7 @@ public: else { DALI_LOG_ERROR("Error seeking within file\n"); + DALI_PRINT_SYSTEM_ERROR_LOG(); } } else diff --git a/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp b/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp index dea39bfb3..e0e0f3b1a 100644 --- a/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp +++ b/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -152,7 +152,7 @@ void NativeImageSourceTizen::Initialize() } default: { - DALI_LOG_WARNING("Wrong color depth.\n"); + DALI_LOG_ERROR("Wrong color depth.\n"); return; } } @@ -328,7 +328,7 @@ bool NativeImageSourceTizen::GetPixels(std::vector& pixbuf, uint32_t& w return true; } - DALI_LOG_WARNING("TBM surface does not exist.\n"); + DALI_LOG_ERROR("TBM surface does not exist.\n"); width = 0; height = 0; @@ -376,7 +376,7 @@ bool NativeImageSourceTizen::SetPixels(uint8_t* pixbuf, const Pixel::Format& pix { size_t sOffset = c * inputBufferLinePixelSize; size_t dOffset = c * 3; - size_t offset = dOffset + r * stride; + size_t offset = dOffset + r * stride; ptr[offset + 2] = *(bufptr + sOffset); ptr[offset + 1] = *(bufptr + sOffset + 1); ptr[offset] = *(bufptr + sOffset + 2); @@ -395,7 +395,7 @@ bool NativeImageSourceTizen::SetPixels(uint8_t* pixbuf, const Pixel::Format& pix { size_t sOffset = c * inputBufferLinePixelSize; size_t dOffset = c * 4; - size_t offset = dOffset + r * stride; + size_t offset = dOffset + r * stride; ptr[offset + 3] = *(bufptr + sOffset); ptr[offset + 2] = *(bufptr + sOffset + 1); ptr[offset + 1] = *(bufptr + sOffset + 2); @@ -415,7 +415,7 @@ bool NativeImageSourceTizen::SetPixels(uint8_t* pixbuf, const Pixel::Format& pix { size_t sOffset = c * inputBufferLinePixelSize; size_t dOffset = c * 4; - size_t offset = dOffset + r * stride; + size_t offset = dOffset + r * stride; ptr[offset + 2] = *(bufptr + sOffset); ptr[offset + 1] = *(bufptr + sOffset + 1); ptr[offset] = *(bufptr + sOffset + 2); @@ -441,7 +441,7 @@ bool NativeImageSourceTizen::SetPixels(uint8_t* pixbuf, const Pixel::Format& pix return true; } - DALI_LOG_WARNING("TBM surface does not exist.\n"); + DALI_LOG_ERROR("TBM surface does not exist.\n"); return false; } diff --git a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp index e5fe55ca8..c8761c406 100644 --- a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp +++ b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -175,7 +175,7 @@ void NativeImageSourceQueueTizen::Initialize(Dali::NativeImageSourceQueue::Color } default: { - DALI_LOG_WARNING("Wrong color format.\n"); + DALI_LOG_ERROR("Wrong color format.\n"); return; } } diff --git a/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp b/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp index efbeeb592..390d94d14 100644 --- a/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp +++ b/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -246,7 +246,7 @@ bool NativeImageSourceX::GetPixels(std::vector& pixbuf, uint32_t& width } default: { - DALI_LOG_WARNING("Pixmap has unsupported bit-depth for getting pixels: %u\n", pXImage->depth); + DALI_LOG_ERROR("Pixmap has unsupported bit-depth for getting pixels: %u\n", pXImage->depth); } } } diff --git a/dali/internal/imaging/windows/file-download-win.cpp b/dali/internal/imaging/windows/file-download-win.cpp index 10af2c257..92c5eb646 100644 --- a/dali/internal/imaging/windows/file-download-win.cpp +++ b/dali/internal/imaging/windows/file-download-win.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -230,7 +230,7 @@ bool DownloadRemoteFileIntoMemory(const std::string& url, { if(url.empty()) { - DALI_LOG_WARNING("empty url requested \n"); + DALI_LOG_ERROR("empty url requested \n"); return false; } diff --git a/dali/internal/imaging/x11/native-image-source-impl-x.cpp b/dali/internal/imaging/x11/native-image-source-impl-x.cpp index 32eedc6c9..08e409d33 100644 --- a/dali/internal/imaging/x11/native-image-source-impl-x.cpp +++ b/dali/internal/imaging/x11/native-image-source-impl-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -250,7 +250,7 @@ bool NativeImageSourceX::GetPixels(std::vector& pixbuf, unsigned& } default: { - DALI_LOG_WARNING("Pixmap has unsupported bit-depth for getting pixels: %u\n", pXImage->depth); + DALI_LOG_ERROR("Pixmap has unsupported bit-depth for getting pixels: %u\n", pXImage->depth); } } } diff --git a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp index ec4d3a9e2..7a505faf6 100644 --- a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp +++ b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp @@ -398,12 +398,12 @@ void InputMethodContextEcoreWl::CreateContext() } else { - DALI_LOG_WARNING("InputMethodContext Unable to get IMFContext\n"); + DALI_LOG_ERROR("InputMethodContext Unable to get IMFContext (contextId:%p)\n", contextId); } } else { - DALI_LOG_WARNING("InputMethodContext Unable to get IMFContext\n"); + DALI_LOG_ERROR("InputMethodContext Unable to get IMFContext (contextId:(null))\n"); } } @@ -893,7 +893,7 @@ Rect InputMethodContextEcoreWl::GetInputMethodArea() } else { - DALI_LOG_WARNING("VKB Unable to get IMFContext so GetSize unavailable\n"); + DALI_LOG_ERROR("VKB Unable to get IMFContext so GetSize unavailable\n"); // return 0 as real size unknown. } @@ -908,7 +908,7 @@ void InputMethodContextEcoreWl::ApplyOptions(const InputMethodOptions& options) if(mIMFContext == NULL) { - DALI_LOG_WARNING("VKB Unable to excute ApplyOptions with Null ImfContext\n"); + DALI_LOG_ERROR("VKB Unable to excute ApplyOptions with Null ImfContext\n"); return; } diff --git a/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp b/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp index d530ca2ed..b7b104b45 100644 --- a/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp +++ b/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -585,7 +585,7 @@ Rect InputMethodContextX::GetInputMethodArea() } else { - DALI_LOG_WARNING("VKB Unable to get InputMethodContext Context so GetSize unavailable\n"); + DALI_LOG_ERROR("VKB Unable to get InputMethodContext Context so GetSize unavailable\n"); } return Rect(xPos, yPos, width, height); @@ -599,7 +599,7 @@ void InputMethodContextX::ApplyOptions(const InputMethodOptions& options) if(mIMFContext == NULL) { - DALI_LOG_WARNING("VKB Unable to excute ApplyOptions with Null ImfContext\n"); + DALI_LOG_ERROR("VKB Unable to excute ApplyOptions with Null ImfContext\n"); return; } diff --git a/dali/internal/legacy/common/tizen-platform-abstraction.cpp b/dali/internal/legacy/common/tizen-platform-abstraction.cpp index 9f933cbfb..3d3c54460 100644 --- a/dali/internal/legacy/common/tizen-platform-abstraction.cpp +++ b/dali/internal/legacy/common/tizen-platform-abstraction.cpp @@ -123,7 +123,7 @@ Integration::BitmapPtr TizenPlatformAbstraction::DecodeBuffer(const Integration: if(!result || !bitmap) { bitmap.Reset(); - DALI_LOG_WARNING("Unable to decode bitmap supplied as in-memory blob.\n"); + DALI_LOG_ERROR("Unable to decode bitmap supplied as in-memory blob.\n"); } else { diff --git a/dali/internal/system/common/file-closer.h b/dali/internal/system/common/file-closer.h index fca9d127c..3df5f3e1b 100644 --- a/dali/internal/system/common/file-closer.h +++ b/dali/internal/system/common/file-closer.h @@ -1,7 +1,7 @@ #ifndef DALI_INTERNAL_PLATFORM_FILECLOSER_H #define DALI_INTERNAL_PLATFORM_FILECLOSER_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,7 +107,7 @@ protected: // prevent this class being directly instantiated if(mFile == 0) { - DALI_LOG_WARNING("File open failed for memory buffer at location: \"%p\", of size: \"%u\", in mode: \"%s\".\n", static_cast(buffer), static_cast(dataSize), mode); + DALI_LOG_ERROR("File open failed for memory buffer at location: \"%p\", of size: \"%u\", in mode: \"%s\".\n", static_cast(buffer), static_cast(dataSize), mode); } } @@ -122,7 +122,7 @@ protected: // prevent this class being directly instantiated if(closeFailed) { - DALI_LOG_WARNING("File close failed for FILE: \"%p\".\n", static_cast(mFile)); + DALI_LOG_ERROR("File close failed for FILE: \"%p\".\n", static_cast(mFile)); } mFile = 0; } diff --git a/dali/internal/system/common/trigger-event.cpp b/dali/internal/system/common/trigger-event.cpp index 38412cce1..821a10ff2 100644 --- a/dali/internal/system/common/trigger-event.cpp +++ b/dali/internal/system/common/trigger-event.cpp @@ -88,7 +88,7 @@ void TriggerEvent::Trigger() } else { - DALI_LOG_WARNING("Attempting to write to an invalid file descriptor\n"); + DALI_LOG_ERROR("Attempting to write to an invalid file descriptor\n"); } } @@ -107,7 +107,7 @@ void TriggerEvent::Triggered(FileDescriptorMonitor::EventType eventBitMask, int size = read(mFileDescriptor, &receivedData, sizeof(uint64_t)); if(size != sizeof(uint64_t)) { - DALI_LOG_WARNING("Unable to read to UpdateEvent File descriptor\n"); + DALI_LOG_ERROR("Unable to read to UpdateEvent File descriptor\n"); DALI_PRINT_SYSTEM_ERROR_LOG(); } diff --git a/dali/internal/system/macos/file-descriptor-monitor-macos.cpp b/dali/internal/system/macos/file-descriptor-monitor-macos.cpp index acd90da6b..9556d967d 100644 --- a/dali/internal/system/macos/file-descriptor-monitor-macos.cpp +++ b/dali/internal/system/macos/file-descriptor-monitor-macos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ namespace Dali::Internal::Adaptor FileDescriptorMonitorMac::FileDescriptorMonitorMac(int fileDescriptor, CallbackBase* callback, int eventBitmask) : FileDescriptorMonitor(fileDescriptor, callback, eventBitmask) { - DALI_LOG_WARNING("Implementation missing for macOS"); + DALI_LOG_WARNING_NOFN("Implementation missing for macOS"); } FileDescriptorMonitorMac::~FileDescriptorMonitorMac() diff --git a/dali/internal/system/windows/file-descriptor-monitor-windows.cpp b/dali/internal/system/windows/file-descriptor-monitor-windows.cpp index eee61f272..d9b1c3666 100644 --- a/dali/internal/system/windows/file-descriptor-monitor-windows.cpp +++ b/dali/internal/system/windows/file-descriptor-monitor-windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ namespace Adaptor FileDescriptorMonitorWin::FileDescriptorMonitorWin(int fileDescriptor, CallbackBase* callback, int eventBitmask) : FileDescriptorMonitor(fileDescriptor, callback, eventBitmask) { - DALI_LOG_WARNING("Implementation missing for MS Windows"); + DALI_LOG_WARNING_NOFN("Implementation missing for MS Windows"); } FileDescriptorMonitorWin::~FileDescriptorMonitorWin() diff --git a/dali/internal/system/windows/trigger-event.cpp b/dali/internal/system/windows/trigger-event.cpp index 314621d78..f1c9efaab 100644 --- a/dali/internal/system/windows/trigger-event.cpp +++ b/dali/internal/system/windows/trigger-event.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ void TriggerEvent::Trigger() } else { - DALI_LOG_WARNING("Attempting to write to an invalid file descriptor\n"); + DALI_LOG_ERROR("Attempting to write to an invalid file descriptor\n"); } } diff --git a/dali/internal/text/text-abstraction/cairo-renderer.cpp b/dali/internal/text/text-abstraction/cairo-renderer.cpp index 4df796483..b94c67d63 100644 --- a/dali/internal/text/text-abstraction/cairo-renderer.cpp +++ b/dali/internal/text/text-abstraction/cairo-renderer.cpp @@ -207,7 +207,7 @@ void WrapToCircularPath(cairo_t* cr, cairo_t* circularCr, const Dali::TextAbstra } default: { - DALI_LOG_WARNING("Type of path not handled.\n"); + DALI_LOG_ERROR("Type of path not handled.\n"); // Nothing else to do. break; } diff --git a/dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.cpp b/dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.cpp index a094f13ae..c0dc05e35 100644 --- a/dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.cpp +++ b/dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.cpp @@ -98,10 +98,10 @@ DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_FONT_PERFORMANCE_MARKER, false); /** * Conversion from Fractional26.6 to float */ -const float FROM_266 = 1.0f / 64.0f; -const float POINTS_PER_INCH = 72.f; +const float FROM_266 = 1.0f / 64.0f; +const float POINTS_PER_INCH = 72.f; const uint32_t FONT_AXIS_NAME_LEN = 4; -const uint32_t FROM_16DOT16 = (1 << 16); +const uint32_t FROM_16DOT16 = (1 << 16); const uint32_t ELLIPSIS_CHARACTER = 0x2026; const uint32_t CUSTOM_FONTS_MAX_COUNT = 10u; @@ -155,12 +155,12 @@ bool IsFitIntoAtlas(FT_Face& ftFace, int& error, const unsigned int& horizontalD */ void ConvertTagToString(FT_ULong tag, char buffer[5]) { - // the tag is same format as used in Harfbuzz. - buffer[0] = (tag >> 24) & 0xFF; - buffer[1] = (tag >> 16) & 0xFF; - buffer[2] = (tag >> 8) & 0xFF; - buffer[3] = tag & 0xFF; - buffer[4] = 0; + // the tag is same format as used in Harfbuzz. + buffer[0] = (tag >> 24) & 0xFF; + buffer[1] = (tag >> 16) & 0xFF; + buffer[2] = (tag >> 8) & 0xFF; + buffer[3] = tag & 0xFF; + buffer[4] = 0; } /** @@ -474,8 +474,8 @@ void FontClient::Plugin::GetDescription(FontId fontId, case FontDescription::FACE_FONT: { for(auto it = mCacheHandler->mFontDescriptionSizeCache.Begin(); - it != mCacheHandler->mFontDescriptionSizeCache.End(); - it++) + it != mCacheHandler->mFontDescriptionSizeCache.End(); + it++) { const auto& item = mCacheHandler->mFontDescriptionSizeCache.GetElement(it); if(item == fontIdCacheItem.index) @@ -491,8 +491,8 @@ void FontClient::Plugin::GetDescription(FontId fontId, } case FontDescription::BITMAP_FONT: { - fontDescription.type = FontDescription::BITMAP_FONT; - auto it = mCacheHandler->mBitmapFontCache.find(fontIdCacheItem.index); + fontDescription.type = FontDescription::BITMAP_FONT; + auto it = mCacheHandler->mBitmapFontCache.find(fontIdCacheItem.index); if(it != mCacheHandler->mBitmapFontCache.end()) { fontDescription.family = it->second.font.name; @@ -612,9 +612,9 @@ FontId FontClient::Plugin::FindFontForCharacter(const FontList& fontList { if(mCacheHandler->IsFontIdCacheItemExist(fontId - 1u)) { - auto index = mCacheHandler->FindFontIdCacheItem(fontId - 1u).index; - const FontFaceCacheItem& item = mCacheHandler->FindFontFaceCacheItem(index); - foundColor = item.mHasColorTables; + auto index = mCacheHandler->FindFontIdCacheItem(fontId - 1u).index; + const FontFaceCacheItem& item = mCacheHandler->FindFontFaceCacheItem(index); + foundColor = item.mHasColorTables; } DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " foundColor : %s\n", (foundColor ? "true" : "false")); @@ -796,8 +796,7 @@ FontId FontClient::Plugin::GetFontId(const FontDescription& fontDescription, FontCacheIndex fontCacheIndex = 0u; // Check if exists a pair 'fontDescriptionId, requestedPointSize' in the cache. - if(!mCacheHandler->FindFont(fontDescriptionId, requestedPointSize, fontCacheIndex, variationsMapPtr) - || !mCacheHandler->IsFontFaceCacheItemExist(fontCacheIndex)) + if(!mCacheHandler->FindFont(fontDescriptionId, requestedPointSize, fontCacheIndex, variationsMapPtr) || !mCacheHandler->IsFontFaceCacheItemExist(fontCacheIndex)) { if(fontDescriptionId > 0u && fontDescriptionId <= mCacheHandler->mCharacterSetCache.Count()) { @@ -811,7 +810,7 @@ FontId FontClient::Plugin::GetFontId(const FontDescription& fontDescription, if(fontId > 0u && mCacheHandler->IsFontIdCacheItemExist(fontId - 1u)) { - fontCacheIndex = mCacheHandler->FindFontIdCacheItem(fontId - 1u).index; + fontCacheIndex = mCacheHandler->FindFontIdCacheItem(fontId - 1u).index; mCacheHandler->FindFontFaceCacheItem(fontCacheIndex).mCharacterSet = FcCharSetCopy(mCacheHandler->mCharacterSetCache[fontDescriptionId - 1u]); } @@ -930,8 +929,8 @@ bool FontClient::Plugin::GetVectorMetrics(GlyphInfo* array, FontId fontId = array[i].fontId; if(mCacheHandler->IsFontIdCacheItemExist(fontId - 1u)) { - auto index = mCacheHandler->FindFontIdCacheItem(fontId - 1u).index; - FontFaceCacheItem& font = mCacheHandler->FindFontFaceCacheItem(index); + auto index = mCacheHandler->FindFontIdCacheItem(fontId - 1u).index; + FontFaceCacheItem& font = mCacheHandler->FindFontFaceCacheItem(index); if(!font.mVectorFontId) { @@ -1281,13 +1280,13 @@ FontId FontClient::Plugin::CreateFont(const FontPath& path, error = FT_Get_MM_Var(ftFace, &mm_var); if(FT_Err_Ok == error) { - FT_Fixed *coordinates = new FT_Fixed[mm_var->num_axis]; + FT_Fixed* coordinates = new FT_Fixed[mm_var->num_axis]; for(uint32_t axisIndex = 0; axisIndex < mm_var->num_axis; axisIndex++) { char stringTag[FONT_AXIS_NAME_LEN + 1]; ConvertTagToString(mm_var->axis[axisIndex].tag, stringTag); - auto valuePtr = variationsMap.Find(stringTag); - float value = 0.0f; + auto valuePtr = variationsMap.Find(stringTag); + float value = 0.0f; if(valuePtr != nullptr && valuePtr->Get(value)) { @@ -1370,7 +1369,7 @@ FontId FontClient::Plugin::CreateFont(const FontPath& path, if(requestedPointSize != requestedPointSizeBackup) { - DALI_LOG_WARNING(" The requested-point-size : %d, is reduced to point-size : %d\n", requestedPointSizeBackup, requestedPointSize); + DALI_LOG_DEBUG_INFO(" The requested-point-size : %d, is reduced to point-size : %d\n", requestedPointSizeBackup, requestedPointSize); } } else diff --git a/dali/internal/window-system/android/window-system-android.cpp b/dali/internal/window-system/android/window-system-android.cpp index 2b1e5c5c4..db03686c0 100644 --- a/dali/internal/window-system/android/window-system-android.cpp +++ b/dali/internal/window-system/android/window-system-android.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ void GetScreenSize(int32_t& width, int32_t& height) ANativeWindow* window = Dali::Integration::AndroidFramework::Get().GetApplicationWindow(); width = ANativeWindow_getWidth(window); height = ANativeWindow_getHeight(window); - DALI_LOG_WARNING("Native window width %d, height %d", width, height); + DALI_LOG_DEBUG_INFO("Native window width %d, height %d", width, height); } void UpdateScreenSize() -- 2.34.1