[4.0] Add an environment variable to set the default indicator visible mode
[platform/core/uifw/dali-adaptor.git] / adaptors / base / environment-options.cpp
index 0dbf614..c96edeb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -108,6 +108,8 @@ EnvironmentOptions::EnvironmentOptions()
   mRenderRefreshRate( 1 ),
   mGlesCallAccumulate( false ),
   mMultiSamplingLevel( 0 ),
+  mMaxTextureSize( 0 ),
+  mIndicatorVisibleMode( -1 ),
   mLogFunction( NULL )
 {
   ParseEnvironmentOptions();
@@ -259,6 +261,16 @@ unsigned int EnvironmentOptions::GetMultiSamplingLevel() const
   return mMultiSamplingLevel;
 }
 
+unsigned int EnvironmentOptions::GetMaxTextureSize() const
+{
+  return mMaxTextureSize;
+}
+
+int EnvironmentOptions::GetIndicatorVisibleMode() const
+{
+  return mIndicatorVisibleMode;
+}
+
 bool EnvironmentOptions::PerformanceServerRequired() const
 {
   return ( ( GetPerformanceStatsLoggingOptions() > 0) ||
@@ -383,9 +395,7 @@ void EnvironmentOptions::ParseEnvironmentOptions()
   {
     switch( threadingMode )
     {
-      case ThreadingMode::SEPARATE_UPDATE_RENDER:
       case ThreadingMode::COMBINED_UPDATE_RENDER:
-      case ThreadingMode::SINGLE_THREADED:
       {
         mThreadingMode = static_cast< ThreadingMode::Type >( threadingMode );
         break;
@@ -411,6 +421,24 @@ void EnvironmentOptions::ParseEnvironmentOptions()
       mMultiSamplingLevel = multiSamplingLevel;
     }
   }
+
+  int maxTextureSize( 0 );
+  if( GetIntegerEnvironmentVariable( DALI_ENV_MAX_TEXTURE_SIZE, maxTextureSize ) )
+  {
+    if( maxTextureSize > 0 )
+    {
+      mMaxTextureSize = maxTextureSize;
+    }
+  }
+
+  int indicatorVisibleMode( -1 );
+  if( GetIntegerEnvironmentVariable( DALI_ENV_INDICATOR_VISIBLE_MODE, indicatorVisibleMode ) )
+  {
+    if( indicatorVisibleMode > -1 )
+    {
+      mIndicatorVisibleMode = indicatorVisibleMode;
+    }
+  }
 }
 
 } // Adaptor