Added memory pool logging
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-instruction.cpp
index acde57b..f42041f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -125,6 +125,20 @@ void RenderInstruction::Reset(Camera*              camera,
   }
 }
 
+std::size_t RenderInstruction::GetCapacity()
+{
+  std::size_t                        capacity{0u};
+  RenderListContainer::Iterator      iter = mRenderLists.Begin();
+  RenderListContainer::ConstIterator end  = mRenderLists.End();
+  for(; iter != end; ++iter)
+  {
+    capacity += ((*iter)->GetCachedItemCount() * (sizeof(RenderItem) + sizeof(RenderItem*)));
+    capacity += sizeof(RenderList);
+  }
+  capacity += sizeof(RenderInstruction);
+  return capacity;
+}
+
 } // namespace SceneGraph
 
 } // namespace Internal