From dc3c56341133c6954eb01ec938790c4d1596961c Mon Sep 17 00:00:00 2001 From: David Steele Date: Tue, 1 Jul 2014 17:53:48 +0100 Subject: [PATCH] Added pre/post render methods to GL abstraction [problem] Metrics gathering in adaptor needs to know start and end of frame in order to perform per-frame data gathering. [solution] Add PreRender and PostRender calls that render thread can call Change-Id: I84a87bdfd5dd7c26642694b25be2602dd854e0ea Signed-off-by: David Steele --- .../src/dali/dali-test-suite-utils/test-gl-abstraction.cpp | 8 ++++++++ .../src/dali/dali-test-suite-utils/test-gl-abstraction.h | 3 +++ dali/integration-api/gl-abstraction.h | 14 +++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.cpp index 3fa897a..49a49c5 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.cpp @@ -72,6 +72,14 @@ void TestGlAbstraction::Initialize() mProgramUniforms4f.clear(); } +void TestGlAbstraction::PreRender() +{ +} + +void TestGlAbstraction::PostRender(unsigned int timeDelta) +{ +} + } // Namespace dali bool BlendEnabled(const Dali::TraceCallStack& callStack) diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h b/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h index a3cbaef..710b1b8 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h +++ b/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h @@ -51,6 +51,9 @@ public: ~TestGlAbstraction(); void Initialize(); + void PreRender(); + void PostRender(unsigned int timeDelta); + /* OpenGL ES 2.0 */ inline void ActiveTexture( GLenum textureUnit ) diff --git a/dali/integration-api/gl-abstraction.h b/dali/integration-api/gl-abstraction.h index 60179a9..b6e50c0 100644 --- a/dali/integration-api/gl-abstraction.h +++ b/dali/integration-api/gl-abstraction.h @@ -870,7 +870,7 @@ namespace Integration * A concrete implementation must be created for each platform, and provided when creating the * Dali::Integration::Core object. */ -class DALI_IMPORT_API GlAbstraction +class GlAbstraction { protected: @@ -880,6 +880,18 @@ protected: virtual ~GlAbstraction() {} public: + /** + * Invoked by Render thread before Core::Render. + */ + virtual void PreRender() = 0; + + /** + * Invoked by Render thread after Core::Render + * Inform the gl implementation that the rendering in this frame has finished, + * and how much time was spent. + * @param[in] timeDelta Time in microseconds since last PostRender call + */ + virtual void PostRender( unsigned int timeDelta ) = 0; /** * The number of texture units an implementation supports is implementation dependent, but must be at least 8. -- 2.7.4