Dali 3D User Interface Engine
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
Dali::Internal::FrameBufferTexture Class Reference

Texture class. More...

#include <frame-buffer-texture.h>

Inheritance diagram for Dali::Internal::FrameBufferTexture:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::FrameBufferTexture:
Collaboration graph
[legend]

Public Member Functions

 FrameBufferTexture (unsigned int width, unsigned int height, Context &context)
 Creates a new texture object. More...
 
 FrameBufferTexture (unsigned int width, unsigned int height, Pixel::Format pixelFormat, Context &context)
 Creates a new texture object. More...
 
 FrameBufferTexture (unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat, Context &context)
 Creates a new texture object. More...
 
 FrameBufferTexture (NativeImageInterfacePtr nativeImage, Context &context)
 Creates a new texture object. More...
 
virtual ~FrameBufferTexture ()
 Destructor. More...
 
virtual bool IsFullyOpaque () const
 Query whether the texture is completely opaque. More...
 
virtual bool HasAlphaChannel () const
 Query whether the texture data has an alpha channel. More...
 
virtual bool Init ()
 Initialization method for Texture. More...
 
virtual bool Prepare ()
 Prepare FBO for rendering. More...
 
- Public Member Functions inherited from Dali::Internal::Texture
virtual void Update (Integration::Bitmap *bitmap)
 Update the texture with the bitmap. More...
 
virtual void UpdateArea (const RectArea &area)
 Update the texture from the modified bitmap. More...
 
virtual void Update (Integration::Bitmap *srcBitmap, std::size_t xOffset, std::size_t yOffset)
 Update part of the texture with a different bitmap. More...
 
virtual void Update (PixelData *srcPixelData, std::size_t xOffset, std::size_t yOffset)
 Update part of the texture with a pixel buffer. More...
 
virtual bool UpdateOnCreate ()
 
virtual bool Bind (GLenum target, TextureUnit textureunit)
 Binds the texture for use. More...
 
unsigned int GetTextureId ()
 Returns GL texture ID. More...
 
virtual unsigned int GetWidth () const
 Return the width of image in pixels. More...
 
virtual unsigned int GetHeight () const
 Return the height of image in pixels. More...
 
void SetTextureId (GLuint id)
 Sets the texture id. More...
 
void ApplySampler (TextureUnit unit, unsigned int samplerBitfield)
 Apply the given sampler to the texture. More...
 
virtual ~Texture ()
 Destructor. More...
 
virtual void GlContextDestroyed ()
 Reset all GL resources. More...
 
- Public Member Functions inherited from Dali::RefObject
void Reference ()
 Increment the object's reference count. More...
 
void Unreference ()
 Decrement the object's reference count. More...
 
int ReferenceCount ()
 Retrieve the object's reference count. More...
 
- Public Member Functions inherited from Dali::Internal::GlResourceOwner
virtual ~GlResourceOwner ()
 Virtual destructor. More...
 

Protected Member Functions

virtual bool CreateGlTexture ()
 Initialize texture for rendering. More...
 
virtual void GlCleanup ()
 Release all GL resources. More...
 
- Protected Member Functions inherited from Dali::Internal::Texture
 Texture (Context &context, unsigned int width, unsigned int height, unsigned int imageWidth, unsigned int imageHeight)
 Constructor. More...
 
 Texture (Context &context, unsigned int width, unsigned int height)
 Constructor. More...
 
- Protected Member Functions inherited from Dali::RefObject
 RefObject ()
 Default constructor. More...
 
virtual ~RefObject ()
 RefObject is intended as a base class. More...
 
 RefObject (const RefObject &rhs)
 Copy constructor. More...
 
RefObjectoperator= (const RefObject &rhs)
 Assignment operator. More...
 

Protected Attributes

unsigned int mFrameBufferName
 
unsigned int mRenderBufferName
 
unsigned int mStencilBufferName
 
Pixel::Format mPixelFormat
 
RenderBuffer::Format mBufferFormat
 
NativeImageInterfacePtr mNativeImage
 For native FBOs only. More...
 
- Protected Attributes inherited from Dali::Internal::Texture
ContextmContext
 The GL Context. More...
 
GLuint mId
 Texture id. More...
 
unsigned int mSamplerBitfield
 The packed bitfield of the current sampler. More...
 
unsigned int mWidth
 texture width, may be scaled power of 2 (if not in an atlas) More...
 
unsigned int mHeight
 texture width, may be scaled power of 2 (if not in an atlas) More...
 
