forked from organicmaps/organicmaps
moved log2vis into GlyphCache to make it multithreaded.
This commit is contained in:
parent
697fd7421e
commit
9f54811d31
4 changed files with 18 additions and 14 deletions
|
@ -4,6 +4,9 @@
|
|||
#include "internal/opengl.hpp"
|
||||
#include "ft2_debug.hpp"
|
||||
|
||||
#include "../3party/fribidi/lib/fribidi-deprecated.h"
|
||||
#include "../3party/fribidi/lib/fribidi.h"
|
||||
|
||||
#include "../coding/lodepng_io.hpp"
|
||||
|
||||
#include "../base/logging.hpp"
|
||||
|
@ -294,4 +297,15 @@ namespace yg
|
|||
return len;
|
||||
}
|
||||
|
||||
strings::UniString GlyphCache::log2vis(strings::UniString const & str)
|
||||
{
|
||||
// FriBidiEnv e;
|
||||
/* size_t const count = str.size();
|
||||
strings::UniString res(count);
|
||||
FriBidiParType dir = FRIBIDI_PAR_LTR; // requested base direction
|
||||
fribidi_log2vis(&str[0], count, &dir, &res[0], 0, 0, 0);
|
||||
return res;*/
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -93,5 +93,8 @@ namespace yg
|
|||
GlyphMetrics const getGlyphMetrics(GlyphKey const & key);
|
||||
|
||||
double getTextLength(double fontSize, string const & text);
|
||||
|
||||
strings::UniString log2vis(strings::UniString const & str);
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,21 +4,10 @@
|
|||
#include "overlay_renderer.hpp"
|
||||
#include "resource_style.hpp"
|
||||
|
||||
#include "../3party/fribidi/lib/fribidi-deprecated.h"
|
||||
|
||||
#include "../base/logging.hpp"
|
||||
|
||||
namespace yg
|
||||
{
|
||||
strings::UniString TextElement::log2vis(strings::UniString const & str)
|
||||
{
|
||||
size_t const count = str.size();
|
||||
strings::UniString res(count);
|
||||
FriBidiParType dir = FRIBIDI_PAR_LTR; // requested base direction
|
||||
fribidi_log2vis(&str[0], count, &dir, &res[0], 0, 0, 0);
|
||||
return res;
|
||||
}
|
||||
|
||||
TextElement::TextElement(Params const & p)
|
||||
: OverlayElement(p),
|
||||
m_fontDesc(p.m_fontDesc),
|
||||
|
@ -27,7 +16,7 @@ namespace yg
|
|||
m_glyphCache(p.m_glyphCache)
|
||||
{
|
||||
if (m_log2vis)
|
||||
m_visText = log2vis(m_logText);
|
||||
m_visText = m_glyphCache->log2vis(m_logText);
|
||||
else
|
||||
m_visText = m_logText;
|
||||
}
|
||||
|
|
|
@ -33,8 +33,6 @@ namespace yg
|
|||
bool m_log2vis;
|
||||
GlyphCache * m_glyphCache;
|
||||
|
||||
strings::UniString log2vis(strings::UniString const & str);
|
||||
|
||||
public:
|
||||
|
||||
struct Params : OverlayElement::Params
|
||||
|
|
Loading…
Add table
Reference in a new issue