From 3c3c3ffd10f4b9997ab36bb37c604c541919eacf Mon Sep 17 00:00:00 2001 From: Roman Sorokin Date: Fri, 8 Aug 2014 15:07:42 +0300 Subject: [PATCH] added BatcherFactory and method Reset for using with Object Pool --- drape/batcher.cpp | 6 +++++- drape/batcher.hpp | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drape/batcher.cpp b/drape/batcher.cpp index 692f0a04ef..96c4dba15d 100644 --- a/drape/batcher.cpp +++ b/drape/batcher.cpp @@ -150,6 +150,10 @@ void Batcher::EndSession() m_flushInterface = flush_fn(); } +void Batcher::Reset() +{ +} + void Batcher::ChangeBuffer(RefPointer wrapper, bool checkFilledBuffer) { if (wrapper->IsVAOFilled() || checkFilledBuffer == false) @@ -223,4 +227,4 @@ void Batcher::InsertTriangles(GLState const & state, bucket->AddOverlayHandle(handle.Move()); } -} // namespace dp \ No newline at end of file +} // namespace dp diff --git a/drape/batcher.hpp b/drape/batcher.hpp index 01b11b5ad4..b2f2ec05d2 100644 --- a/drape/batcher.hpp +++ b/drape/batcher.hpp @@ -9,7 +9,6 @@ #include "../std/map.hpp" #include "../std/function.hpp" - namespace dp { @@ -43,6 +42,7 @@ public: typedef function )> flush_fn; void StartSession(flush_fn const & flusher); void EndSession(); + void Reset(); private: @@ -70,4 +70,10 @@ private: uint32_t m_vertexBufferSize; }; +class BatcherFactory +{ +public: + Batcher * GetNew() const { return new Batcher(); } +}; + } // namespace dp