[Tizen] Make possible to capture on the old driver devices.
[platform/core/uifw/dali-core.git] / dali / internal / event / rendering / frame-buffer-impl.h
index e30c285..74ccf87 100644 (file)
 
 namespace Dali
 {
-
-namespace Integration
-{
-class RenderSurface;
-}
+using Mask = Dali::FrameBuffer::Attachment::Mask;
 
 namespace Internal
 {
@@ -43,7 +39,7 @@ class FrameBuffer;
 }
 
 class FrameBuffer;
-typedef IntrusivePtr<FrameBuffer> FrameBufferPtr;
+using FrameBufferPtr = IntrusivePtr<FrameBuffer>;
 
 class FrameBuffer : public BaseObject
 {
@@ -62,18 +58,9 @@ public:
   static FrameBufferPtr New( uint32_t width, uint32_t height, Mask attachments );
 
   /**
-   * @brief Create a new FrameBuffer
-   *
-   * @param[in] renderSurface   The render surface
-   * @param[in] attachments     The attachments comprising the format of the FrameBuffer (bit-mask)
-   * @return A smart-pointer to the newly allocated Texture.
-   */
-  static FrameBufferPtr New( Dali::Integration::RenderSurface& renderSurface, Mask attachments );
-
-  /**
    * A reference counted object may only be deleted by calling Unreference()
    */
-  virtual ~FrameBuffer();
+  ~FrameBuffer() override;
 
   /**
    * @brief Get the FrameBuffer render object
@@ -88,26 +75,48 @@ public:
   void AttachColorTexture( TexturePtr texture, uint32_t mipmapLevel, uint32_t layer );
 
   /**
+   * @copydoc Dali::DevelFrameBuffer::AttachDepthTexture()
+   */
+  void AttachDepthTexture( TexturePtr texture, uint32_t mipmapLevel );
+
+  /**
+   * @copydoc Dali::DevelFrameBuffer::AttachDepthStencilTexture()
+   */
+  void AttachDepthStencilTexture( TexturePtr texture, uint32_t mipmapLevel );
+
+  /**
    * @copydoc Dali::FrameBuffer::GetColorTexture()
    */
   Texture* GetColorTexture(uint8_t index) const;
 
   /**
-   * @brief Sets the frame buffer size.
-   * @param[in] width The width size
-   * @param[in] height The height size
+   * @copydoc Dali::DevelFrameBuffer::GetDepthTexture()
    */
-  void SetSize( uint32_t width, uint32_t height );
+  Texture* GetDepthTexture() const;
 
   /**
-   * @brief Mark the render surface as invalid
-   *
-   * The render surface is maked as invalid when it is deleted.
+   * @copydoc Dali::DevelFrameBuffer::GetDepthStencilTexture()
+   */
+  Texture* GetDepthStencilTexture() const;
+
+  /**
+   * @brief Retrieve captured buffer
    *
-   * @note Only for FrameBuffer backed by a render surface.
-   * @return True if the FrameBuffer is backed by a render surface
+   * @return a pointer of the buffer.
    */
-  void MarkSurfaceAsInvalid();
+  uint8_t* GetRenderedBuffer();
+
+  /**
+   * @copydoc Dali::FrameBuffer::CaptureRenderedResult()
+   */
+  void CaptureRenderedResult();
+
+  /**
+   * @brief Sets the frame buffer size.
+   * @param[in] width The width size
+   * @param[in] height The height size
+   */
+  void SetSize( uint32_t width, uint32_t height );
 
 private: // implementation
 
@@ -122,7 +131,7 @@ private: // implementation
   /**
    * Second stage initialization of the Texture
    */
-  void Initialize( Integration::RenderSurface* renderSurface = nullptr );
+  void Initialize();
 
 protected:
 
@@ -138,13 +147,12 @@ private: // data
   Internal::Render::FrameBuffer* mRenderObject;        ///< The Render::Texture associated to this texture
 
   TexturePtr mColor[ Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS ];
+  TexturePtr mDepth;
+  TexturePtr mStencil;
   uint32_t mWidth;
   uint32_t mHeight;
   Mask mAttachments;                           ///< Bit-mask of type FrameBuffer::Attachment::Mask
   uint8_t mColorAttachmentCount;
-
-  bool mIsSurfaceBacked:1;
-
 };
 
 } // namespace Internal