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

DiscardQueue is used to cleanup nodes & resources when no longer in use. More...

#include <discard-queue.h>

Collaboration diagram for Dali::Internal::SceneGraph::DiscardQueue:
Collaboration graph
[legend]

Public Types

typedef OwnerContainer< Shader * > ShaderQueue
 
typedef OwnerContainer
< Geometry * > 
GeometryQueue
 
typedef OwnerContainer
< Material * > 
MaterialQueue
 
typedef OwnerContainer
< Renderer * > 
RendererQueue
 

Public Member Functions

 DiscardQueue (RenderQueue &renderQueue)
 Create a new DiscardQueue. More...
 
 ~DiscardQueue ()
 Non-virtual destructor; DiscardQueue is not suitable as a base class. More...
 
void Add (BufferIndex updateBufferIndex, Node *node)
 Adds an unwanted Node and its children to the discard queue. More...
 
void Add (BufferIndex updateBufferIndex, Geometry *geometry)
 Adds an unwanted geometry to the discard queue. More...
 
void Add (BufferIndex updateBufferIndex, Material *material)
 Adds an unwanted material to the discard queue. More...
 
void Add (BufferIndex bufferIndex, Shader *shader)
 Adds an unwanted shader to the discard queue. More...
 
void Add (BufferIndex updateBufferIndex, Renderer *renderer)
 Adds an unwanted Renderer to the discard queue. More...
 
void Clear (BufferIndex updateBufferIndex)
 Release the nodes which were queued in the frame N-2. More...
 

Private Member Functions

 DiscardQueue (const DiscardQueue &)
 
DiscardQueueoperator= (const DiscardQueue &rhs)
 

Private Attributes

RenderQueuemRenderQueue
 Used to send GL clean-up messages for the next Render. More...
 
NodeOwnerContainer mNodeQueue0
 
ShaderQueue mShaderQueue0
 
GeometryQueue mGeometryQueue0
 
MaterialQueue mMaterialQueue0
 
RendererQueue mRendererQueue0
 
NodeOwnerContainer mNodeQueue1
 
ShaderQueue mShaderQueue1
 
GeometryQueue mGeometryQueue1
 
MaterialQueue mMaterialQueue1
 
RendererQueue mRendererQueue1
 

Detailed Description

DiscardQueue is used to cleanup nodes & resources when no longer in use.

Unwanted objects are added here during UpdateManager::Update(). When added, messages will be sent to clean-up GL resources in the next Render. The Update for frame N+1 may occur in parallel with the rendering of frame N. Therefore objects queued for destruction in frame N, are destroyed frame N+2.

Definition at line 53 of file discard-queue.h.

Member Typedef Documentation

Definition at line 58 of file discard-queue.h.

Definition at line 59 of file discard-queue.h.

Definition at line 60 of file discard-queue.h.

Definition at line 57 of file discard-queue.h.

Constructor & Destructor Documentation

Dali::Internal::SceneGraph::DiscardQueue::DiscardQueue ( RenderQueue renderQueue)

Create a new DiscardQueue.

Parameters
[in]renderQueueUsed to send GL clean-up messages for the next Render.

Definition at line 38 of file discard-queue.cpp.

Dali::Internal::SceneGraph::DiscardQueue::~DiscardQueue ( )

Non-virtual destructor; DiscardQueue is not suitable as a base class.

Definition at line 43 of file discard-queue.cpp.

Dali::Internal::SceneGraph::DiscardQueue::DiscardQueue ( const DiscardQueue )
private

Member Function Documentation

void Dali::Internal::SceneGraph::DiscardQueue::Add ( BufferIndex  updateBufferIndex,
Node node 
)

Adds an unwanted Node and its children to the discard queue.

If necessary, a message will be sent to clean-up GL resources in the next Render.

Precondition
This method is not thread-safe, and should only be called from the update-thread.
Parameters
[in]updateBufferIndexThe current update buffer index.
[in]nodeThe discarded node; DiscardQueue takes ownership.

Definition at line 47 of file discard-queue.cpp.

References DALI_ASSERT_DEBUG, mNodeQueue0, mNodeQueue1, and Dali::Vector< T, IsTrivialType >::PushBack().

Referenced by Dali::Internal::SceneGraph::UpdateManager::DestroyNode(), Dali::Internal::SceneGraph::ObjectOwnerContainer< Dali::Internal::SceneGraph::Renderer >::Remove(), and Dali::Internal::SceneGraph::UpdateManager::RemoveShader().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::DiscardQueue::Add ( BufferIndex  updateBufferIndex,
Geometry geometry 
)

Adds an unwanted geometry to the discard queue.

A message will be sent to clean up GL resources in the next Render

Definition at line 81 of file discard-queue.cpp.

