Remove RenderSurface from Core
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-instruction-container.h
index 11e7451..cfc8aa7 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_RENDER_INSTRUCTION_CONTAINER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
  */
 
 // INTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/internal/common/buffer-index.h>
 
@@ -33,7 +34,8 @@ namespace SceneGraph
 class RenderInstruction;
 
 /**
- * Class to encapsulate double buffered render instruction data
+ * Class to hold ordered list of current frame's render instructions.
+ * Does not own the instructions.
  */
 class RenderInstructionContainer
 {
@@ -64,29 +66,27 @@ public:
   uint32_t Count( BufferIndex bufferIndex );
 
   /**
-   * Get a reference to the next instruction
+   * Get a reference to the instruction at index
    * @param bufferIndex to use
+   * @param index to use
    */
-  RenderInstruction& GetNextInstruction( BufferIndex bufferIndex );
+  RenderInstruction& At( BufferIndex bufferIndex, uint32_t index );
 
   /**
-   * Get a reference to the instruction at index
+   * Add an instruction to the end of the container
    * @param bufferIndex to use
-   * @param index to use
    */
-  RenderInstruction& At( BufferIndex bufferIndex, uint32_t index );
+  void PushBack( BufferIndex index, RenderInstruction* renderInstruction );
 
   /**
-   * Discard the current container index
-   * @param bufferIndex to reset
+   * Discard an instruction from the end of the container
+   * @param bufferIndex to use
    */
-  void DiscardCurrentInstruction( BufferIndex bufferIndex );
+  void DiscardCurrentInstruction( BufferIndex updateBufferIndex );
 
 private:
 
-  unsigned int mIndex[ 2 ]; ///< count of the elements that have been added
-  typedef OwnerContainer< RenderInstruction* > InstructionContainer;
-  InstructionContainer mInstructions[ 2 ]; /// Double buffered instruction lists
+  std::vector<RenderInstruction*> mInstructions;
 
 };