Merge "Support multiple window rendering" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / render / renderers / render-frame-buffer.h
index 00d2996..16d2a73 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_RENDER_FRAME_BUFFER_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -22,7 +22,6 @@
 #include <dali/internal/render/gl-resources/context.h>
 #include <dali/internal/render/renderers/render-sampler.h>
 #include <dali/integration-api/gl-defines.h>
-#include <dali/integration-api/resource-declarations.h>
 
 namespace Dali
 {
@@ -30,7 +29,6 @@ namespace Internal
 {
 namespace Render
 {
-class Texture;
 
 class FrameBuffer
 {
@@ -38,70 +36,68 @@ public:
 
   /**
    * Constructor
-   * @param[in] width The width of the FrameBuffer
-   * @param[in] height The height of the FrameBuffer
-   * @param[in] attachments The attachments comprising the format of the FrameBuffer (bit-mask)
    */
-  FrameBuffer( unsigned int width, unsigned int height, unsigned int attachments );
+  FrameBuffer() {};
 
   /**
    * Destructor
    */
-  ~FrameBuffer();
+  virtual ~FrameBuffer() {};
 
   /**
    * Creates a FrameBuffer object in the GPU.
    * @param[in] context The GL context
    */
-  void Initialize(Context& context);
+  virtual void Initialize( Context& context ) = 0;
 
   /**
    * Deletes the framebuffer object from the GPU
    * @param[in] context The GL context
    */
-  void Destroy( Context& context );
+  virtual void Destroy( Context& context ) = 0;
 
   /**
    * Called by RenderManager to inform the framebuffer that the context has been destroyed
    */
-  void GlContextDestroyed();
-
-  /**
-   * @brief Attach a texture for color rendering. Valid only for Framebuffers with COLOR attachments.
-   * param[in] context The GL context
-   * @param[in] texture The texture that will be used as output when rendering
-   * @param[in] mipmapLevel The mipmap of the texture to be attached
-   * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
-   */
-  void AttachColorTexture( Context& context, Render::Texture* texture, unsigned int mipmapLevel, unsigned int layer );
+  virtual void GlContextDestroyed() = 0;
 
   /**
    * @brief Bind the framebuffer
    * @param[in] context The GL context
    */
-  void Bind( Context& context );
+  virtual void Bind( Context& context ) = 0;
 
   /**
    * @brief Get the width of the FrameBuffer
    * @return The width of the framebuffer
    */
-  unsigned int GetWidth() const;
+  virtual uint32_t GetWidth() const = 0;
 
   /**
    * @brief Get the height of the FrameBuffer
    * @return The height of the framebuffer
    */
-  unsigned int GetHeight() const;
+  virtual uint32_t GetHeight() const = 0;
+
+  /**
+   * @brief Check whether the FrameBuffer is backed by a render surface
+   * @return True if the FrameBuffer is backed by a render surface
+   */
+  virtual bool IsSurfaceBacked() = 0;
 
 private:
 
-  GLuint mId;
-  GLuint mDepthBuffer;
-  GLuint mStencilBuffer;
-  unsigned int mWidth;
-  unsigned int mHeight;
-};
+  /**
+   * @brief Undefined copy constructor. FrameBuffer cannot be copied
+   */
+  FrameBuffer( const FrameBuffer& rhs ) = delete;
+
+  /**
+   * @brief Undefined assignment operator. FrameBuffer cannot be copied
+   */
+  FrameBuffer& operator=( const FrameBuffer& rhs ) = delete;
 
+};
 
 } // namespace Render