Remove unused custom shader prefix method
[platform/core/uifw/dali-adaptor.git] / dali / internal / imaging / tizen / native-image-source-queue-impl-tizen.h
old mode 100755 (executable)
new mode 100644 (file)
index 7f16352..347f60a
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_TIZEN_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/images/native-image-interface-extension.h>
 #include <dali/devel-api/threading/mutex.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <tbm_surface.h>
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 namespace Adaptor
 {
-
 class EglGraphics;
 class EglImageExtensions;
 
 /**
  * Dali internal NativeImageSource.
  */
-class NativeImageSourceQueueTizen: public Internal::Adaptor::NativeImageSourceQueue, public NativeImageInterface::Extension
+class NativeImageSourceQueueTizen : public Internal::Adaptor::NativeImageSourceQueue
 {
 public:
-
   /**
    * Create a new NativeImageSourceQueueTizen internally.
    * Depending on hardware the width and height may have to be a power of two.
    * @param[in] width The width of the image.
    * @param[in] height The height of the image.
-   * @param[in] depth color depth of the image.
+   * @param[in] colorFormat The color format of the image.
    * @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
    * @return A smart-pointer to a newly allocated image.
    */
-  static NativeImageSourceQueueTizen* New( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
+  static NativeImageSourceQueueTizen* New(uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue);
 
   /**
    * @copydoc Dali::NativeImageSourceQueue::GetNativeImageSourceQueue()
@@ -66,7 +61,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSourceQueue::SetSize
    */
-  void SetSize( uint32_t width, uint32_t height ) override;
+  void SetSize(uint32_t width, uint32_t height) override;
 
   /**
    * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
@@ -74,19 +69,34 @@ public:
   void IgnoreSourceImage() override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::CanDequeueBuffer
+   */
+  bool CanDequeueBuffer() override;
+
+  /**
+   * @copydoc Dali::NativeImageSourceQueue::DequeueBuffer
+   */
+  uint8_t* DequeueBuffer(uint32_t& width, uint32_t& height, uint32_t& stride) override;
+
+  /**
+   * @copydoc Dali::NativeImageSourceQueue::EnqueueBuffer
+   */
+  bool EnqueueBuffer(uint8_t* buffer) override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueTizen() override;
 
   /**
-   * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
+   * @copydoc Dali::NativeImageInterface::CreateResource
    */
-  bool GlExtensionCreate() override;
+  bool CreateResource() override;
 
   /**
-   * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
+   * @copydoc Dali::NativeImageInterface::DestroyResource()
    */
-  void GlExtensionDestroy() override;
+  void DestroyResource() override;
 
   /**
    * @copydoc Dali::NativeImageInterface::TargetTexture()
@@ -123,61 +133,71 @@ public:
   }
 
   /**
-   * @copydoc Dali::NativeImageInterface::GetExtension()
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
    */
-  NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
-  {
-    return this;
-  }
+  bool ApplyNativeFragmentShader(std::string& shader) override;
 
   /**
-   * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
+   * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
-  const char* GetCustomFragmentPreFix() override;
+  const char* GetCustomSamplerTypename() const override;
 
   /**
-   * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
+   * @copydoc Dali::NativeImageInterface::GetTextureTarget()
    */
-  const char* GetCustomSamplerTypename() override;
+  int GetTextureTarget() const override;
 
   /**
-   * @copydoc Dali::NativeImageInterface::Extension::GetEglImageTextureTarget()
+   * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
    */
-  int GetEglImageTextureTarget() override;
+  Any GetNativeImageHandle() const override;
 
-private:
+  /**
+   * @copydoc Dali::NativeImageInterface::SourceChanged()
+   */
+  bool SourceChanged() const override;
+
+  /**
+   * @copydoc Dali::NativeImageInterface::GetExtension()
+   */
+  NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
+  {
+    return nullptr;
+  }
 
+private:
   /**
    * Private constructor; @see NativeImageSourceQueue::New()
    * @param[in] width The width of the image.
    * @param[in] height The height of the image.
-   * @param[in] colour depth of the image.
+   * @param[in] colorFormat The format of the image.
    * @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
    */
-  NativeImageSourceQueueTizen( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
+  NativeImageSourceQueueTizen(uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue);
 
-  void Initialize( Dali::NativeImageSourceQueue::ColorDepth depth );
+  void Initialize(Dali::NativeImageSourceQueue::ColorFormat colorFormat);
 
   void ResetEglImageList();
 
-  tbm_surface_queue_h GetSurfaceFromAny( Any source ) const;
+  tbm_surface_queue_h GetSurfaceFromAny(Any source) const;
 
-  bool CheckBlending( int format );
+  bool CheckBlending(int format);
 
 private:
-
-  typedef std::pair< tbm_surface_h, void* > EglImagePair;
-
-  Dali::Mutex                      mMutex;                ///< Mutex
-  uint32_t                         mWidth;                ///< image width
-  uint32_t                         mHeight;               ///< image height
-  tbm_surface_queue_h              mTbmQueue;             ///< Tbm surface queue handle
-  tbm_surface_h                    mConsumeSurface;       ///< The current tbm surface
-  std::vector< EglImagePair >      mEglImages;            ///< EGL Image vector
-  EglGraphics*                     mEglGraphics;          ///< EGL Graphics
-  EglImageExtensions*              mEglImageExtensions;   ///< The EGL Image Extensions
-  bool                             mOwnTbmQueue;          ///< Whether we created tbm queue
-  bool                             mBlendingRequired;     ///< Whether blending is required
+  typedef std::pair<tbm_surface_h, void*> EglImagePair;
+  typedef std::pair<tbm_surface_h, void*> BufferPair;
+
+  Dali::Mutex               mMutex;              ///< Mutex
+  uint32_t                  mWidth;              ///< image width
+  uint32_t                  mHeight;             ///< image height
+  tbm_surface_queue_h       mTbmQueue;           ///< Tbm surface queue handle
+  tbm_surface_h             mConsumeSurface;     ///< The current tbm surface
+  std::vector<EglImagePair> mEglImages;          ///< EGL Image vector
+  std::vector<BufferPair>   mBuffers;            ///< Buffer vector
+  EglGraphics*              mEglGraphics;        ///< EGL Graphics
+  EglImageExtensions*       mEglImageExtensions; ///< The EGL Image Extensions
+  bool                      mOwnTbmQueue;        ///< Whether we created tbm queue
+  bool                      mBlendingRequired;   ///< Whether blending is required
 };
 
 } // namespace Adaptor