check EGL_KHR_partial_update and EGL_KHR_swap_buffers_with_damage for partial rendering 19/244419/3
authorJoogab Yun <joogab.yun@samsung.com>
Wed, 16 Sep 2020 03:01:33 +0000 (12:01 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 30 Sep 2020 16:24:49 +0000 (16:24 +0000)
Change-Id: I296740afc72c6f54352cf39c3eca8d08f57f2a79

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

index d674055..984b4e1 100755 (executable)
 namespace
 {
   const uint32_t THRESHOLD_SWAPBUFFER_COUNT = 5;
-  const uint32_t CHECK_EXTENSION_NUMBER = 2;
+  const uint32_t CHECK_EXTENSION_NUMBER = 4;
   const std::string EGL_KHR_SURFACELESS_CONTEXT = "EGL_KHR_surfaceless_context";
   const std::string EGL_KHR_CREATE_CONTEXT = "EGL_KHR_create_context";
+  const std::string EGL_KHR_PARTIAL_UPDATE = "EGL_KHR_partial_update";
+  const std::string EGL_KHR_SWAP_BUFFERS_WITH_DAMAGE = "EGL_KHR_swap_buffers_with_damage";
+
 }
 
 namespace Dali
@@ -133,6 +136,8 @@ bool EglImplementation::InitializeGles( EGLNativeDisplayType display, bool isOwn
   std::istringstream stream( extensionStr );
   std::string currentExtension;
   uint32_t extensionCheckCount = 0;
+  bool isKhrPartialUpdateSupported = false;
+  bool isKhrSwapBuffersWithDamageSupported = false;
   while( std::getline( stream, currentExtension, ' ' ) && extensionCheckCount < CHECK_EXTENSION_NUMBER )
   {
     if( currentExtension == EGL_KHR_SURFACELESS_CONTEXT )
@@ -145,6 +150,21 @@ bool EglImplementation::InitializeGles( EGLNativeDisplayType display, bool isOwn
       mIsKhrCreateContextSupported = true;
       extensionCheckCount++;
     }
+    if( currentExtension == EGL_KHR_PARTIAL_UPDATE )
+    {
+      isKhrPartialUpdateSupported = true;
+      extensionCheckCount++;
+    }
+    if( currentExtension == EGL_KHR_SWAP_BUFFERS_WITH_DAMAGE )
+    {
+      isKhrSwapBuffersWithDamageSupported = true;
+      extensionCheckCount++;
+    }
+  }
+
+  if( !isKhrPartialUpdateSupported || !isKhrSwapBuffersWithDamageSupported  )
+  {
+    mPartialUpdateRequired = false;
   }
 
   mGlesInitialized = true;