unsigned int mImageWidth
 width of the original image (may be smaller than texture width) More...
 
unsigned int mImageHeight
 height of the original image (may be smaller than texture height) More...
 

Additional Inherited Members

- Public Types inherited from Dali::Internal::Texture
typedef Rect< int > PixelArea
 Used to define the area of the texture to display. More...
 
typedef Rect< unsigned int > RectArea
 Used to define a region of a bitmap. More...
 

Detailed Description

Texture class.

Used as a frame buffer for RenderTask

Definition at line 40 of file frame-buffer-texture.h.

Constructor & Destructor Documentation

Dali::Internal::FrameBufferTexture::FrameBufferTexture ( unsigned int  width,
unsigned int  height,
Context context 
)

Creates a new texture object.

Parameters
[in]widthThe width (pixels)
[in]heightThe height (pixels)
[in]contextThe GL context

Definition at line 33 of file frame-buffer-texture.cpp.

References DALI_LOG_TRACE_METHOD.

Dali::Internal::FrameBufferTexture::FrameBufferTexture ( unsigned int  width,
unsigned int  height,
Pixel::Format  pixelFormat,
Context context 
)

Creates a new texture object.

Parameters
[in]widthThe width (pixels)
[in]heightThe height (pixels)
[in]pixelFormatThe pixel format
[in]contextThe GL context

Definition at line 47 of file frame-buffer-texture.cpp.

References DALI_LOG_TRACE_METHOD.

Dali::Internal::FrameBufferTexture::FrameBufferTexture ( unsigned int  width,
unsigned int  height,
Pixel::Format  pixelFormat,
RenderBuffer::Format  bufferFormat,
Context context 
)

Creates a new texture object.

Parameters
[in]widthThe width (pixels)
[in]heightThe height (pixels)
[in]pixelFormatThe pixel format
[in]bufferFormatThe buffer formats to be attached in the FBO
[in]contextThe GL context

Definition at line 61 of file frame-buffer-texture.cpp.

References DALI_LOG_TRACE_METHOD.

Dali::Internal::FrameBufferTexture::FrameBufferTexture ( NativeImageInterfacePtr  nativeImage,
Context context 
)

Creates a new texture object.

Parameters
[in]nativeImageThe NativeImage
contextThe GL context

Definition at line 74 of file frame-buffer-texture.cpp.

References DALI_LOG_INFO.

Dali::Internal::FrameBufferTexture::~FrameBufferTexture ( )
virtual

Destructor.

Definition at line 87 of file frame-buffer-texture.cpp.

References DALI_LOG_TRACE_METHOD.

Member Function Documentation

bool Dali::Internal::FrameBufferTexture::CreateGlTexture ( )
protectedvirtual

Initialize texture for rendering.

Returns
true on success

Implements Dali::Internal::Texture.

Definition at line 132 of file frame-buffer-texture.cpp.

References Dali::Internal::Context::ActiveTexture(), Dali::Internal::Context::Bind2dTexture(), Dali::Internal::Context::BindFramebuffer(), Dali::Internal::Context::BindRenderbuffer(), Dali::Internal::Context::CheckFramebufferStatus(), Dali::RenderBuffer::COLOR_DEPTH, Dali::RenderBuffer::COLOR_DEPTH_STENCIL, Dali::RenderBuffer::COLOR_STENCIL, Dali::Integration::ConvertToGlFormat(), DALI_ASSERT_ALWAYS, DALI_LOG_ERROR, DALI_LOG_TRACE_METHOD, Dali::Internal::Context::FramebufferRenderbuffer(), Dali::Internal::Context::FramebufferTexture2D(), Dali::Internal::Context::GenFramebuffers(), Dali::Internal::Context::GenRenderbuffers(), Dali::Internal::Context::GenTextures(), Dali::Internal::Context::GetError(), GL_CLAMP_TO_EDGE, GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT16, GL_FRAMEBUFFER, GL_FRAMEBUFFER_COMPLETE, GL_RENDERBUFFER, GL_RGBA, GL_STENCIL_ATTACHMENT, GL_STENCIL_INDEX8, GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_UNPACK_ALIGNMENT, GL_UNSIGNED_BYTE, Dali::NativeImageInterface::GlExtensionCreate(), mBufferFormat, Dali::Internal::Texture::mContext, mFrameBufferName, Dali::Internal::Texture::mHeight, Dali::Internal::Texture::mId, mNativeImage, mPixelFormat, mRenderBufferName, mStencilBufferName, Dali::Internal::Texture::mWidth, Dali::Internal::Context::PixelStorei(), Dali::Internal::Context::RenderbufferStorage(), Dali::NativeImageInterface::TargetTexture(), Dali::Internal::Context::TexImage2D(), Dali::Internal::Context::TexParameteri(), and Dali::Internal::TEXTURE_UNIT_UPLOAD.

