Add environment variable for multisampling
[platform/core/uifw/dali-adaptor.git] / adaptors / common / gl / egl-implementation.cpp
index 88a7b64..dd2a59e 100644 (file)
 #include <gl/gl-implementation.h>
 #include <gl/egl-debug.h>
 
+// EGL constants use C style casts
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+
 namespace Dali
 {
 
@@ -48,7 +52,7 @@ namespace Adaptor
   } \
 }
 
-EglImplementation::EglImplementation()
+EglImplementation::EglImplementation( unsigned int multiSamplingLevel )
   : mEglNativeDisplay(0),
     mEglNativeWindow(0),
     mCurrentEglNativePixmap(0),
@@ -60,7 +64,8 @@ EglImplementation::EglImplementation()
     mIsOwnSurface(true),
     mContextCurrent(false),
     mIsWindow(true),
-    mColorDepth(COLOR_DEPTH_24)
+    mColorDepth(COLOR_DEPTH_24),
+    mMultiSamplingLevel( multiSamplingLevel )
 {
 }
 
@@ -330,7 +335,7 @@ void EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
   configAttribs.PushBack( 8 );
 #ifndef DALI_PROFILE_UBUNTU
   configAttribs.PushBack( EGL_SAMPLES );
-  configAttribs.PushBack( 4 );
+  configAttribs.PushBack( mMultiSamplingLevel );
   configAttribs.PushBack( EGL_SAMPLE_BUFFERS );
   configAttribs.PushBack( 1 );
 #endif // DALI_PROFILE_UBUNTU
@@ -460,3 +465,5 @@ EGLDisplay EglImplementation::GetContext() const
 } // namespace Internal
 
 } // namespace Dali
+
+#pragma GCC diagnostic pop