Removed legacy resource tracking / logging
[platform/core/uifw/dali-core.git] / dali / internal / render / gl-resources / frame-buffer-texture.h
1 #ifndef __DALI_INTERNAL_FRAME_BUFFER_TEXTURE_H__
2 #define __DALI_INTERNAL_FRAME_BUFFER_TEXTURE_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //     http://floralicense.org/license/
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19
20 // EXTERNAL INCLUDES
21 #include <string>
22
23 // INTERNAL INCLUDES
24 #include <dali/internal/render/gl-resources/texture.h>
25 #include <dali/integration-api/bitmap.h>
26 #include <dali/integration-api/debug.h>
27
28 namespace Dali
29 {
30
31 namespace Internal
32 {
33
34 /**
35  * Texture class.
36  * Used as a frame buffer for RenderTask
37  */
38 class FrameBufferTexture : public Texture
39 {
40 public:
41   /**
42    * Creates a new texture object
43    * @param[in] width       The width (pixels)
44    * @param[in] height      The height (pixels)
45    * @param[in] pixelFormat The pixel format
46    * @param     context The GL context
47    */
48   FrameBufferTexture(unsigned int width, unsigned int height, Pixel::Format pixelFormat, Context& context);
49
50   /**
51    * Destructor.
52    */
53   virtual ~FrameBufferTexture();
54
55   /**
56    * @copydoc Texture::IsFullyOpaque
57    */
58   virtual bool IsFullyOpaque() const;
59
60   /**
61    * @copydoc Texture::HasAlphaChannel
62    */
63   virtual bool HasAlphaChannel() const;
64
65   /**
66    * @copydoc Texture::Init
67    */
68   virtual bool Init();
69
70   /**
71    * Prepare FBO for rendering.
72    * @return true if the FBO is prepared and its status is GL_FRAMEBUFFER_COMPLETE, otherwise false.
73    */
74   virtual bool Prepare();
75
76 protected:
77   unsigned int mFrameBufferName;
78   unsigned int mRenderBufferName;
79
80   /**
81    * @copydoc Texture::CreateGlTexture
82    */
83   virtual bool CreateGlTexture();
84
85   /**
86    * @copydoc Texture::GlCleanup
87    */
88   virtual void GlCleanup();
89
90 }; // class FrameBufferTexture
91
92 }  //namespace Internal
93
94 } //namespace Dali
95 #endif //__DALI_INTERNAL_FRAME_BUFFER_TEXTURE_H__
96