-
- std::string systemCachePath = GetSystemCachePath();
- if ( systemCachePath.c_str() != NULL )
- {
- Dali::Vector<char> 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() );
- }
- }