[Tizen]Fallback to GLES 2.0 when num_config is 0 05/205105/1 accepted/tizen/unified/20190429.103852 accepted/tizen/unified/20190514.080112 submit/tizen/20190429.071133 submit/tizen/20190429.085624 submit/tizen/20190509.062606 submit/tizen/20190509.071711 submit/tizen/20190513.042053 submit/tizen/20190513.042329
authorSunghyun kim <scholb.kim@samsung.com>
Thu, 25 Apr 2019 09:54:31 +0000 (18:54 +0900)
committerSunghyun kim <scholb.kim@samsung.com>
Mon, 29 Apr 2019 06:53:01 +0000 (15:53 +0900)
when eglChooseConfig() is successed but num_config is 0, creating context is failed.
it is depends on GPU driver, but we need to protect.

Change-Id: I68484312f2719a5e0c108e8d7a70fbf3d10d70f9

dali/internal/graphics/gles/egl-implementation.cpp

index 91d4fab..7147bfe 100755 (executable)
@@ -400,8 +400,8 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
   }
 #endif // DALI_PROFILE_UBUNTU
   configAttribs.PushBack( EGL_NONE );
-
-  if ( eglChooseConfig( mEglDisplay, &(configAttribs[0]), &mEglConfig, 1, &numConfigs ) != EGL_TRUE )
+  if ( ( eglChooseConfig( mEglDisplay, &(configAttribs[0]), &mEglConfig, 1, &numConfigs ) != EGL_TRUE ) ||
+       ( numConfigs != 1 ) )
   {
     if( mGlesVersion >= 30 )
     {
@@ -410,6 +410,13 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
       return false;
     }
 
+    if ( numConfigs != 1 )
+    {
+      DALI_LOG_ERROR("No configurations found.\n");
+
+      TEST_EGL_ERROR("eglChooseConfig");
+    }
+
     EGLint error = eglGetError();
     switch (error)
     {
@@ -460,13 +467,6 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
   }
   mContextAttribs.PushBack( EGL_NONE );
 
-  if ( numConfigs != 1 )
-  {
-    DALI_LOG_ERROR("No configurations found.\n");
-
-    TEST_EGL_ERROR("eglChooseConfig");
-  }
-
   return true;
 }