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 c96edeb..5310615 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 42022fd..2d2300d 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 f9cf846..b30621d 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 5b449a1..872f39f 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 b55470b..7ca4366 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 003af2b..4081ed3 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