Dali 3D User Interface Engine
List of all members | Classes | Public Member Functions | Private Attributes
Dali::Internal::Render::PropertyBuffer Class Reference

#include <render-property-buffer.h>

Collaboration diagram for Dali::Internal::Render::PropertyBuffer:
Collaboration graph
[legend]

Classes

struct  Component
 
struct  Format
 Structure that holds the meta-data of the format of PropertyBuffer. More...
 

Public Member Functions

 PropertyBuffer ()
 Default constructor. More...
 
 ~PropertyBuffer ()
 Destructor. More...
 
void SetFormat (PropertyBuffer::Format *format)
 Set the format of the buffer. More...
 
void SetData (Dali::Vector< char > *data)
 Set the data of the PropertyBuffer. More...
 
void SetSize (unsigned int size)
 Set the number of elements. More...
 
void BindBuffer (GpuBuffer::Target target)
 Bind the property buffer. More...
 
bool Update (Context &context, bool isIndexBuffer)
 Perform the upload of the buffer only when requiered. More...
 
unsigned int EnableVertexAttributes (Context &context, Vector< GLint > &vAttributeLocation, unsigned int locationBase)
 Enable the vertex attributes for each vertex buffer from the corresponding shader program. More...
 
unsigned int GetAttributeCount () const
 Get the number of attributes present in the buffer. More...
 
const std::string & GetAttributeName (unsigned int index) const
 Retrieve the i-essim attribute name. More...
 
std::size_t GetDataSize () const
 Retrieve the size of the buffer in bytes. More...
 
std::size_t GetElementSize () const
 Retrieve the size of one element of the buffer. More...
 
unsigned int GetElementCount () const
 Retrieve the number of elements in the buffer. More...
 

Private Attributes

OwnerPointer
< PropertyBuffer::Format
mFormat
 Format of the buffer. More...
 
OwnerPointer< Dali::Vector
< char > > 
mData
 Data. More...
 
OwnerPointer< GpuBuffermGpuBuffer
 Pointer to the GpuBuffer associated with this RenderPropertyBuffer. More...
 
size_t mSize
 Number of Elements in the buffer. More...
 
bool mDataChanged
 Flag to know if data has changed in a frame. More...
 

Detailed Description

Definition at line 32 of file render-property-buffer.h.

Constructor & Destructor Documentation

Dali::Internal::Render::PropertyBuffer::PropertyBuffer ( )

Default constructor.

Definition at line 102 of file render-property-buffer.cpp.

Dali::Internal::Render::PropertyBuffer::~PropertyBuffer ( )

Destructor.

Definition at line 111 of file render-property-buffer.cpp.

Member Function Documentation

void Dali::Internal::Render::PropertyBuffer::BindBuffer ( GpuBuffer::Target  target)

Bind the property buffer.

Parameters
[in]targetThe binding point

Definition at line 185 of file render-property-buffer.cpp.

References mGpuBuffer.

Referenced by Dali::Internal::SceneGraph::RenderGeometry::UploadAndDraw().

Here is the caller graph for this function:

unsigned int Dali::Internal::Render::PropertyBuffer::EnableVertexAttributes ( Context context,
Vector< GLint > &  vAttributeLocation,
unsigned int  locationBase 
)

Enable the vertex attributes for each vertex buffer from the corresponding shader program.

Parameters
[in]contextThe GL context
[in]vAttributeLocationVector containing attributes location for current program
[in]locationBaseIndex in vAttributeLocation corresponding to the first attribute defined by this buffer

Definition at line 193 of file render-property-buffer.cpp.

References Dali::Internal::Context::EnableVertexAttributeArray(), anonymous_namespace{render-property-buffer.cpp}::GetPropertyImplementationGlSize(), anonymous_namespace{render-property-buffer.cpp}::GetPropertyImplementationGlType(), GL_FALSE, mFormat, and Dali::Internal::Context::VertexAttribPointer().

Here is the call graph for this function:

unsigned int Dali::Internal::Render::PropertyBuffer::GetAttributeCount ( ) const
inline

Get the number of attributes present in the buffer.

Returns
The number of attributes stored in this buffer

Definition at line 112 of file render-property-buffer.h.

References DALI_ASSERT_DEBUG, and mFormat.

const std::string& Dali::Internal::Render::PropertyBuffer::GetAttributeName ( unsigned int  index) const
inline

