Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrachytski <siarhei.rachytski@gmail.com>2011-11-14 19:56:57 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:27:53 +0300
commitc08a73a884df16632173d79e33126368362c50c5 (patch)
treec50b3286c6a30e652495dde445a50b29c5598164 /qt_tstfrm
parent376f7c874855b671050381ce624e55fbe215c720 (diff)
refactored ResourceManager to support better resource usage scaling for different instantiations of the same RenderPolicy.
Diffstat (limited to 'qt_tstfrm')
-rw-r--r--qt_tstfrm/tstwidgets.cpp61
1 files changed, 39 insertions, 22 deletions
diff --git a/qt_tstfrm/tstwidgets.cpp b/qt_tstfrm/tstwidgets.cpp
index 862acd984f..972a260fd2 100644
--- a/qt_tstfrm/tstwidgets.cpp
+++ b/qt_tstfrm/tstwidgets.cpp
@@ -42,28 +42,45 @@ void GLDrawWidget::initializeGL()
m_primaryContext = make_shared_ptr(new qt::gl::RenderContext(this));
- m_resourceManager = make_shared_ptr(new yg::ResourceManager(
- 30000 * sizeof(yg::gl::Vertex),
- 50000 * sizeof(unsigned short),
- 20,
- 3000 * sizeof(yg::gl::Vertex),
- 5000 * sizeof(unsigned short),
- 100,
- 10 * sizeof(yg::gl::AuxVertex),
- 10 * sizeof(unsigned short),
- 30,
- 512, 256, 10,
- 512, 256, 5,
- "unicode_blocks.txt",
- "fonts_whitelist.txt",
- "fonts_blacklist.txt",
- 2 * 1024 * 1024,
- GetPlatform().CpuCores() + 2,
- yg::Rt8Bpp,
- !yg::gl::g_isBufferObjectsSupported,
- false));
-
- m_resourceManager->initMultiBlitStorage(500 * sizeof(yg::gl::AuxVertex), 500 * sizeof(unsigned short), 10);
+ yg::ResourceManager::Params rmp;
+
+ rmp.m_videoMemoryLimit = 20 * 1024 * 1024;
+ rmp.m_primaryStoragesParams = yg::ResourceManager::StoragePoolParams(30000 * sizeof(yg::gl::Vertex),
+ 50000 * sizeof(unsigned short),
+ 20,
+ false);
+
+ rmp.m_smallStoragesParams = yg::ResourceManager::StoragePoolParams(3000 * sizeof(yg::gl::Vertex),
+ 5000 * sizeof(unsigned short),
+ 100,
+ false);
+
+ rmp.m_blitStoragesParams = yg::ResourceManager::StoragePoolParams(10 * sizeof(yg::gl::AuxVertex),
+ 10 * sizeof(unsigned short),
+ 30,
+ true);
+
+ rmp.m_multiBlitStoragesParams = yg::ResourceManager::StoragePoolParams(500 * sizeof(yg::gl::AuxVertex),
+ 500 * sizeof(unsigned short),
+ 10,
+ true);
+
+ rmp.m_primaryTexturesParams = yg::ResourceManager::TexturePoolParams(512, 256, 10, rmp.m_rtFormat, true);
+
+ rmp.m_fontTexturesParams = yg::ResourceManager::TexturePoolParams(512, 256, 5, rmp.m_rtFormat, true);
+
+ rmp.m_glyphCacheParams = yg::ResourceManager::GlyphCacheParams("unicode_blocks.txt",
+ "fonts_whitelist.txt",
+ "fonts_blacklist.txt",
+ 2 * 1024 * 1024,
+ 1,
+ 0);
+
+ rmp.m_isMergeable = false;
+ rmp.m_useVA = !yg::gl::g_isBufferObjectsSupported;
+ rmp.m_rtFormat = yg::Rt8Bpp;
+
+ m_resourceManager.reset(new yg::ResourceManager(rmp));
Platform::FilesList fonts;
GetPlatform().GetFontNames(fonts);