From a0e8db622c654ccb515b002128af5e8dc3a1e5a8 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 6 Aug 2019 17:11:06 +0900 Subject: [PATCH] Log patch to show the first five swapbuffers call after resume - Showes logs twice, before and after swapbuffers call Change-Id: Ib793119e4fa40bc0ee0f1dc92e7341226d3ffde3 Signed-off-by: Seungho, Baek --- .../common/combined-update-render-controller.cpp | 7 +++++++ dali/internal/graphics/gles/egl-implementation.cpp | 24 +++++++++++++++++++++- dali/internal/graphics/gles/egl-implementation.h | 7 +++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 94693d2..93f766f 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -633,6 +633,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 ); diff --git a/dali/internal/graphics/gles/egl-implementation.cpp b/dali/internal/graphics/gles/egl-implementation.cpp index 3885134..2d898f9 100755 --- a/dali/internal/graphics/gles/egl-implementation.cpp +++ b/dali/internal/graphics/gles/egl-implementation.cpp @@ -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; diff --git a/dali/internal/graphics/gles/egl-implementation.h b/dali/internal/graphics/gles/egl-implementation.h index 1c9cab3..3f01537 100644 --- a/dali/internal/graphics/gles/egl-implementation.h +++ b/dali/internal/graphics/gles/egl-implementation.h @@ -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 -- 2.7.4