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:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2016-04-08 14:13:45 +0300
committerr.kuznetsov <r.kuznetsov@corp.mail.ru>2016-04-08 16:22:40 +0300
commitdff324286469b406e7a36c55a35b22db22ac3034 (patch)
treede730e6853ce9da2a2c4b194a8c738aa5bf99378 /drape/texture_manager.hpp
parentf116819e8df1ceba1fa25e018ffb0728cccea683 (diff)
Fixed packing glyphs
Diffstat (limited to 'drape/texture_manager.hpp')
-rw-r--r--drape/texture_manager.hpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/drape/texture_manager.hpp b/drape/texture_manager.hpp
index 5851087ce8..c8be6d6566 100644
--- a/drape/texture_manager.hpp
+++ b/drape/texture_manager.hpp
@@ -186,13 +186,23 @@ private:
void CalcGlyphRegions(TText const & text, TBuffer & buffers)
{
size_t const groupIndex = FindGlyphsGroup(text);
+ bool useHybridGroup = false;
if (groupIndex != GetInvalidGlyphGroup())
{
GlyphGroup & group = m_glyphGroups[groupIndex];
- FillResults<GlyphGroup>(text, buffers, group);
+ uint32_t const absentGlyphs = GetAbsentGlyphsCount(group.m_texture, text);
+ if (group.m_texture == nullptr || !group.m_texture->IsFull(absentGlyphs))
+ FillResults<GlyphGroup>(text, buffers, group);
+ else
+ useHybridGroup = true;
}
else
{
+ useHybridGroup = true;
+ }
+
+ if (useHybridGroup)
+ {
size_t const hybridGroupIndex = FindHybridGlyphsGroup(text);
ASSERT(hybridGroupIndex != GetInvalidGlyphGroup(), ());
HybridGlyphGroup & group = m_hybridGlyphGroups[hybridGroupIndex];
@@ -200,6 +210,9 @@ private:
}
}
+ uint32_t GetAbsentGlyphsCount(ref_ptr<Texture> texture, strings::UniString const & text);
+ uint32_t GetAbsentGlyphsCount(ref_ptr<Texture> texture, TMultilineText const & text);
+
template<typename TGlyphGroups>
void UpdateGlyphTextures(TGlyphGroups & groups)
{