1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_RENDER_QUEUE_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_RENDER_QUEUE_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali/internal/common/buffer-index.h>
22 #include <dali/internal/common/message-buffer.h>
36 * Allows messages to be queued for RenderManager, during the scene-graph Update.
43 * Create a new RenderQueue.
48 * Non-virtual destructor; RenderQueue is not suitable as a base class.
53 * Reserve space for another message in the queue; this must then be initialized by the caller.
54 * The message will be read from the next render-thread tick.
55 * @post Calling this method may invalidate any previously returned slots.
56 * @param[in] updateBufferIndex The current update buffer index.
57 * @param[in] size The message size with respect to the size of type "char".
58 * @return A pointer to the first char allocated for the message.
60 unsigned int* ReserveMessageSlot( BufferIndex updateBufferIndex, std::size_t size );
63 * Process the batch of messages, which were queued in the previous update.
64 * @pre This message should only be called by RenderManager from within the render-thread.
65 * @param[in] bufferIndex The previous update buffer index.
67 void ProcessMessages( BufferIndex bufferIndex );
72 * Helper to retrieve the current container.
73 * The update-thread queues messages with one container, whilst the render-thread is processing the other.
74 * @param[in] bufferIndex The current buffer index.
75 * @return The container.
77 MessageBuffer* GetCurrentContainer( BufferIndex bufferIndex );
80 * Helper to limit the buffer capacity i.e. after a frame when an extreme number of messages have been sent.
81 * @param[in] bufferIndex The current buffer index.
83 void LimitBufferCapacity( BufferIndex bufferIndex );
86 RenderQueue( const RenderQueue& );
89 RenderQueue& operator=( const RenderQueue& rhs );
93 MessageBuffer* container0; ///< Messages are queued here when the update buffer index == 0
94 MessageBuffer* container1; ///< Messages are queued here when the update buffer index == 1
97 } // namespace SceneGraph
99 } // namespace Internal
103 #endif // __DALI_INTERNAL_SCENE_GRAPH_RENDER_QUEUE_H__