Support EGL_DONT_CARE for multi-sampling level 79/157079/2
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 23 Oct 2017 08:29:52 +0000 (17:29 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Tue, 24 Oct 2017 02:43:10 +0000 (11:43 +0900)
Change-Id: I10e47e48c94000a9cd3807453b37db8f086ce3de

adaptors/base/environment-options.cpp
adaptors/base/environment-options.h
adaptors/common/gl/egl-factory.cpp
adaptors/common/gl/egl-factory.h
adaptors/common/gl/egl-implementation.cpp
adaptors/common/gl/egl-implementation.h

index c96edeb673da66d445b937348d9da205eaf24ef4..5310615dbadb78634cd0477de2331ef87d1025a3 100644 (file)
@@ -38,6 +38,7 @@ namespace Adaptor
 namespace
 {
 const unsigned int DEFAULT_STATISTICS_LOG_FREQUENCY = 2;
+const int DEFAULT_MULTI_SAMPLING_LEVEL = 4;
 
 unsigned int GetIntegerEnvironmentVariable( const char* variable, unsigned int defaultValue )
 {
@@ -107,7 +108,7 @@ EnvironmentOptions::EnvironmentOptions()
   mThreadingMode( ThreadingMode::COMBINED_UPDATE_RENDER ),
   mRenderRefreshRate( 1 ),
   mGlesCallAccumulate( false ),
-  mMultiSamplingLevel( 0 ),
+  mMultiSamplingLevel( DEFAULT_MULTI_SAMPLING_LEVEL ),
   mMaxTextureSize( 0 ),
   mIndicatorVisibleMode( -1 ),
   mLogFunction( NULL )
@@ -256,7 +257,7 @@ unsigned int EnvironmentOptions::GetRenderRefreshRate() const
   return mRenderRefreshRate;
 }
 
-unsigned int EnvironmentOptions::GetMultiSamplingLevel() const
+int EnvironmentOptions::GetMultiSamplingLevel() const
 {
   return mMultiSamplingLevel;
 }
@@ -416,10 +417,7 @@ void EnvironmentOptions::ParseEnvironmentOptions()
   int multiSamplingLevel( 0 );
   if( GetIntegerEnvironmentVariable( DALI_ENV_MULTI_SAMPLING_LEVEL, multiSamplingLevel ) )
   {
-    if( multiSamplingLevel > 0 )
-    {
-      mMultiSamplingLevel = multiSamplingLevel;
-    }
+    mMultiSamplingLevel = multiSamplingLevel;
   }
 
   int maxTextureSize( 0 );
index 42022fd9dd958c5bd3a49192206a78f9296266c5..2d2300decf267899daa1d4dfca8fa19dc6d7602d 100644 (file)
@@ -38,7 +38,6 @@ namespace Adaptor
  */
 class EnvironmentOptions
 {
-
 public:
 
   /**
@@ -206,7 +205,7 @@ public:
   /**
    * @return The number of samples required in multisample buffers
    */
-  unsigned int GetMultiSamplingLevel() const;
+  int GetMultiSamplingLevel() const;
 
   /**
    * @return The maximum texture size
@@ -253,7 +252,7 @@ private: // Data
   ThreadingMode::Type mThreadingMode;             ///< threading mode
   unsigned int mRenderRefreshRate;                ///< render refresh rate
   bool mGlesCallAccumulate;                       ///< Whether or not to accumulate gles call statistics
-  unsigned int mMultiSamplingLevel;               ///< The number of samples required in multisample buffers
+  int mMultiSamplingLevel;                        ///< The number of samples required in multisample buffers
   unsigned int mMaxTextureSize;                   ///< The maximum texture size that GL can handle
   int mIndicatorVisibleMode;                      ///< Indicator visible mode
 
index f9cf8463bb25dafd605ffd949f6980b3433b60f6..b30621dc99e8048976c9916a1c1f69f06499035d 100644 (file)
@@ -30,16 +30,12 @@ namespace Internal
 namespace Adaptor
 {
 
-EglFactory::EglFactory( unsigned int multiSamplingLevel )
+EglFactory::EglFactory( int multiSamplingLevel )
 : mEglImplementation(NULL),
   mEglImageExtensions(NULL),
   mEglSync(new EglSyncImplementation), // Created early, as needed by Core constructor
-  mMultiSamplingLevel( 4 )
+  mMultiSamplingLevel( multiSamplingLevel )
 {
-  if( multiSamplingLevel > 0 )
-  {
-    mMultiSamplingLevel = multiSamplingLevel;
-  }
 }
 
 EglFactory::~EglFactory()
index 5b449a15a9d901861d20f5ae012673523f630b9a..872f39f51222cd43e510745534d5278d73c4a3ee 100644 (file)
@@ -39,7 +39,7 @@ public:
   /**
    * Constructor
    */
-  EglFactory( unsigned int multiSamplingLevel );
+  EglFactory( int multiSamplingLevel );
 
   /**
    * Destructor
@@ -84,7 +84,7 @@ private:
   EglImageExtensions* mEglImageExtensions;
   EglSyncImplementation* mEglSync;
 
-  unsigned int mMultiSamplingLevel;
+  int mMultiSamplingLevel;
 };
 
 }
index b55470b225ccb47980faf62b22784a95d0178812..7ca4366226921abaa0e8adb84fbaec7e3d84bf95 100644 (file)
@@ -52,7 +52,7 @@ namespace Adaptor
   } \
 }
 
-EglImplementation::EglImplementation( unsigned int multiSamplingLevel )
+EglImplementation::EglImplementation( int multiSamplingLevel )
   : mEglNativeDisplay(0),
     mEglNativeWindow(0),
     mCurrentEglNativePixmap(0),
@@ -334,10 +334,13 @@ void EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
   configAttribs.PushBack( EGL_STENCIL_SIZE );
   configAttribs.PushBack( 8 );
 #ifndef DALI_PROFILE_UBUNTU
-  configAttribs.PushBack( EGL_SAMPLES );
-  configAttribs.PushBack( mMultiSamplingLevel );
-  configAttribs.PushBack( EGL_SAMPLE_BUFFERS );
-  configAttribs.PushBack( 1 );
+  if( mMultiSamplingLevel != EGL_DONT_CARE )
+  {
+    configAttribs.PushBack( EGL_SAMPLES );
+    configAttribs.PushBack( mMultiSamplingLevel );
+    configAttribs.PushBack( EGL_SAMPLE_BUFFERS );
+    configAttribs.PushBack( 1 );
+  }
 #endif // DALI_PROFILE_UBUNTU
   configAttribs.PushBack( EGL_NONE );
 
index 003af2bfb634fe3e11d1794570f3eff6db82cd7f..4081ed3df199bfa147c553c0a8811f23639e2be2 100644 (file)
@@ -44,7 +44,7 @@ public:
    * Constructor
    * @param environmentOptions To check the envirionment options
    */
-  EglImplementation( unsigned int multiSamplingLevel );
+  EglImplementation( int multiSamplingLevel );
 
   /**
    * Destructor
@@ -195,7 +195,7 @@ private:
   bool                 mIsWindow;
   ColorDepth           mColorDepth;
 
-  unsigned int         mMultiSamplingLevel;
+  int                  mMultiSamplingLevel;
 };
 
 } // namespace Adaptor