1 #ifndef DALI_INTERNAL_SCENE_GRAPH_GEOMETRY_BATCHER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_GEOMETRY_BATCHER_H
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/internal/render/renderers/render-property-buffer.h>
23 #include <dali/internal/update/rendering/scene-graph-texture-set.h>
24 #include <dali/internal/render/common/render-list.h>
27 #include <dali/public-api/common/dali-vector.h>
29 /// Value used by a node to indicate the batch index as null or invalid
30 #define BATCH_NULL_HANDLE 0xFFFFFFFF
46 struct BatchStreamMarker;
49 class RenderInstructionContainer;
57 * The constructor of GeometryBatcher
62 * The destructor of GeometryBatcher
67 * Assigns the update manager object
68 * @param[in] updateManager Pointer to instance of update manager
70 void SetUpdateManager( UpdateManager* updateManager );
74 * @param[in] index Update buffer index
76 void Update( BufferIndex index );
79 * @brief Add node to batch parents list
80 * @param[in] node instance of a node to be added
82 void AddBatchParent( Node* node );
85 * @brief Remove node from list of batch parents
86 * @param[in] node valid instance of node to be removed
88 void RemoveBatchParent( Node* node );
91 * @brief Add batchable node
92 * @param[in] node valid instance of the node to be added
94 void AddNode( Node* node );
97 * @brief Remove batchable node
98 * @param[in] node valid instance of the node to be removed
100 void RemoveNode( Node* node );
103 * @brief Return the geometry object associated with specified batch index
104 * @param[in] batchIndex VALID index of the batch
105 * @return instance of the batched geometry
107 Render::Geometry* GetGeometry( uint32_t batchIndex );
110 * @brief Query if a batch at given index has been already rendered
111 * @param batchIndex VALID index of a batch to query
112 * @return true if batch has rendered, false otherwise
114 bool HasRendered( uint32_t batchIndex );
117 * @brief Sets a batch at given index as rendered
118 * @param batchIndex VALID index of a batch
120 void SetRendered( uint32_t batchIndex );
124 GeometryBatcher( const GeometryBatcher& ); ///< Undefined
125 GeometryBatcher& operator=( const GeometryBatcher& ); ///< Undefined
128 * @brief Clones vertex format of source geometry and stores generated data in the batchInfo object
129 * @param[in] sourceGeometry Geometry of the very first batched item
130 * @param[out] batchInfo Batch info object used to store cloned vertex format
131 * @return true on success, false otherwise
133 bool CloneVertexFormat( const Render::Geometry* sourceGeometry, struct VertexDescriptor& batchInfo );
137 struct Impl* mImpl; ///< Pointer to an instance of geometry batcher implementation
148 #endif //DALI_INTERNAL_SCENE_GRAPH_GEOMETRY_BATCHER_H