Here is the call graph for this function:

void Dali::Internal::FrameBufferTexture::GlCleanup ( )
protectedvirtual

Release all GL resources.

This means releasing buffer objects, textures. etc Context can be used, unless GlContextDestroyed has been called

Precondition
This method can only be called from the render-thread.

Reimplemented from Dali::Internal::Texture.

Definition at line 228 of file frame-buffer-texture.cpp.

References Dali::Internal::Context::DeleteFramebuffers(), Dali::Internal::Context::DeleteRenderbuffers(), Dali::Internal::Texture::GlCleanup(), Dali::NativeImageInterface::GlExtensionDestroy(), Dali::Internal::Texture::mContext, mFrameBufferName, mNativeImage, mRenderBufferName, mStencilBufferName, and Dali::IntrusivePtr< T >::Reset().

Here is the call graph for this function:

bool Dali::Internal::FrameBufferTexture::HasAlphaChannel ( ) const
virtual

Query whether the texture data has an alpha channel.

Returns
True if the texture data has an alpha channel.

Implements Dali::Internal::Texture.

Definition at line 99 of file frame-buffer-texture.cpp.

References mNativeImage, and Dali::NativeImageInterface::RequiresBlending().

Referenced by IsFullyOpaque().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Internal::FrameBufferTexture::Init ( )
virtual

Initialization method for Texture.

Might or might not be needed in specific implementations.

Returns
true if successful, false otherwise

Implements Dali::Internal::Texture.

Definition at line 109 of file frame-buffer-texture.cpp.

References DALI_LOG_TRACE_METHOD.

Referenced by Dali::Internal::TextureFactory::NewFrameBufferTexture().

Here is the caller graph for this function:

bool Dali::Internal::FrameBufferTexture::IsFullyOpaque ( ) const
virtual

Query whether the texture is completely opaque.

Returns
True if all pixels of the texture data are opaque

Implements Dali::Internal::Texture.

Definition at line 94 of file frame-buffer-texture.cpp.

References HasAlphaChannel().

Here is the call graph for this function:

bool Dali::Internal::FrameBufferTexture::Prepare ( )
virtual

Prepare FBO for rendering.

Returns
true if the FBO is prepared and its status is GL_FRAMEBUFFER_COMPLETE, otherwise false.

Definition at line 115 of file frame-buffer-texture.cpp.

References Dali::Internal::Texture::Bind(), Dali::Internal::Context::BindFramebuffer(), GL_FRAMEBUFFER, GL_TEXTURE_2D, Dali::Internal::Texture::mContext, mFrameBufferName, Dali::Internal::Texture::mId, and Dali::Internal::TEXTURE_UNIT_FRAMEBUFFER.

Referenced by Dali::Internal::SceneGraph::RenderManager::DoRender().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

RenderBuffer::Format Dali::Internal::FrameBufferTexture::mBufferFormat
protected

Definition at line 109 of file frame-buffer-texture.h.

Referenced by CreateGlTexture().

unsigned int Dali::Internal::FrameBufferTexture::mFrameBufferName
protected

Definition at line 105 of file frame-buffer-texture.h.

Referenced by CreateGlTexture(), GlCleanup(), and Prepare().

NativeImageInterfacePtr Dali::Internal::FrameBufferTexture::mNativeImage
protected

For native FBOs only.

Definition at line 110 of file frame-buffer-texture.h.

Referenced by CreateGlTexture(), GlCleanup(), and HasAlphaChannel().

Pixel::Format Dali::Internal::FrameBufferTexture::mPixelFormat
protected

Definition at line 108 of file frame-buffer-texture.h.

Referenced by CreateGlTexture().

unsigned int Dali::Internal::FrameBufferTexture::mRenderBufferName
protected

Definition at line 106 of file frame-buffer-texture.h.

Referenced by CreateGlTexture(), and GlCleanup().

unsigned int Dali::Internal::FrameBufferTexture::mStencilBufferName
protected

Definition at line 107 of file frame-buffer-texture.h.

Referenced by CreateGlTexture(), and GlCleanup().


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali