Support EGL_DONT_CARE for multi-sampling level
[platform/core/uifw/dali-adaptor.git] / adaptors / common / gl / egl-implementation.h
index b8693b0..4081ed3 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_EGL_IMPLEMENTATION_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -24,7 +24,7 @@
 #include <dali/public-api/common/dali-vector.h>
 
 // INTERNAL INCLUDES
-#include <egl-interface.h>
+#include <adaptors/integration-api/egl-interface.h>
 
 namespace Dali
 {
@@ -42,8 +42,9 @@ class EglImplementation : public EglInterface
 public:
   /**
    * Constructor
+   * @param environmentOptions To check the envirionment options
    */
-  EglImplementation();
+  EglImplementation( int multiSamplingLevel );
 
   /**
    * Destructor
@@ -88,6 +89,14 @@ public:
   void MakeContextNull();
 
   /**
+   * @brief Make the OpenGL surface current
+   *
+   * @param pixmap The pixmap to replace the current surface
+   * @param eglSurface The eglSurface to replace the current OpenGL surface.
+   */
+  void MakeCurrent( EGLNativePixmapType pixmap, EGLSurface eglSurface );
+
+  /**
    * Terminate GL
    */
   virtual void TerminateGles();
@@ -132,9 +141,9 @@ public:
    * Create the OpenGL surface using a pixmap
    * @param pixmap The pixmap to create the surface on
    * @param colorDepth Bit per pixel value (ex. 32 or 24)
-   * @return true on success, false on failure
+   * @return Handle to an off-screen EGL pixmap surface (the requester has an ownership of this egl surface)
    */
-  void CreateSurfacePixmap( EGLNativePixmapType pixmap, ColorDepth depth );
+  EGLSurface CreateSurfacePixmap( EGLNativePixmapType pixmap, ColorDepth depth );
 
   /**
    * Replaces the render surface
@@ -146,11 +155,12 @@ public:
 
   /**
    * Replaces the render surface
-   * @param[in] pixmap, the pixmap to create the new surface on
+   * @param[in] pixmap, the pixmap to replace the new surface on
+   * @param[out] eglSurface, the eglSurface is created using a pixmap.
    * @return true if the context was lost due to a change in x-display
    *         between old surface and new surface
    */
-  bool ReplaceSurfacePixmap( EGLNativePixmapType pixmap );
+  bool ReplaceSurfacePixmap( EGLNativePixmapType pixmap, EGLSurface& eglSurface );
 
   /**
    * returns the display with which this object was initialized
@@ -169,19 +179,23 @@ private:
   Vector<EGLint>       mContextAttribs;
 
   EGLNativeDisplayType mEglNativeDisplay;
+
   EGLNativeWindowType  mEglNativeWindow;
-  EGLNativePixmapType  mEglNativePixmap;
+
+  EGLNativePixmapType  mCurrentEglNativePixmap;
 
   EGLDisplay           mEglDisplay;
   EGLConfig            mEglConfig;
   EGLContext           mEglContext;
-  EGLSurface           mEglSurface;
+  EGLSurface           mCurrentEglSurface;
 
   bool                 mGlesInitialized;
   bool                 mIsOwnSurface;
   bool                 mContextCurrent;
   bool                 mIsWindow;
   ColorDepth           mColorDepth;
+
+  int                  mMultiSamplingLevel;
 };
 
 } // namespace Adaptor