Revert "[Tizen] Revert "Support multiple window rendering""
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / combined-update-render-controller.h
index 2e2dcad..bdb51b0 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
-#define __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
+#ifndef DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H
+#define DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/integration-api/thread-synchronization-interface.h>
 #include <dali/internal/system/common/performance-interface.h>
 #include <dali/internal/system/common/fps-tracker.h>
-#include <dali/internal/graphics/common/render-helper.h>
 #include <dali/internal/adaptor/common/thread-controller-interface.h>
 #include <dali/internal/system/common/update-status-logger.h>
+#include <dali/internal/window-system/common/display-connection.h>
+
 
 namespace Dali
 {
 
-class RenderSurface;
+class RenderSurfaceInterface;
 class TriggerEventInterface;
 
 namespace Internal
@@ -123,7 +124,7 @@ public:
   /**
    * @copydoc ThreadControllerInterface::ReplaceSurface()
    */
-  virtual void ReplaceSurface( RenderSurface* surface );
+  virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface );
 
   /**
    * @copydoc ThreadControllerInterface::ResizeSurface()
@@ -135,6 +136,11 @@ public:
    */
   virtual void SetRenderRefreshRate( unsigned int numberOfFramesPerRender );
 
+  /**
+   * @copydoc ThreadControllerInterface::SetPreRenderCallback
+   */
+  void SetPreRenderCallback( CallbackBase* callback ) override;
+
 private:
 
   // Undefined copy constructor.
@@ -211,7 +217,7 @@ private:
    *
    * @return Pointer to the new surface, NULL otherwise
    */
-  RenderSurface* ShouldSurfaceBeReplaced();
+  Integration::RenderSurface* ShouldSurfaceBeReplaced();
 
   /**
    * Called by the Update/Render thread after a surface has been replaced.
@@ -294,8 +300,6 @@ private:
   FpsTracker                        mFpsTracker;                       ///< Object that tracks the FPS
   UpdateStatusLogger                mUpdateStatusLogger;               ///< Object that logs the update-status as required.
 
-  RenderHelper                      mRenderHelper;                     ///< Helper class for EGL, pre & post rendering
-
   sem_t                             mEventThreadSemaphore;             ///< Used by the event thread to ensure all threads have been initialised, and when replacing the surface.
 
   ConditionalWait                   mUpdateRenderThreadWaitCondition;  ///< The wait condition for the update-render-thread.
@@ -306,6 +310,7 @@ private:
   const EnvironmentOptions&         mEnvironmentOptions;               ///< Environment options
   TriggerEventInterface&            mNotificationTrigger;              ///< Reference to notification event trigger
   TriggerEventInterface*            mSleepTrigger;                     ///< Used by the update-render thread to trigger the event thread when it no longer needs to do any updates
+  CallbackBase*                     mPreRenderCallback;                ///< Used by Update/Render thread when PreRender is about to be called on graphics.
 
   pthread_t*                        mUpdateRenderThread;               ///< The Update/Render thread.
 
@@ -329,11 +334,11 @@ private:
 
   volatile unsigned int             mUseElapsedTimeAfterWait;          ///< Whether we should use the elapsed time after waiting (set by the event-thread, read by the update-render-thread).
 
-  RenderSurface* volatile           mNewSurface;                       ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread).
+  Integration::RenderSurface* volatile mNewSurface;                    ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread).
 
   volatile unsigned int             mPostRendering;                    ///< Whether post-rendering is taking place (set by the event & render threads, read by the render-thread).
   volatile unsigned int             mSurfaceResized;                   ///< Will be set to resize the surface (set by the event-thread, read & cleared by the update-render thread).
-  volatile unsigned int             mForceClear;                       ///< Will be set to clear forcely
+  volatile unsigned int             mForceClear;                       ///< Will be set to clear forcibly
 };
 
 } // namespace Adaptor
@@ -342,4 +347,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
+#endif // DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H