References DALI_ASSERT_DEBUG, mGeometryQueue0, mGeometryQueue1, and Dali::Vector< T, IsTrivialType >::PushBack().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::DiscardQueue::Add ( BufferIndex  updateBufferIndex,
Material material 
)

Adds an unwanted material to the discard queue.

A message will be sent to clean up GL resources in the next Render.

Definition at line 98 of file discard-queue.cpp.

References DALI_ASSERT_DEBUG, mMaterialQueue0, mMaterialQueue1, and Dali::Vector< T, IsTrivialType >::PushBack().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::DiscardQueue::Add ( BufferIndex  bufferIndex,
Shader shader 
)

Adds an unwanted shader to the discard queue.

A message will be sent to clean-up GL resources in the next Render.

Precondition
This method is not thread-safe, and should only be called from the update-thread.
Parameters
[in]bufferIndexThe current update buffer index.
[in]shaderThe shader to queue; DiscardQueue takes ownership.

Definition at line 116 of file discard-queue.cpp.

References DALI_ASSERT_DEBUG, mShaderQueue0, mShaderQueue1, and Dali::Vector< T, IsTrivialType >::PushBack().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::DiscardQueue::Add ( BufferIndex  updateBufferIndex,
Renderer renderer 
)

Adds an unwanted Renderer to the discard queue.

A message will be sent to clean up GL resources in the next Render.

Parameters
[in]updateBufferIndexThe current update buffer index.
[in]rendererThe discarded renderer; DiscardQueue takes ownership.

Definition at line 64 of file discard-queue.cpp.

References DALI_ASSERT_DEBUG, mRendererQueue0, mRendererQueue1, and Dali::Vector< T, IsTrivialType >::PushBack().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::DiscardQueue::Clear ( BufferIndex  updateBufferIndex)

Release the nodes which were queued in the frame N-2.

Precondition
This method should be called (once) at the beginning of every Update.
Parameters
[in]updateBufferIndexThe current update buffer index.

Definition at line 135 of file discard-queue.cpp.

References Dali::OwnerContainer< T >::Clear(), mGeometryQueue0, mGeometryQueue1, mMaterialQueue0, mMaterialQueue1, mNodeQueue0, mNodeQueue1, mRendererQueue0, mRendererQueue1, mShaderQueue0, and mShaderQueue1.

Referenced by Dali::Internal::SceneGraph::UpdateManager::Update().

Here is the call graph for this function:

Here is the caller graph for this function:

DiscardQueue& Dali::Internal::SceneGraph::DiscardQueue::operator= ( const DiscardQueue rhs)
private

Member Data Documentation

GeometryQueue Dali::Internal::SceneGraph::DiscardQueue::mGeometryQueue0
private

Definition at line 133 of file discard-queue.h.

Referenced by Add(), and Clear().

GeometryQueue Dali::Internal::SceneGraph::DiscardQueue::mGeometryQueue1
private

Definition at line 140 of file discard-queue.h.

Referenced by Add(), and Clear().

MaterialQueue Dali::Internal::SceneGraph::DiscardQueue::mMaterialQueue0
private

Definition at line 134 of file discard-queue.h.

Referenced by Add(), and Clear().

MaterialQueue Dali::Internal::SceneGraph::DiscardQueue::mMaterialQueue1
private

Definition at line 141 of file discard-queue.h.

Referenced by Add(), and Clear().

NodeOwnerContainer Dali::Internal::SceneGraph::DiscardQueue::mNodeQueue0
private

Definition at line 131 of file discard-queue.h.

Referenced by Add(), and Clear().

NodeOwnerContainer Dali::Internal::SceneGraph::DiscardQueue::mNodeQueue1
private

Definition at line 138 of file discard-queue.h.

Referenced by Add(), and Clear().

RendererQueue Dali::Internal::SceneGraph::DiscardQueue::mRendererQueue0
private

Definition at line 135 of file discard-queue.h.

Referenced by Add(), and Clear().

RendererQueue Dali::Internal::SceneGraph::DiscardQueue::mRendererQueue1
private

Definition at line 142 of file discard-queue.h.

Referenced by Add(), and Clear().

RenderQueue& Dali::Internal::SceneGraph::DiscardQueue::mRenderQueue
private

Used to send GL clean-up messages for the next Render.

Definition at line 128 of file discard-queue.h.

ShaderQueue Dali::Internal::SceneGraph::DiscardQueue::mShaderQueue0
private

Definition at line 132 of file discard-queue.h.

Referenced by Add(), and Clear().

ShaderQueue Dali::Internal::SceneGraph::DiscardQueue::mShaderQueue1
private

Definition at line 139 of file discard-queue.h.

Referenced by Add(), and Clear().


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