From e13f416f21a48a17f343ead074edb48d17602882 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 17 Oct 2018 11:54:35 +0900 Subject: [PATCH] Fix some issues - Remove DALI_ADAPTOR_API from unnecessary function - Fix error handling code Change-Id: If9ffbf36257b19d1f1ad0f695bc87cce6443f978 --- dali/devel-api/adaptor-framework/image-loading.cpp | 9 +-------- dali/devel-api/adaptor-framework/image-loading.h | 7 ------- dali/internal/adaptor/common/adaptor-impl.cpp | 4 ++-- dali/internal/imaging/common/image-loader.cpp | 11 +++++++++++ dali/internal/imaging/common/image-loader.h | 14 ++++++++++++++ dali/internal/video/common/video-player-impl.cpp | 9 ++++++--- 6 files changed, 34 insertions(+), 20 deletions(-) diff --git a/dali/devel-api/adaptor-framework/image-loading.cpp b/dali/devel-api/adaptor-framework/image-loading.cpp index 60dabc1..af05256 100644 --- a/dali/devel-api/adaptor-framework/image-loading.cpp +++ b/dali/devel-api/adaptor-framework/image-loading.cpp @@ -33,8 +33,6 @@ namespace // limit maximum image down load size to 50 MB const size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE = 50 * 1024 * 1024 ; -static unsigned int gMaxTextureSize = 4096; - } Devel::PixelBuffer LoadImageFromFile( const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection ) @@ -114,14 +112,9 @@ Devel::PixelBuffer DownloadImageSynchronously( const std::string& url, ImageDime return Dali::Devel::PixelBuffer(); } -void SetMaxTextureSize( unsigned int size ) -{ - gMaxTextureSize = size; -} - unsigned int GetMaxTextureSize() { - return gMaxTextureSize; + return TizenPlatform::ImageLoader::GetMaxTextureSize(); } } // namespace Dali diff --git a/dali/devel-api/adaptor-framework/image-loading.h b/dali/devel-api/adaptor-framework/image-loading.h index 3c19be0..a7995ba 100755 --- a/dali/devel-api/adaptor-framework/image-loading.h +++ b/dali/devel-api/adaptor-framework/image-loading.h @@ -90,13 +90,6 @@ DALI_ADAPTOR_API Devel::PixelBuffer DownloadImageSynchronously( bool orientationCorrection = true ); /** - * @brief Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE. - * - * @param [in] size The maximum texture size to set - */ -DALI_ADAPTOR_API void SetMaxTextureSize( unsigned int size ); - -/** * @brief get the maximum texture size. * * @return The maximum texture size diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 149064e..33dce23 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -59,10 +59,10 @@ #include #include -#include #include #include +#include using Dali::TextAbstraction::FontClient; @@ -272,7 +272,7 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: // Set max texture size if( mEnvironmentOptions->GetMaxTextureSize() > 0 ) { - Dali::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() ); + Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() ); } SetupSystemInformation(); diff --git a/dali/internal/imaging/common/image-loader.cpp b/dali/internal/imaging/common/image-loader.cpp index 09c1d00..b83878e 100755 --- a/dali/internal/imaging/common/image-loader.cpp +++ b/dali/internal/imaging/common/image-loader.cpp @@ -45,6 +45,7 @@ namespace Integration::Log::Filter* gLogFilter = Debug::Filter::New( Debug::Concise, false, "LOG_IMAGE_LOADING" ); #endif +static unsigned int gMaxTextureSize = 4096; /** * Enum for file formats, has to be in sync with BITMAP_LOADER_LOOKUP_TABLE @@ -414,6 +415,16 @@ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer return ImageDimensions( width, height ); } +void SetMaxTextureSize( unsigned int size ) +{ + gMaxTextureSize = size; +} + +unsigned int GetMaxTextureSize() +{ + return gMaxTextureSize; +} + } // ImageLoader } // TizenPlatform } // Dali diff --git a/dali/internal/imaging/common/image-loader.h b/dali/internal/imaging/common/image-loader.h index bedd3fa..64e10c5 100644 --- a/dali/internal/imaging/common/image-loader.h +++ b/dali/internal/imaging/common/image-loader.h @@ -81,6 +81,20 @@ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer SamplingMode::Type samplingMode, bool orientationCorrection ); +/** + * @brief Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE. + * + * @param [in] size The maximum texture size to set + */ +void SetMaxTextureSize( unsigned int size ); + +/** + * @brief Get the maximum texture size. + * + * @return The maximum texture size + */ +unsigned int GetMaxTextureSize(); + } // ImageLoader } // TizenPlatform } // Dali diff --git a/dali/internal/video/common/video-player-impl.cpp b/dali/internal/video/common/video-player-impl.cpp index e62f7df..05f371e 100755 --- a/dali/internal/video/common/video-player-impl.cpp +++ b/dali/internal/video/common/video-player-impl.cpp @@ -95,7 +95,9 @@ void VideoPlayer::Initialize() } mCreateVideoPlayerPtr = reinterpret_cast< CreateVideoPlayerFunction >( dlsym( mHandle, "CreateVideoPlayerPlugin" ) ); - if( mCreateVideoPlayerPtr == NULL ) + + error = dlerror(); + if( mCreateVideoPlayerPtr == NULL || error != NULL ) { DALI_LOG_ERROR( "Can't load symbol CreateVideoPlayerPlugin(), error: %s\n", error ); return; @@ -110,12 +112,13 @@ void VideoPlayer::Initialize() } mDestroyVideoPlayerPtr = reinterpret_cast< DestroyVideoPlayerFunction >( dlsym( mHandle, "DestroyVideoPlayerPlugin" ) ); - if( mDestroyVideoPlayerPtr == NULL ) + + error = dlerror(); + if( mDestroyVideoPlayerPtr == NULL || error != NULL ) { DALI_LOG_ERROR( "Can't load symbol DestroyVideoPlayerPlugin(), error: %s\n", error ); return; } - } void VideoPlayer::SetUrl( const std::string& url ) -- 2.7.4