Retrieve the i-essim attribute name.

Parameters
[in]indexThe index of the attribute
Returns
The name of the attribute

Definition at line 123 of file render-property-buffer.h.

References DALI_ASSERT_DEBUG, and mFormat.

std::size_t Dali::Internal::Render::PropertyBuffer::GetDataSize ( ) const
inline

Retrieve the size of the buffer in bytes.

Returns
The total size of the buffer

Definition at line 133 of file render-property-buffer.h.

References DALI_ASSERT_DEBUG, mFormat, and mSize.

Referenced by Update(), and Dali::Internal::SceneGraph::RenderGeometry::UploadAndDraw().

Here is the caller graph for this function:

unsigned int Dali::Internal::Render::PropertyBuffer::GetElementCount ( ) const
inline

Retrieve the number of elements in the buffer.

Returns
The total number of elements

Definition at line 153 of file render-property-buffer.h.

References mSize.

std::size_t Dali::Internal::Render::PropertyBuffer::GetElementSize ( ) const
inline

Retrieve the size of one element of the buffer.

Returns
The size of one element

Definition at line 143 of file render-property-buffer.h.

References DALI_ASSERT_DEBUG, and mFormat.

Referenced by Dali::Internal::SceneGraph::RenderGeometry::UploadAndDraw().

Here is the caller graph for this function:

void Dali::Internal::Render::PropertyBuffer::SetData ( Dali::Vector< char > *  data)

Set the data of the PropertyBuffer.

This function takes ownership of the pointer

Parameters
[in]dataThe new data of the PropertyBuffer

Definition at line 121 of file render-property-buffer.cpp.

References mData, and mDataChanged.

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

Here is the caller graph for this function:

void Dali::Internal::Render::PropertyBuffer::SetFormat ( PropertyBuffer::Format format)

Set the format of the buffer.

This function takes ownership of the pointer

Parameters
[in]formatThe format for the PropertyBuffer

Definition at line 115 of file render-property-buffer.cpp.

References mDataChanged, and mFormat.

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

Here is the caller graph for this function:

void Dali::Internal::Render::PropertyBuffer::SetSize ( unsigned int  size)

Set the number of elements.

Parameters
[in]sizeThe number of elements

Definition at line 127 of file render-property-buffer.cpp.

References mDataChanged, and mSize.

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

Here is the caller graph for this function:

bool Dali::Internal::Render::PropertyBuffer::Update ( Context context,
bool  isIndexBuffer 
)

Perform the upload of the buffer only when requiered.

Parameters
[in]contextThe GL context
[in]isIndexBufferTrue if the buffer is used as an index buffer

Definition at line 134 of file render-property-buffer.cpp.

References Dali::Internal::GpuBuffer::ARRAY_BUFFER, DALI_ASSERT_DEBUG, Dali::Internal::GpuBuffer::ELEMENT_ARRAY_BUFFER, GetDataSize(), mData, mDataChanged, mFormat, mGpuBuffer, mSize, Dali::Vector< T, IsTrivialType >::Resize(), Dali::VectorBase::Size(), and Dali::Internal::GpuBuffer::STATIC_DRAW.

Referenced by Dali::Internal::SceneGraph::RenderGeometry::UploadAndDraw().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

OwnerPointer< Dali::Vector< char > > Dali::Internal::Render::PropertyBuffer::mData
private

Data.

Definition at line 160 of file render-property-buffer.h.

Referenced by SetData(), and Update().

bool Dali::Internal::Render::PropertyBuffer::mDataChanged
private

Flag to know if data has changed in a frame.

Definition at line 164 of file render-property-buffer.h.

Referenced by SetData(), SetFormat(), SetSize(), and Update().

OwnerPointer< PropertyBuffer::Format > Dali::Internal::Render::PropertyBuffer::mFormat
private
OwnerPointer<GpuBuffer> Dali::Internal::Render::PropertyBuffer::mGpuBuffer
private

Pointer to the GpuBuffer associated with this RenderPropertyBuffer.

Definition at line 161 of file render-property-buffer.h.

Referenced by BindBuffer(), and Update().

size_t Dali::Internal::Render::PropertyBuffer::mSize
private

Number of Elements in the buffer.

Definition at line 163 of file render-property-buffer.h.

Referenced by GetDataSize(), GetElementCount(), SetSize(), and Update().


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