From c909ab6047694ab91c1aad35608db216c1940240 Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Wed, 28 Aug 2019 09:32:15 +0900 Subject: [PATCH] Revert "[Tizen] To get MaxTextureSize by using glGetIntegerv not by using environment variable" This reverts commit d32e2ca1a0b91be571c983e12eda3f5b7b742e00. --- .gitignore | 1 - build/tizen/adaptor/Makefile.am | 19 ++---- build/tizen/adaptor/configure.ac | 8 --- build/tizen/adaptor/system-cache-path.in | 24 ------- dali/internal/adaptor/common/adaptor-impl.cpp | 67 ------------------- .../combined-update-render-controller.cpp | 2 - dali/internal/adaptor/file.list | 3 +- .../graphics/gles/gl-implementation.h | 29 +------- dali/internal/imaging/common/image-loader.cpp | 8 --- dali/internal/imaging/common/image-loader.h | 7 -- 10 files changed, 9 insertions(+), 159 deletions(-) delete mode 100644 build/tizen/adaptor/system-cache-path.in diff --git a/.gitignore b/.gitignore index 3480ca9db..8384ac860 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,3 @@ tags /debugfiles.list /debuglinks.list /debugsources.list -/dali/internal/adaptor/common/system-cache-path.cpp diff --git a/build/tizen/adaptor/Makefile.am b/build/tizen/adaptor/Makefile.am index aec1ab8b4..b11033ffd 100644 --- a/build/tizen/adaptor/Makefile.am +++ b/build/tizen/adaptor/Makefile.am @@ -68,8 +68,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_window_system_ubuntu_x11_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) \ - $(adaptor_dali_src_file) + $(static_libraries_libunibreak_src_files) if ENABLE_NETWORK_LOGGING LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -126,8 +125,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_thread_common_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) \ - $(adaptor_dali_src_file) + $(static_libraries_libunibreak_src_files) if ECORE_WAYLAND2 LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -193,8 +191,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_thread_common_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) \ - $(adaptor_dali_src_file) + $(static_libraries_libunibreak_src_files) if ECORE_WAYLAND2 LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -259,8 +256,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_thread_common_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) \ - $(adaptor_dali_src_file) + $(static_libraries_libunibreak_src_files) if ECORE_WAYLAND2 LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -324,8 +320,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_thread_common_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) \ - $(adaptor_dali_src_file) + $(static_libraries_libunibreak_src_files) if ECORE_WAYLAND2 LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -392,8 +387,7 @@ LIBDALI_ADAPTOR_LA_SOURCES = \ $(adaptor_thread_common_src_files) \ $(devel_api_text_abstraction_src_files) \ $(static_libraries_glyphy_src_files) \ - $(static_libraries_libunibreak_src_files) \ - $(adaptor_dali_src_file) + $(static_libraries_libunibreak_src_files) if ECORE_WAYLAND2 LIBDALI_ADAPTOR_LA_SOURCES += \ @@ -415,6 +409,7 @@ endif endif + # Package doc package_doxy_dir = ../../../doc include ../../../doc/file.list diff --git a/build/tizen/adaptor/configure.ac b/build/tizen/adaptor/configure.ac index b182ba7e4..ca2eb43bf 100644 --- a/build/tizen/adaptor/configure.ac +++ b/build/tizen/adaptor/configure.ac @@ -326,13 +326,6 @@ if test x$FONT_CONFIGURATION_FILE != x; then fontConfigurationFile=$FONT_CONFIGURATION_FILE fi -if test "x$enable_profile" = "xUBUNTU"; then - cachePath=$HOME -else - cachePath="/home/owner" -fi # ubuntu profile test - -AC_SUBST(cachePath) AC_SUBST(dataReadWriteDir) AC_SUBST(dataReadOnlyDir) AC_SUBST(DALI_ADAPTOR_CFLAGS) @@ -349,7 +342,6 @@ AC_CONFIG_FILES([ Makefile dali-adaptor.pc dali-adaptor-integration.pc - ../../../dali/internal/adaptor/common/system-cache-path.cpp:./system-cache-path.in ]) if test "x$freetype_bitmap_support" = "xyes"; then diff --git a/build/tizen/adaptor/system-cache-path.in b/build/tizen/adaptor/system-cache-path.in deleted file mode 100644 index 816be336c..000000000 --- a/build/tizen/adaptor/system-cache-path.in +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2019 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// EXTERNAL INCLUDES -#include -#include - -std::string GetSystemCachePath() -{ - return std::string( "@cachePath@/.cache/dali_common_caches/" ); -} \ No newline at end of file diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index e861656ab..6256e0478 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -34,9 +34,6 @@ #include #include -#include -#include - // INTERNAL INCLUDES #include #include @@ -68,13 +65,9 @@ #include #include -#include -#include using Dali::TextAbstraction::FontClient; -extern std::string GetSystemCachePath(); - namespace Dali { @@ -291,40 +284,6 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: { Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() ); } - - std::string systemCachePath = GetSystemCachePath(); - if ( systemCachePath.c_str() != NULL ) - { - Dali::Vector buffer; - if( Dali::FileLoader::ReadFile( systemCachePath + "gpu-environment.conf", buffer, Dali::FileLoader::FileType::TEXT ) ) - { - std::stringstream stream( &buffer[0], std::ios::in ); - std::string line; - while( std::getline( stream, line ) ) - { - line.erase( line.find_last_not_of( " \t\r\n" ) + 1 ); - line.erase( 0, line.find_first_not_of( " \t\r\n" ) ); - if( '#' == *( line.cbegin() ) || line == "" ) - { - continue; - } - - std::istringstream stream( line ); - std::string environmentVariableName, environmentVariableValue; - std::getline(stream, environmentVariableName, ' '); - if( environmentVariableName == "DALI_ENV_MAX_TEXTURE_SIZE" && mEnvironmentOptions->GetMaxTextureSize() == 0 ) - { - std::getline(stream, environmentVariableValue); - setenv( environmentVariableName.c_str() , environmentVariableValue.c_str(), 1 ); - Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( std::atoi( environmentVariableValue.c_str() ) ); - } - } - } - else - { - DALI_LOG_ERROR( "Fail to open file : %s\n", ( systemCachePath + "gpu-environment.conf" ).c_str() ); - } - } } Adaptor::~Adaptor() @@ -394,32 +353,6 @@ void Adaptor::Start() // Initialize the thread controller mThreadController->Initialize(); - if( !Dali::TizenPlatform::ImageLoader::MaxTextureSizeUpdated() ) - { - auto eglGraphics = static_cast( mGraphics ); - GlImplementation& mGLES = eglGraphics->GetGlesInterface(); - Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mGLES.GetMaxTextureSize() ); - - std::string systemCachePath = GetSystemCachePath(); - if( systemCachePath.c_str() != NULL ) - { - const int dir_err = system( std::string( "mkdir " + systemCachePath ).c_str() ); - if (-1 == dir_err) - { - printf("Error creating directory!n"); - exit(1); - } - - Dali::FileStream fileStream( systemCachePath + "gpu-environment.conf", Dali::FileStream::WRITE | Dali::FileStream::TEXT ); - std::fstream& configFile = dynamic_cast( fileStream.GetStream() ); - if( configFile.is_open() ) - { - configFile << "DALI_ENV_MAX_TEXTURE_SIZE " << mGLES.GetMaxTextureSize() << std::endl; - configFile.close(); - } - } - } - ProcessCoreEvents(); // Ensure any startup messages are processed. // Initialize the image loader plugin diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 94693d205..aae33400e 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -493,8 +493,6 @@ void CombinedUpdateRenderController::UpdateRenderThread() } } - eglGraphics->GetGlesInterface().ContextCreated(); - // Tell core it has a context mCore.ContextCreated(); diff --git a/dali/internal/adaptor/file.list b/dali/internal/adaptor/file.list index b10b5b85f..803b95bab 100644 --- a/dali/internal/adaptor/file.list +++ b/dali/internal/adaptor/file.list @@ -7,8 +7,7 @@ adaptor_adaptor_common_src_files=\ ${adaptor_adaptor_dir}/common/adaptor.cpp \ ${adaptor_adaptor_dir}/common/adaptor-builder-impl.cpp \ ${adaptor_adaptor_dir}/common/application-impl.cpp \ - ${adaptor_adaptor_dir}/common/combined-update-render-controller.cpp \ - ${adaptor_adaptor_dir}/common/system-cache-path.cpp + ${adaptor_adaptor_dir}/common/combined-update-render-controller.cpp # module: adaptor, backend: tizen-wayland adaptor_adaptor_tizen_wayland_src_files=\ diff --git a/dali/internal/graphics/gles/gl-implementation.h b/dali/internal/graphics/gles/gl-implementation.h index 9ccc0151b..8c279f448 100644 --- a/dali/internal/graphics/gles/gl-implementation.h +++ b/dali/internal/graphics/gles/gl-implementation.h @@ -23,7 +23,6 @@ #include #include #include -#include // INTERNAL INCLUDES #include @@ -50,10 +49,7 @@ class GlImplementation : public Dali::Integration::GlAbstraction public: GlImplementation() : mGlesVersion( 30 ), - mIsSurfacelessContextSupported( false ), - mIsContextCreated( false ), - mContextCreatedWaitCondition(), - mMaxTextureSize( 0 ) + mIsSurfacelessContextSupported( false ) { mImpl.reset( new Gles3Implementation() ); } @@ -70,17 +66,6 @@ public: /* Do nothing in main implementation */ } - void ContextCreated() - { - glGetIntegerv( GL_MAX_TEXTURE_SIZE, &mMaxTextureSize ); - - if( !mIsContextCreated ) - { - mContextCreatedWaitCondition.Notify(); - } - mIsContextCreated = true; - } - void SetGlesVersion( const int32_t glesVersion ) { if( mGlesVersion != glesVersion ) @@ -118,15 +103,6 @@ public: return convert; } - int GetMaxTextureSize() - { - if( !mIsContextCreated ) - { - mContextCreatedWaitCondition.Wait(); - } - return mMaxTextureSize; - } - /* OpenGL ES 2.0 */ void ActiveTexture( GLenum texture ) @@ -1364,9 +1340,6 @@ public: private: int32_t mGlesVersion; bool mIsSurfacelessContextSupported; - bool mIsContextCreated; - ConditionalWait mContextCreatedWaitCondition; - GLint mMaxTextureSize; std::unique_ptr mImpl; }; diff --git a/dali/internal/imaging/common/image-loader.cpp b/dali/internal/imaging/common/image-loader.cpp index 598079682..b83878ecd 100755 --- a/dali/internal/imaging/common/image-loader.cpp +++ b/dali/internal/imaging/common/image-loader.cpp @@ -47,8 +47,6 @@ Integration::Log::Filter* gLogFilter = Debug::Filter::New( Debug::Concise, false static unsigned int gMaxTextureSize = 4096; -static bool gMaxTextureSizeUpdated = false; - /** * Enum for file formats, has to be in sync with BITMAP_LOADER_LOOKUP_TABLE */ @@ -420,7 +418,6 @@ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer void SetMaxTextureSize( unsigned int size ) { gMaxTextureSize = size; - gMaxTextureSizeUpdated = true; } unsigned int GetMaxTextureSize() @@ -428,11 +425,6 @@ unsigned int GetMaxTextureSize() return gMaxTextureSize; } -bool MaxTextureSizeUpdated() -{ - return gMaxTextureSizeUpdated; -} - } // ImageLoader } // TizenPlatform } // Dali diff --git a/dali/internal/imaging/common/image-loader.h b/dali/internal/imaging/common/image-loader.h index a7c42a0f2..55f16805f 100644 --- a/dali/internal/imaging/common/image-loader.h +++ b/dali/internal/imaging/common/image-loader.h @@ -95,13 +95,6 @@ void SetMaxTextureSize( unsigned int size ); */ unsigned int GetMaxTextureSize(); -/** - * @brief Check the gMaxTextureSize is updated or not. - * - * @return Whether the gMaxTextureSize is updated or not. - */ -bool MaxTextureSizeUpdated(); - } // ImageLoader } // TizenPlatform } // Dali -- 2.34.1