From c4fd7a348116e67ec16856f0ca364230caab1be2 Mon Sep 17 00:00:00 2001 From: Roman Sorokin Date: Mon, 11 Aug 2014 16:20:38 +0300 Subject: [PATCH] small fixes --- drape/batcher.cpp | 4 ---- drape/batcher.hpp | 1 - drape/drape_tests/drape_tests.pro | 1 - drape_frontend/batchers_pool.cpp | 21 +++++++++++---------- drape_frontend/batchers_pool.hpp | 1 - drape_frontend/read_mwm_task.hpp | 3 ++- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/drape/batcher.cpp b/drape/batcher.cpp index 96c4dba15d..4cb6f9db63 100644 --- a/drape/batcher.cpp +++ b/drape/batcher.cpp @@ -150,10 +150,6 @@ void Batcher::EndSession() m_flushInterface = flush_fn(); } -void Batcher::Reset() -{ -} - void Batcher::ChangeBuffer(RefPointer wrapper, bool checkFilledBuffer) { if (wrapper->IsVAOFilled() || checkFilledBuffer == false) diff --git a/drape/batcher.hpp b/drape/batcher.hpp index b2f2ec05d2..1ee8e0a4f7 100644 --- a/drape/batcher.hpp +++ b/drape/batcher.hpp @@ -42,7 +42,6 @@ public: typedef function )> flush_fn; void StartSession(flush_fn const & flusher); void EndSession(); - void Reset(); private: diff --git a/drape/drape_tests/drape_tests.pro b/drape/drape_tests/drape_tests.pro index 229aae9be7..5d5e0c8f02 100644 --- a/drape/drape_tests/drape_tests.pro +++ b/drape/drape_tests/drape_tests.pro @@ -39,7 +39,6 @@ SOURCES += \ pointers_tests.cpp \ font_texture_tests.cpp \ bingind_info_tests.cpp \ - object_pool_tests.cpp \ HEADERS += \ glmock_functions.hpp \ diff --git a/drape_frontend/batchers_pool.cpp b/drape_frontend/batchers_pool.cpp index c2c99f0045..157ba8da19 100644 --- a/drape_frontend/batchers_pool.cpp +++ b/drape_frontend/batchers_pool.cpp @@ -4,7 +4,6 @@ #include "../drape/batcher.hpp" #include "../base/assert.hpp" -#include "../base/logging.hpp" #include "../std/bind.hpp" @@ -29,11 +28,13 @@ void FlushGeometry(BatchersPool::TSendMessageFn const & sendMessage, BatchersPool::BatchersPool(int initBatcherCount, TSendMessageFn const & sendMessageFn) : m_sendMessageFn(sendMessageFn) - , m_factory() - , m_pool(initBatcherCount, m_factory) + , m_pool(initBatcherCount, dp::BatcherFactory()) {} -BatchersPool::~BatchersPool() {} +BatchersPool::~BatchersPool() +{ + ASSERT(m_batchs.empty(), ()); +} void BatchersPool::ReserveBatcher(TileKey const & key) { @@ -43,9 +44,9 @@ void BatchersPool::ReserveBatcher(TileKey const & key) it->second.second++; return; } - Batcher * B = m_pool.Get(); - m_batchs.insert(make_pair(key, make_pair(B, 1))); - B->StartSession(bind(&FlushGeometry, m_sendMessageFn, key, _1, _2)); + Batcher * batcher = m_pool.Get(); + m_batchs.insert(make_pair(key, make_pair(batcher, 1))); + batcher->StartSession(bind(&FlushGeometry, m_sendMessageFn, key, _1, _2)); } dp::RefPointer BatchersPool::GetTileBatcher(TileKey const & key) @@ -62,9 +63,9 @@ void BatchersPool::ReleaseBatcher(TileKey const & key) ASSERT_GREATER(it->second.second, 0, ()); if ((--it->second.second)== 0) { - Batcher * B = it->second.first; - B->EndSession(); - m_pool.Return(B); + Batcher * batcher = it->second.first; + batcher->EndSession(); + m_pool.Return(batcher); m_batchs.erase(it); } } diff --git a/drape_frontend/batchers_pool.hpp b/drape_frontend/batchers_pool.hpp index bbda69de3d..6ee7923b2a 100644 --- a/drape_frontend/batchers_pool.hpp +++ b/drape_frontend/batchers_pool.hpp @@ -33,7 +33,6 @@ private: typedef TBatcherMap::iterator TIterator; TSendMessageFn m_sendMessageFn; - dp::BatcherFactory m_factory; ObjectPool m_pool; TBatcherMap m_batchs; }; diff --git a/drape_frontend/read_mwm_task.hpp b/drape_frontend/read_mwm_task.hpp index ddedacc773..f80e258d5a 100644 --- a/drape_frontend/read_mwm_task.hpp +++ b/drape_frontend/read_mwm_task.hpp @@ -29,7 +29,7 @@ public: virtual void Do(); - void init(weak_ptr const & tileInfo); + void Init(weak_ptr const & tileInfo); void Reset(); private: @@ -40,6 +40,7 @@ private: #ifdef DEBUG dbg::ObjectTracker m_objTracker; + bool m_checker; #endif };