Revert "[Tizen] Add screen and client rotation itself function"
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-instruction-container.cpp
index 94ca612..da899a9 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // CLASS HEADER
 #include <dali/internal/render/common/render-instruction-container.h>
@@ -41,10 +42,10 @@ RenderInstructionContainer::~RenderInstructionContainer()
   // 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 );
@@ -59,7 +60,7 @@ void RenderInstructionContainer::ResetAndReserve( BufferIndex bufferIndex, size_
   // 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)
@@ -72,13 +73,17 @@ RenderInstruction& RenderInstructionContainer::GetNextInstruction( BufferIndex b
   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