/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
// OwnerContainer deletes the instructions
}
-void RenderInstructionContainer::ResetAndReserve( BufferIndex bufferIndex, size_t capacityRequired )
+void RenderInstructionContainer::ResetAndReserve( BufferIndex bufferIndex, uint32_t capacityRequired )
{
mIndex[ bufferIndex ] = 0u;
- size_t oldcapacity = mInstructions[ bufferIndex ].Capacity();
+ uint32_t oldcapacity = static_cast<uint32_t>( mInstructions[ bufferIndex ].Capacity() ); // uint32_t is large enough in practice
if( oldcapacity < capacityRequired )
{
mInstructions[ bufferIndex ].Reserve( capacityRequired );
// RenderInstruction holds a lot of data so we keep them and recycle instead of new & delete
}
-size_t RenderInstructionContainer::Count( BufferIndex bufferIndex )
+uint32_t RenderInstructionContainer::Count( BufferIndex bufferIndex )
{
// mIndex contains the number of instructions that have been really prepared and updated
// (from UpdateManager through GetNextInstruction)
return At( bufferIndex, mIndex[ bufferIndex ]++ );
}
-RenderInstruction& RenderInstructionContainer::At( BufferIndex bufferIndex, size_t index )
+RenderInstruction& RenderInstructionContainer::At( BufferIndex bufferIndex, uint32_t index )
{
DALI_ASSERT_DEBUG( index < mInstructions[ bufferIndex ].Count() );
return *mInstructions[ bufferIndex ][ index ];
}
+void RenderInstructionContainer::DiscardCurrentInstruction( BufferIndex bufferIndex )
+{
+ mIndex[ bufferIndex ]--;
+}
} // namespace SceneGraph