Merge branch 'devel/master' into sandbox/dkdk/tizen
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / gles / egl-implementation.h
old mode 100755 (executable)
new mode 100644 (file)
index aefa9be..6d9e3c9
  */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/common/list-wrapper.h>
+#include <dali/public-api/common/vector-wrapper.h>
+
 #include <dali/internal/graphics/common/egl-include.h>
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/math/rect.h>
 #include <dali/integration-api/core-enumerations.h>
 
 // INTERNAL INCLUDES
@@ -46,17 +50,17 @@ public:
    * @param[in] multiSamplingLevel The Multi-sampling level required
    * @param[in] depthBufferRequired Whether the depth buffer is required
    * @param[in] stencilBufferRequired Whether the stencil buffer is required
-   * @param[in] partialUpdateAvailable Whether the partial update is available
+   * @param[in] partialUpdatedRequired Whether the partial update is required
    */
   EglImplementation( int multiSamplingLevel,
                      Integration::DepthBufferAvailable depthBufferRequired,
                      Integration::StencilBufferAvailable stencilBufferRequired,
-                     Integration::PartialUpdateAvailable partialUpdateAvailable );
+                     Integration::PartialUpdateAvailable partialUpdateRequired );
 
   /**
    * Destructor
    */
-  virtual ~EglImplementation();
+  ~EglImplementation() override;
 
 public:
 
@@ -73,7 +77,7 @@ public:
     * Create the OpenGL context for the shared resource.
     * @return true if successful
     */
-  virtual bool CreateContext();
+  bool CreateContext() override;
 
   /**
     * Create the OpenGL context for the window.
@@ -94,7 +98,7 @@ public:
   /**
    * Make the OpenGL context current
    */
-  virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext );
+  void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext ) override;
 
   /**
    * clear the OpenGL context
@@ -112,7 +116,7 @@ public:
   /**
    * Terminate GL
    */
-  virtual void TerminateGles();
+  void TerminateGles() override;
 
   /**
    * Checks if GL is initialised
@@ -123,27 +127,32 @@ public:
   /**
    * Performs an OpenGL swap buffers command
    */
-  virtual void SwapBuffers( EGLSurface& eglSurface );
+  void SwapBuffers( EGLSurface& eglSurface ) override;
 
- /**
-  * Get current buffer age
-  */
-  virtual int GetBufferAge( EGLSurface& eglSurface );
 /**
+   * Gets current back buffer age
+   */
+  EGLint GetBufferAge( EGLSurface& eglSurface ) const;
 
   /**
-   * Set Damaged rect for Partial update
-  */
-  virtual void SetDamagedRect( std::vector<int> damagedRectArray, EGLSurface& eglSurface );
+   * Performs an OpenGL set damage command with damaged rects
+   */
+  void SetDamageRegion( EGLSurface& eglSurface, std::vector< Rect< int > >& damagedRects );
+
+  /**
+   * Performs an OpenGL swap buffers command with damaged rects
+   */
+  virtual void SwapBuffers( EGLSurface& eglSurface, const std::vector<Rect<int>>& damagedRects );
 
   /**
    * Performs an OpenGL copy buffers command
    */
-  virtual void CopyBuffers( EGLSurface& eglSurface );
+  void CopyBuffers( EGLSurface& eglSurface ) override;
 
   /**
    * Performs an EGL wait GL command
    */
-  virtual void WaitGL();
+  void WaitGL() override;
 
   /**
    * Choose config of egl
@@ -225,6 +234,12 @@ public:
    */
   void WaitClient();
 
+  /**
+   * @brief Returns whether the partial update is required.
+   * @return true if the partial update is required.
+   */
+  bool IsPartialUpdateRequired() const;
+
 private:
 
   Vector<EGLint>       mContextAttribs;
@@ -250,7 +265,6 @@ private:
 
   int32_t              mMultiSamplingLevel;
   int32_t              mGlesVersion;
-  std::vector<int>     mDamagedRectArray;
 
   ColorDepth           mColorDepth;
 
@@ -259,14 +273,14 @@ private:
   bool                 mIsWindow;
   bool                 mDepthBufferRequired;
   bool                 mStencilBufferRequired;
+  bool                 mPartialUpdateRequired;
   bool                 mIsSurfacelessContextSupported;
   bool                 mIsKhrCreateContextSupported;
-  uint32_t             mSwapBufferCountAfterResume;
-  bool                 mIsKhrPartialUpdateSupported;
-  bool                 mPartialUpdateAvailable;
 
+  uint32_t              mSwapBufferCountAfterResume;
   PFNEGLSETDAMAGEREGIONKHRPROC mEglSetDamageRegionKHR;
-  PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC mSwapBuffersWithDamage;
+  PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC mEglSwapBuffersWithDamageKHR;
+
 };
 
 } // namespace Adaptor