Revert "[Tizen] To get MaxTextureSize by using glGetIntegerv not by using environment...
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / adaptor-impl.cpp
index e861656..6256e04 100755 (executable)
@@ -34,9 +34,6 @@
 #include <dali/integration-api/events/wheel-event-integ.h>
 #include <dali/integration-api/processor-interface.h>
 
-#include <fstream>
-#include <iostream>
-
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-adaptor-common.h>
 #include <dali/internal/system/common/thread-controller.h>
 #include <dali/internal/imaging/common/image-loader-plugin-proxy.h>
 #include <dali/internal/imaging/common/image-loader.h>
 
-#include <dali/devel-api/adaptor-framework/file-loader.h>
-#include <dali/devel-api/adaptor-framework/file-stream.h>
 
 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<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() );
-    }
-  }
 }
 
 Adaptor::~Adaptor()
@@ -394,32 +353,6 @@ void Adaptor::Start()
   // Initialize the thread controller
   mThreadController->Initialize();
 
-  if( !Dali::TizenPlatform::ImageLoader::MaxTextureSizeUpdated() )
-  {
-    auto eglGraphics = static_cast<EglGraphics *>( 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<std::fstream&>( 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