[dali_2.3.42] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / native-image-source-queue.h
index d6995d9..610dce6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_NATIVE_IMAGE_SOURCE_QUEUE_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -76,6 +76,7 @@ public:
   /**
    * @brief Creates a new NativeImageSourceQueue.
    *        Depending on hardware, the width and height may have to be a power of two.
+   *        It will use 3, or defined by DALI_TBM_SURFACE_QUEUE_SIZE as default.
    * @param[in] width The width of the image
    * @param[in] height The height of the image
    * @param[in] colorFormat The color format of the image
@@ -84,6 +85,18 @@ public:
   static NativeImageSourceQueuePtr New(uint32_t width, uint32_t height, ColorFormat colorFormat);
 
   /**
+   * @brief Creates a new NativeImageSourceQueue with the queue size.
+   *        Depending on hardware, the width and height may have to be a power of two.
+   * @note Since queueCount can increase the memory usage, we recommened queueCount value is less or equal than 3.
+   * @param[in] queueCount The number of queue of the image. If it is 0, will use default.
+   * @param[in] width The width of the image
+   * @param[in] height The height of the image
+   * @param[in] colorFormat The color format of the image
+   * @return A smart-pointer to a newly allocated image
+   */
+  static NativeImageSourceQueuePtr New(uint32_t queueCount, uint32_t width, uint32_t height, ColorFormat colorFormat);
+
+  /**
    * @brief Creates a new NativeImageSourceQueue from an existing native image source.
    *
    * @param[in] nativeImageSourceQueue NativeImageSourceQueue must be a any handle with native image source
@@ -164,6 +177,13 @@ public:
    */
   const char* GetCustomSamplerTypename() const override;
 
+  /**
+   * @brief Get the number of queue count for this image.
+   *
+   * @return The number of queue count.
+   */
+  uint32_t GetQueueCount() const;
+
 private: // native image
   /**
    * @copydoc Dali::NativeImageInterface::CreateResource()
@@ -211,6 +231,11 @@ private: // native image
   bool SourceChanged() const override;
 
   /**
+   * @copydoc Dali::NativeImageInterface::GetUpdatedArea()
+   */
+  Rect<uint32_t> GetUpdatedArea() override;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetExtension()
    */
   NativeImageInterface::Extension* GetExtension() override;
@@ -219,12 +244,13 @@ private:
   /// @cond internal
   /**
    * @brief Private constructor.
+   * @param[in] queueCount The number of queue of the image. If it is 0, will use default.
    * @param[in] width The width of the image
    * @param[in] height The height of the image
    * @param[in] colorFormat The color format of the image
    * @param[in] nativeImageSourceQueue contains either: native image source or is empty
    */
-  DALI_INTERNAL NativeImageSourceQueue(uint32_t width, uint32_t height, ColorFormat colorFormat, Any nativeImageSourceQueue);
+  DALI_INTERNAL NativeImageSourceQueue(uint32_t queueCount, uint32_t width, uint32_t height, ColorFormat colorFormat, Any nativeImageSourceQueue);
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().