Merge "Log patch to show the first five swapbuffers call after resume" into devel...
authorSeungho BAEK <sbsh.baek@samsung.com>
Thu, 19 Sep 2019 22:54:08 +0000 (22:54 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 19 Sep 2019 22:54:08 +0000 (22:54 +0000)
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/graphics/gles/egl-implementation.cpp
dali/internal/graphics/gles/egl-implementation.h

index 0076910..f0a5e65 100644 (file)
@@ -635,6 +635,13 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() );
     }
 
+    if( timeToSleepUntil == 0 )
+    {
+      // timeToSleepUntil is set to 0 when the thread is initalized or resumed
+      // Let eglImplementation know the first frame after thread initialized or resumed.
+      eglImpl.SetFirstFrameAfterResume();
+    }
+
     Integration::RenderStatus renderStatus;
 
     AddPerformanceMarker( PerformanceInterface::RENDER_START );
index 3885134..2d898f9 100755 (executable)
@@ -35,6 +35,7 @@
 
 namespace
 {
+  const uint32_t THRESHOLD_SWAPBUFFER_COUNT = 5;
   const uint32_t CHECK_EXTENSION_NUMBER = 2;
   const std::string EGL_KHR_SURFACELESS_CONTEXT = "EGL_KHR_surfaceless_context";
   const std::string EGL_KHR_CREATE_CONTEXT = "EGL_KHR_create_context";
@@ -81,7 +82,8 @@ EglImplementation::EglImplementation( int multiSamplingLevel,
   mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ),
   mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE ),
   mIsSurfacelessContextSupported( false ),
-  mIsKhrCreateContextSupported( false )
+  mIsKhrCreateContextSupported( false ),
+  mSwapBufferCountAfterResume( 0 )
 {
 }
 
@@ -310,7 +312,22 @@ void EglImplementation::SwapBuffers( EGLSurface& eglSurface )
 {
   if ( eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context
   {
+#ifndef DALI_PROFILE_UBUNTU
+    if( mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT )
+    {
+      DALI_LOG_RELEASE_INFO( "EglImplementation::SwapBuffers started.\n" );
+    }
+#endif //DALI_PROFILE_UBUNTU
+
     eglSwapBuffers( mEglDisplay, eglSurface );
+
+#ifndef DALI_PROFILE_UBUNTU
+    if( mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT )
+    {
+      DALI_LOG_RELEASE_INFO( "EglImplementation::SwapBuffers finished.\n" );
+      mSwapBufferCountAfterResume++;
+    }
+#endif //DALI_PROFILE_UBUNTU
   }
 }
 
@@ -536,6 +553,11 @@ void EglImplementation::SetGlesVersion( const int32_t glesVersion )
   mGlesVersion = glesVersion;
 }
 
+void EglImplementation::SetFirstFrameAfterResume()
+{
+  mSwapBufferCountAfterResume = 0;
+}
+
 EGLDisplay EglImplementation::GetDisplay() const
 {
   return mEglDisplay;
index 1c9cab3..3f01537 100644 (file)
@@ -182,6 +182,11 @@ public:
   void SetGlesVersion( const int32_t glesVersion );
 
   /**
+   * Sets Whether the frame is the first after Resume.
+   */
+  void SetFirstFrameAfterResume();
+
+  /**
    * returns the display with which this object was initialized
    * @return the EGL Display.
    */
@@ -245,6 +250,8 @@ private:
   bool                 mStencilBufferRequired;
   bool                 mIsSurfacelessContextSupported;
   bool                 mIsKhrCreateContextSupported;
+
+  uint32_t              mSwapBufferCountAfterResume;
 };
 
 } // namespace Adaptor