#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.
*/
// 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>
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
{
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;
};