[3.0] Fix blending issue
[platform/core/uifw/dali-adaptor.git] / adaptors / tizen / native-image-source-impl.h
old mode 100644 (file)
new mode 100755 (executable)
index 0317047..9bed6e7
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <tbm_surface.h>
 #include <dali/devel-api/images/native-image-interface-extension.h>
+#include <dali/public-api/common/dali-vector.h>
 
 // INTERNAL INCLUDES
 #include <native-image-source.h>
@@ -35,6 +36,11 @@ namespace Adaptor
 {
 class EglImageExtensions;
 
+namespace
+{
+  typedef Dali::Vector< void* > EglImageContainer;
+};
+
 /**
  * Dali internal NativeImageSource.
  */
@@ -72,9 +78,14 @@ public:
   bool EncodeToFile(const std::string& filename) const;
 
   /**
-   * @copydoc Dali::NativeImageSource::SetNativeImageSource( Any nativeImageSource )
+   * @copydoc Dali::NativeImageSource::SetSource( Any source )
    */
-  void SetNativeImageSource( Any nativeImageSource );
+  void SetSource( Any source );
+
+  /**
+   * @copydoc Dali::NativeImageSource::IsColorDepthSupported( ColorDepth colorDepth )
+   */
+  bool IsColorDepthSupported( Dali::NativeImageSource::ColorDepth colorDepth );
 
   /**
    * destructor
@@ -97,6 +108,11 @@ public:
   unsigned int TargetTexture();
 
   /**
+   * @copydoc Dali::NativeImageSource::PrepareTexture()
+   */
+  void PrepareTexture();
+
+  /**
    * @copydoc Dali::NativeImageSource::GetWidth()
    */
   unsigned int GetWidth() const
@@ -138,6 +154,11 @@ public:
    */
   const char* GetCustomSamplerTypename();
 
+  /**
+   * @copydoc Dali::NativeImageInterface::Extension::GetEglImageTextureTarget()
+   */
+  int GetEglImageTextureTarget();
+
 private:
 
   /**
@@ -158,16 +179,21 @@ private:
 
   tbm_surface_h GetSurfaceFromAny( Any source ) const;
 
+  bool CheckBlending( tbm_format format );
+
 private:
 
   unsigned int mWidth;                        ///< image width
   unsigned int mHeight;                       ///< image heights
-  bool mOwnTbmsurface;                            ///< Whether we created pixmap or not
-  tbm_surface_h mTbmsurface;
+  bool mOwnTbmSurface;                            ///< Whether we created pixmap or not
+  tbm_surface_h mTbmSurface;
+  tbm_format mTbmFormat;
   bool mBlendingRequired;                      ///< Whether blending is required
   Dali::NativeImageSource::ColorDepth mColorDepth;  ///< color depth of image
   void* mEglImageKHR;                         ///< From EGL extension
   EglImageExtensions* mEglImageExtensions;    ///< The EGL Image Extensions
+  bool mSetSource;
+  EglImageContainer mEglImageKHRContainer;
 };
 
 } // namespace Adaptor