Added pre/post render methods to GL abstraction 02/24102/1
authorDavid Steele <david.steele@partner.samsung.com>
Tue, 1 Jul 2014 16:53:48 +0000 (17:53 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 8 Jul 2014 13:19:39 +0000 (14:19 +0100)
[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 <david.steele@partner.samsung.com>
automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.cpp
automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h
dali/integration-api/gl-abstraction.h

index 3fa897a..49a49c5 100644 (file)
@@ -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)
index a3cbaef..710b1b8 100644 (file)
@@ -51,6 +51,9 @@ public:
   ~TestGlAbstraction();
   void Initialize();
 
+  void PreRender();
+  void PostRender(unsigned int timeDelta);
+
   /* OpenGL ES 2.0 */
 
   inline void ActiveTexture( GLenum textureUnit )
index 60179a9..b6e50c0 100644 (file)
@@ -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.