1 #ifndef DALI_INTERNAL_SCENE_GRAPH_RENDER_INSTRUCTION_CONTAINER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_RENDER_INSTRUCTION_CONTAINER_H
5 * Copyright (c) 2022 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/devel-api/common/owner-container.h>
23 #include <dali/internal/common/buffer-index.h>
24 #include <dali/public-api/common/vector-wrapper.h>
33 class RenderInstruction;
36 * Class to hold ordered list of current frame's render instructions.
37 * Does not own the instructions.
39 class RenderInstructionContainer
45 RenderInstructionContainer();
50 ~RenderInstructionContainer();
53 * Reset the container index and reserve space in the container if needed
54 * @param bufferIndex to reset
55 * @param capacityRequired in the container
57 void ResetAndReserve(BufferIndex bufferIndex, uint32_t capacityRequired);
60 * Return the count of instructions in the container
61 * @param bufferIndex to use
62 * @return the count of elements
64 uint32_t Count(BufferIndex bufferIndex);
67 * Get a reference to the instruction at index
68 * @param bufferIndex to use
71 RenderInstruction& At(BufferIndex bufferIndex, uint32_t index);
74 * Add an instruction to the end of the container
75 * @param bufferIndex to use
77 void PushBack(BufferIndex index, RenderInstruction* renderInstruction);
80 * Get the total memory used by all the render instructions
82 std::size_t GetCapacity() const;
85 std::vector<RenderInstruction*> mInstructions;
88 } // namespace SceneGraph
90 } // namespace Internal
94 #endif // DALI_INTERNAL_SCENE_GRAPH_RENDER_INSTRUCTION_CONTAINER_H