1 #ifndef __DALI_INTERNAL_FRAME_BUFFER_TEXTURE_H__
2 #define __DALI_INTERNAL_FRAME_BUFFER_TEXTURE_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
25 #include <dali/public-api/images/frame-buffer-image.h>
26 #include <dali/integration-api/bitmap.h>
27 #include <dali/integration-api/debug.h>
28 #include <dali/internal/render/gl-resources/gl-texture.h>
38 * Used as a frame buffer for RenderTask
40 class FrameBufferTexture : public Texture
45 * Creates a new texture object
46 * @param[in] width The width (pixels)
47 * @param[in] height The height (pixels)
48 * @param[in] context The GL context
50 FrameBufferTexture(unsigned int width, unsigned int height, Context& context);
53 * Creates a new texture object
54 * @param[in] width The width (pixels)
55 * @param[in] height The height (pixels)
56 * @param[in] pixelFormat The pixel format
57 * @param[in] context The GL context
59 FrameBufferTexture(unsigned int width, unsigned int height, Pixel::Format pixelFormat, Context& context);
62 * Creates a new texture object
63 * @param[in] width The width (pixels)
64 * @param[in] height The height (pixels)
65 * @param[in] pixelFormat The pixel format
66 * @param[in] bufferFormat The buffer formats to be attached in the FBO
67 * @param[in] context The GL context
69 FrameBufferTexture(unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat, Context& context);
72 * Creates a new texture object
73 * @param[in] nativeImage The NativeImage
74 * @param context The GL context
76 FrameBufferTexture( NativeImageInterfacePtr nativeImage, Context& context );
81 virtual ~FrameBufferTexture();
84 * @copydoc Texture::IsFullyOpaque
86 virtual bool IsFullyOpaque() const;
89 * @copydoc Texture::HasAlphaChannel
91 virtual bool HasAlphaChannel() const;
94 * @copydoc Texture::Init
99 * Prepare FBO for rendering.
100 * @return true if the FBO is prepared and its status is GL_FRAMEBUFFER_COMPLETE, otherwise false.
102 virtual bool Prepare();
105 unsigned int mFrameBufferName;
106 unsigned int mRenderBufferName;
107 unsigned int mStencilBufferName;
108 Pixel::Format mPixelFormat;
109 RenderBuffer::Format mBufferFormat;
110 NativeImageInterfacePtr mNativeImage; ///< For native FBOs only
113 * @copydoc Texture::CreateGlTexture
115 virtual bool CreateGlTexture();
118 * @copydoc Texture::GlCleanup
120 virtual void GlCleanup();
122 }; // class FrameBufferTexture
124 } //namespace Internal
127 #endif //__DALI_INTERNAL_FRAME_BUFFER_TEXTURE_H__