forked from organicmaps/organicmaps
added ability to specify which GlyphCache should be exactly debugged.
This commit is contained in:
parent
315f177e24
commit
e36a9b5ccf
4 changed files with 26 additions and 16 deletions
|
@ -98,7 +98,7 @@ TilingRenderPolicyMT::TilingRenderPolicyMT(VideoTimer * videoTimer,
|
|||
2 * 1024 * 1024,
|
||||
GetPlatform().CpuCores() + 2,
|
||||
GetPlatform().CpuCores(),
|
||||
false);
|
||||
0);
|
||||
|
||||
rmp.m_useSingleThreadedOGL = false;
|
||||
rmp.m_useVA = !yg::gl::g_isBufferObjectsSupported;
|
||||
|
|
|
@ -34,7 +34,8 @@ TilingRenderPolicyST::TilingRenderPolicyST(VideoTimer * videoTimer,
|
|||
bool useDefaultFB,
|
||||
yg::ResourceManager::Params const & rmParams,
|
||||
shared_ptr<yg::gl::RenderContext> const & primaryRC)
|
||||
: QueuedRenderPolicy(GetPlatform().CpuCores() + 1, primaryRC, false)
|
||||
: QueuedRenderPolicy(GetPlatform().CpuCores() + 1, primaryRC, false),
|
||||
m_drawScale(0)
|
||||
{
|
||||
yg::ResourceManager::Params rmp = rmParams;
|
||||
|
||||
|
@ -111,13 +112,21 @@ TilingRenderPolicyST::TilingRenderPolicyST(VideoTimer * videoTimer,
|
|||
1,
|
||||
"guiThreadTexture");
|
||||
|
||||
/* bool * debuggingFlags = new bool[GetPlatform().CpuCores() + 2];
|
||||
for (unsigned i = 0; i < GetPlatform().CpuCores() + 2; ++i)
|
||||
debuggingFlags[i] = false;
|
||||
|
||||
debuggingFlags[0] = true;*/
|
||||
|
||||
rmp.m_glyphCacheParams = yg::ResourceManager::GlyphCacheParams("unicode_blocks.txt",
|
||||
"fonts_whitelist.txt",
|
||||
"fonts_blacklist.txt",
|
||||
2 * 1024 * 1024,
|
||||
GetPlatform().CpuCores() + 2,
|
||||
GetPlatform().CpuCores(),
|
||||
false);
|
||||
0);
|
||||
|
||||
// delete [] debuggingFlags;
|
||||
|
||||
rmp.m_useSingleThreadedOGL = true;
|
||||
rmp.m_useVA = !yg::gl::g_isBufferObjectsSupported;
|
||||
|
@ -157,10 +166,6 @@ TilingRenderPolicyST::TilingRenderPolicyST(VideoTimer * videoTimer,
|
|||
|
||||
TilingRenderPolicyST::~TilingRenderPolicyST()
|
||||
{
|
||||
LOG(LINFO, ("cancelling pools"));
|
||||
|
||||
m_resourceManager->cancel();
|
||||
|
||||
LOG(LINFO, ("deleting TilingRenderPolicyST"));
|
||||
|
||||
base_t::CancelQueuedCommands(GetPlatform().CpuCores());
|
||||
|
@ -173,6 +178,7 @@ TilingRenderPolicyST::~TilingRenderPolicyST()
|
|||
|
||||
LOG(LINFO, ("reseting tileRenderer"));
|
||||
m_tileRenderer.reset();
|
||||
LOG(LINFO, ("done reseting tileRenderer"));
|
||||
}
|
||||
|
||||
void TilingRenderPolicyST::SetRenderFn(TRenderFn renderFn)
|
||||
|
|
|
@ -316,8 +316,7 @@ namespace yg
|
|||
ResourceManager::GlyphCacheParams::GlyphCacheParams()
|
||||
: m_glyphCacheMemoryLimit(0),
|
||||
m_glyphCacheCount(0),
|
||||
m_renderThreadCount(0),
|
||||
m_isDebugging(false)
|
||||
m_renderThreadCount(0)
|
||||
{}
|
||||
|
||||
ResourceManager::GlyphCacheParams::GlyphCacheParams(string const & unicodeBlockFile,
|
||||
|
@ -326,15 +325,20 @@ namespace yg
|
|||
size_t glyphCacheMemoryLimit,
|
||||
size_t glyphCacheCount,
|
||||
size_t renderThreadCount,
|
||||
bool isDebugging)
|
||||
bool * debuggingFlags)
|
||||
: m_unicodeBlockFile(unicodeBlockFile),
|
||||
m_whiteListFile(whiteListFile),
|
||||
m_blackListFile(blackListFile),
|
||||
m_glyphCacheMemoryLimit(glyphCacheMemoryLimit),
|
||||
m_glyphCacheCount(glyphCacheCount),
|
||||
m_renderThreadCount(renderThreadCount),
|
||||
m_isDebugging(isDebugging)
|
||||
{}
|
||||
m_renderThreadCount(renderThreadCount)
|
||||
{
|
||||
if (debuggingFlags)
|
||||
copy(debuggingFlags, debuggingFlags + glyphCacheCount, back_inserter(m_debuggingFlags));
|
||||
else
|
||||
for (unsigned i = 0; i < glyphCacheCount; ++i)
|
||||
m_debuggingFlags.push_back(false);
|
||||
}
|
||||
|
||||
ResourceManager::Params::Params()
|
||||
: m_rtFormat(yg::Data8Bpp),
|
||||
|
@ -487,7 +491,7 @@ namespace yg
|
|||
LOG(LDEBUG, ("allocating ", p.m_glyphCacheCount, " glyphCaches, ", p.m_glyphCacheMemoryLimit, " bytes total."));
|
||||
|
||||
for (size_t i = 0; i < p.m_glyphCacheCount; ++i)
|
||||
m_glyphCaches.push_back(GlyphCache(GlyphCache::Params(p.m_unicodeBlockFile, p.m_whiteListFile, p.m_blackListFile, p.m_glyphCacheMemoryLimit / p.m_glyphCacheCount, p.m_isDebugging)));
|
||||
m_glyphCaches.push_back(GlyphCache(GlyphCache::Params(p.m_unicodeBlockFile, p.m_whiteListFile, p.m_blackListFile, p.m_glyphCacheMemoryLimit / p.m_glyphCacheCount, p.m_debuggingFlags[i])));
|
||||
}
|
||||
else
|
||||
LOG(LERROR, ("no params to init glyph caches."));
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace yg
|
|||
size_t m_glyphCacheCount;
|
||||
size_t m_renderThreadCount;
|
||||
|
||||
bool m_isDebugging;
|
||||
vector<bool> m_debuggingFlags;
|
||||
|
||||
GlyphCacheParams();
|
||||
GlyphCacheParams(string const & unicodeBlockFile,
|
||||
|
@ -166,7 +166,7 @@ namespace yg
|
|||
size_t glyphCacheMemoryLimit,
|
||||
size_t glyphCacheCount,
|
||||
size_t renderThreadCount,
|
||||
bool isDebugging = false);
|
||||
bool * debuggingFlags = 0);
|
||||
};
|
||||
|
||||
struct Params
|
||||
|
|
Loading…
Add table
Reference in a new issue