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

ShaderData class. More...

#include <shader-data.h>

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

Public Member Functions

 ShaderData (const std::string &vertexSource, const std::string &fragmentSource, const Dali::Shader::ShaderHints hints)
 Constructor. More...
 
void SetHashValue (size_t shaderHash)
 Set hash value which is created with vertex and fragment shader code. More...
 
size_t GetHashValue () const
 Get hash value which is created with vertex and fragment shader code. More...
 
const char * GetVertexShader () const
 
const char * GetFragmentShader () const
 
Dali::Shader::ShaderHints GetHints () const
 
bool HasBinary () const
 Check whether there is a compiled binary available. More...
 
void AllocateBuffer (size_t size)
 Allocate a buffer for the compiled binary bytecode. More...
 
size_t GetBufferSize () const
 Get the program buffer. More...
 
unsigned char * GetBufferData ()
 Get the data that the buffer points to. More...
 
Dali::Vector< unsigned char > & GetBuffer ()
 Get the data that the buffer points to. 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...
 

Protected Member Functions

virtual ~ShaderData ()
 Protected Destructor A reference counted object may only be deleted by calling Unreference() 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...
 

Private Member Functions

 ShaderData (const ShaderData &other)
 no copying of this object More...
 
ShaderDataoperator= (const ShaderData &rhs)
 no copying of this object More...
 

Private Attributes

size_t mShaderHash
 hash key created with vertex and fragment shader code More...
 
std::string mVertexShader
 source code for vertex program More...
 
std::string mFragmentShader
 source code for fragment program More...
 
Dali::Shader::ShaderHints mHints
 take a hint More...
 
Dali::Vector< unsigned char > mBuffer
 buffer containing compiled binary bytecode More...
 

Detailed Description

ShaderData class.

A container for shader source code and compiled binary byte code.

Definition at line 42 of file shader-data.h.

Constructor & Destructor Documentation

Dali::Internal::ShaderData::ShaderData ( const std::string &  vertexSource,
const std::string &  fragmentSource,
const Dali::Shader::ShaderHints  hints 
)
inline

Constructor.

Parameters
[in]vertexSourceSource code for vertex program
[in]fragmentSourceSource code for fragment program

Definition at line 51 of file shader-data.h.

virtual Dali::Internal::ShaderData::~ShaderData ( )
inlineprotectedvirtual

Protected Destructor A reference counted object may only be deleted by calling Unreference()

Definition at line 63 of file shader-data.h.

Dali::Internal::ShaderData::ShaderData ( const ShaderData other)
private

no copying of this object

Member Function Documentation

void Dali::Internal::ShaderData::AllocateBuffer ( size_t  size)
inline

Allocate a buffer for the compiled binary bytecode.

Parameters
[in]sizeThe size of the buffer in bytes

Definition at line 126 of file shader-data.h.

References mBuffer, and Dali::Vector< T, IsTrivialType >::Resize().

Here is the call graph for this function:

Dali::Vector<unsigned char>& Dali::Internal::ShaderData::GetBuffer ( )
inline

Get the data that the buffer points to.

Returns
raw pointer to the buffer data

Definition at line 154 of file shader-data.h.

References mBuffer.

unsigned char* Dali::Internal::ShaderData::GetBufferData ( )
inline

Get the data that the buffer points to.

Returns
raw pointer to the buffer data

Definition at line 144 of file shader-data.h.

References DALI_ASSERT_DEBUG, mBuffer, and Dali::VectorBase::Size().

Here is the call graph for this function:

size_t Dali::Internal::ShaderData::GetBufferSize ( ) const
inline

Get the program buffer.

Returns
reference to the buffer

Definition at line 135 of file shader-data.h.

References mBuffer, and Dali::VectorBase::Size().

Referenced by Dali::Internal::ShaderFactory::MemoryCacheInsert().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* Dali::Internal::ShaderData::GetFragmentShader ( ) const
inline
Returns
the vertex shader

Definition at line 101 of file shader-data.h.

References mFragmentShader.

size_t Dali::Internal::ShaderData::GetHashValue ( ) const
inline

Get hash value which is created with vertex and fragment shader code.

Returns
shaderHash hash key created with vertex and fragment shader code

Definition at line 84 of file shader-data.h.

References DALI_ASSERT_DEBUG, and mShaderHash.

Referenced by Dali::Internal::ShaderFactory::MemoryCacheInsert().

Here is the caller graph for this function:

Dali::Shader::ShaderHints Dali::Internal::ShaderData::GetHints ( ) const
inline
Returns
the hints

Definition at line 109 of file shader-data.h.

References mHints.

const char* Dali::Internal::ShaderData::GetVertexShader ( ) const
inline
Returns
the vertex shader

Definition at line 93 of file shader-data.h.

References mVertexShader.

bool Dali::Internal::ShaderData::HasBinary ( ) const
inline

Check whether there is a compiled binary available.

Returns
true if this objects contains a compiled binary

Definition at line 117 of file shader-data.h.

References mBuffer, and Dali::VectorBase::Size().

Here is the call graph for this function:

ShaderData& Dali::Internal::ShaderData::operator= ( const ShaderData rhs)
private

no copying of this object

void Dali::Internal::ShaderData::SetHashValue ( size_t  shaderHash)
inline

Set hash value which is created with vertex and fragment shader code.

Parameters
[in]shaderHashhash key created with vertex and fragment shader code

Definition at line 74 of file shader-data.h.

References DALI_ASSERT_DEBUG, and mShaderHash.

Member Data Documentation

Dali::Vector<unsigned char> Dali::Internal::ShaderData::mBuffer
private

buffer containing compiled binary bytecode

Definition at line 170 of file shader-data.h.

Referenced by AllocateBuffer(), GetBuffer(), GetBufferData(), GetBufferSize(), and HasBinary().

std::string Dali::Internal::ShaderData::mFragmentShader
private

source code for fragment program

Definition at line 168 of file shader-data.h.

Referenced by GetFragmentShader().

Dali::Shader::ShaderHints Dali::Internal::ShaderData::mHints
private

take a hint

Definition at line 169 of file shader-data.h.

Referenced by GetHints().

size_t Dali::Internal::ShaderData::mShaderHash
private

hash key created with vertex and fragment shader code

Definition at line 166 of file shader-data.h.

Referenced by GetHashValue(), and SetHashValue().

std::string Dali::Internal::ShaderData::mVertexShader
private

source code for vertex program

Definition at line 167 of file shader-data.h.

Referenced by GetVertexShader().


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