Remove RenderSurface from Core
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-instruction-container.h
1 #ifndef DALI_INTERNAL_SCENE_GRAPH_RENDER_INSTRUCTION_CONTAINER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_RENDER_INSTRUCTION_CONTAINER_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/vector-wrapper.h>
23 #include <dali/devel-api/common/owner-container.h>
24 #include <dali/internal/common/buffer-index.h>
25
26 namespace Dali
27 {
28
29 namespace Internal
30 {
31
32 namespace SceneGraph
33 {
34 class RenderInstruction;
35
36 /**
37  * Class to hold ordered list of current frame's render instructions.
38  * Does not own the instructions.
39  */
40 class RenderInstructionContainer
41 {
42 public:
43
44   /**
45    * Constructor
46    */
47   RenderInstructionContainer();
48
49   /**
50    * Destructor
51    */
52   ~RenderInstructionContainer();
53
54   /**
55    * Reset the container index and reserve space in the container if needed
56    * @param bufferIndex to reset
57    * @param capacityRequired in the container
58    */
59   void ResetAndReserve( BufferIndex bufferIndex, uint32_t capacityRequired );
60
61   /**
62    * Return the count of instructions in the container
63    * @param bufferIndex to use
64    * @return the count of elements
65    */
66   uint32_t Count( BufferIndex bufferIndex );
67
68   /**
69    * Get a reference to the instruction at index
70    * @param bufferIndex to use
71    * @param index to use
72    */
73   RenderInstruction& At( BufferIndex bufferIndex, uint32_t index );
74
75   /**
76    * Add an instruction to the end of the container
77    * @param bufferIndex to use
78    */
79   void PushBack( BufferIndex index, RenderInstruction* renderInstruction );
80
81   /**
82    * Discard an instruction from the end of the container
83    * @param bufferIndex to use
84    */
85   void DiscardCurrentInstruction( BufferIndex updateBufferIndex );
86
87 private:
88
89   std::vector<RenderInstruction*> mInstructions;
90
91 };
92
93 } // namespace SceneGraph
94
95 } // namespace Internal
96
97 } // namespace Dali
98
99 #endif // DALI_INTERNAL_SCENE_GRAPH_RENDER_INSTRUCTION_CONTAINER_H