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:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2019-11-06 16:24:09 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2019-11-06 17:32:01 +0300
commit0e4d9d6bdf2d8d7b8a7d8d9eb69d68ce30a9ed9e (patch)
treec6b25d0402dd0424861d6e3683602e6a0d4726ad
parent04817a3cd26962a1876d9ded0cbfa920c7146121 (diff)
[software_renderer] Fixed mapshot compilation and linking.
-rw-r--r--indexer/feature.hpp2
-rw-r--r--mapshot/CMakeLists.txt6
-rw-r--r--mapshot/mapshot.cpp12
-rw-r--r--software_renderer/cpu_drawer.hpp4
-rw-r--r--software_renderer/feature_processor.cpp11
-rw-r--r--software_renderer/feature_processor.hpp2
-rw-r--r--software_renderer/feature_styler.cpp41
-rw-r--r--software_renderer/feature_styler.hpp14
-rw-r--r--software_renderer/frame_image.hpp2
-rw-r--r--software_renderer/geometry_processors.cpp5
-rw-r--r--software_renderer/geometry_processors.hpp14
-rw-r--r--software_renderer/glyph_cache.cpp4
-rw-r--r--software_renderer/glyph_cache_impl.cpp6
-rw-r--r--software_renderer/pen_info.hpp6
-rw-r--r--software_renderer/proto_to_styles.cpp4
-rw-r--r--software_renderer/software_renderer.cpp64
-rw-r--r--software_renderer/software_renderer.hpp2
-rw-r--r--software_renderer/text_engine.cpp2
18 files changed, 110 insertions, 91 deletions
diff --git a/indexer/feature.hpp b/indexer/feature.hpp
index 19d80ce061..016cb684a3 100644
--- a/indexer/feature.hpp
+++ b/indexer/feature.hpp
@@ -124,7 +124,7 @@ public:
}
template <typename Functor>
- void ForEachTriangleEx(Functor && f, int scale) const
+ void ForEachTriangleEx(Functor && f, int scale)
{
f.StartPrimitive(m_triangles.size());
ForEachTriangle(std::forward<Functor>(f), scale);
diff --git a/mapshot/CMakeLists.txt b/mapshot/CMakeLists.txt
index 808f5cf9cf..cfe6d2c031 100644
--- a/mapshot/CMakeLists.txt
+++ b/mapshot/CMakeLists.txt
@@ -22,9 +22,12 @@ omim_link_libraries(
routing
search
storage
+ metrics
tracking
traffic
routing_common
+ transit
+ descriptions
ugc
drape
partners_api
@@ -33,6 +36,8 @@ omim_link_libraries(
kml
indexer
platform
+ mwm_diff
+ bsdiff
editor
geometry
coding
@@ -44,7 +49,6 @@ omim_link_libraries(
agg
jansson
protobuf
- osrm
stats_client
minizip
succinct
diff --git a/mapshot/mapshot.cpp b/mapshot/mapshot.cpp
index 4be2d5abd5..4e8d5894f0 100644
--- a/mapshot/mapshot.cpp
+++ b/mapshot/mapshot.cpp
@@ -27,6 +27,9 @@ DEFINE_string(datapath, "", "Path to data directory");
DEFINE_string(mwmpath, "", "Path to mwm files");
DEFINE_int32(width, 480, "Resulting image width");
DEFINE_int32(height, 640, "Resulting image height");
+DEFINE_double(vs, 2.0, "Visual scale (mdpi = 1.0, hdpi = 1.5, xhdpiScale = 2.0, "
+ "6plus = 2.4, xxhdpi = 3.0, xxxhdpi = 3.5)");
+
//----------------------------------------------------------------------------------------
using namespace std;
@@ -81,6 +84,7 @@ void InitFrameRenderer(float visualScale)
if (cpuDrawer == nullptr)
{
+ df::VisualParams::Init(visualScale, 1024 /* dummy tile size */);
string resPostfix = df::VisualParams::GetResourcePostfix(visualScale);
cpuDrawer = make_unique_dp<CPUDrawer>(CPUDrawer::Params(resPostfix, visualScale));
}
@@ -131,7 +135,8 @@ void DrawFrame(Framework & framework,
int const upperScale = scales::GetUpperScale();
- framework.GetIndex().ForEachInRect([&doDraw](FeatureType & ft) { doDraw(ft); }, selectRect, min(upperScale, drawScale));
+ framework.GetDataSource().ForEachInRect([&doDraw](FeatureType & ft) { doDraw(ft); },
+ selectRect, min(upperScale, drawScale));
cpuDrawer->Flush();
//cpuDrawer->DrawMyPosition(screen.GtoP(center));
@@ -198,10 +203,7 @@ int main(int argc, char * argv[])
cout << "Rendering " << place << " into " << filename << " is finished." << endl;
};
- // This magic constant was determined in several attempts.
- // It is a scale level, basically, dpi factor. 1 means 90 or 96, it seems,
- // and with 1.1 the map looks subjectively better.
- InitFrameRenderer(1.1 /* visualScale */);
+ InitFrameRenderer(FLAGS_vs);
if (!FLAGS_place.empty())
processPlace(FLAGS_place);
diff --git a/software_renderer/cpu_drawer.hpp b/software_renderer/cpu_drawer.hpp
index 2942915886..f3ae97d44d 100644
--- a/software_renderer/cpu_drawer.hpp
+++ b/software_renderer/cpu_drawer.hpp
@@ -9,6 +9,8 @@
#include "geometry/screenbase.hpp"
+#include "base/assert.hpp"
+
#include <cstdint>
#include <functional>
#include <list>
@@ -212,7 +214,7 @@ private:
std::map<FeatureID, FeatureStyler> m_stylers;
std::map<FeatureID, AreaInfo> m_areasGeometry;
std::map<FeatureID, PathInfo> m_pathGeometry;
- std::map<FeatureID, string> m_roadNames;
+ std::map<FeatureID, std::string> m_roadNames;
dp::FontDecl m_roadNumberFont;
double m_visualScale;
diff --git a/software_renderer/feature_processor.cpp b/software_renderer/feature_processor.cpp
index 1b48a7a573..1f16468d37 100644
--- a/software_renderer/feature_processor.cpp
+++ b/software_renderer/feature_processor.cpp
@@ -4,9 +4,12 @@
#include "software_renderer/feature_styler.hpp"
#include "software_renderer/cpu_drawer.hpp"
+#include "indexer/feature.hpp"
#include "indexer/feature_impl.hpp"
#include "indexer/feature_algo.hpp"
+#include "base/assert.hpp"
+
namespace software_renderer
{
namespace
@@ -43,7 +46,7 @@ FeatureProcessor::FeatureProcessor(ref_ptr<CPUDrawer> drawer,
// ASSERT_GREATER(m_zoom, scales::GetUpperWorldScale(), ());
}
-bool FeatureProcessor::operator()(FeatureType const & f)
+bool FeatureProcessor::operator()(FeatureType & f)
{
FeatureData data;
data.m_id = f.GetID();
@@ -63,7 +66,7 @@ bool FeatureProcessor::operator()(FeatureType const & f)
switch (data.m_styler.m_geometryType)
{
- case feature::GEOM_POINT:
+ case feature::GeomType::Point:
{
typedef one_point functor_t;
@@ -82,7 +85,7 @@ bool FeatureProcessor::operator()(FeatureType const & f)
break;
}
- case feature::GEOM_AREA:
+ case feature::GeomType::Area:
{
typedef filter_screenpts_adapter<area_tess_points> functor_t;
@@ -107,7 +110,7 @@ bool FeatureProcessor::operator()(FeatureType const & f)
break;
}
- case feature::GEOM_LINE:
+ case feature::GeomType::Line:
{
if (data.m_styler.m_hasPathText)
{
diff --git a/software_renderer/feature_processor.hpp b/software_renderer/feature_processor.hpp
index 5a963e03be..1068ad7343 100644
--- a/software_renderer/feature_processor.hpp
+++ b/software_renderer/feature_processor.hpp
@@ -42,7 +42,7 @@ public:
ScreenBase const & convertor,
int zoomLevel);
- bool operator()(FeatureType const & f);
+ bool operator()(FeatureType & f);
private:
ref_ptr<CPUDrawer> m_drawer;
diff --git a/software_renderer/feature_styler.cpp b/software_renderer/feature_styler.cpp
index 174b1ddde6..4f570392b8 100644
--- a/software_renderer/feature_styler.cpp
+++ b/software_renderer/feature_styler.cpp
@@ -6,6 +6,7 @@
#include "indexer/drawing_rules.hpp"
#include "indexer/feature.hpp"
+#include "indexer/feature_data.hpp"
#include "indexer/feature_visibility.hpp"
#include "indexer/ftypes_matcher.hpp"
#include "indexer/scales.hpp"
@@ -16,6 +17,7 @@
#include "base/logging.hpp"
#include "base/stl_helpers.hpp"
+#include <algorithm>
#include <string>
#include <utility>
@@ -50,7 +52,7 @@ void DrawRule::SetID(size_t threadSlot, uint32_t id) const
m_rule->SetID(threadSlot, id);
}
-FeatureStyler::FeatureStyler(FeatureType const & f,
+FeatureStyler::FeatureStyler(FeatureType & f,
int const zoom,
double const visualScale,
GlyphCache * glyphCache,
@@ -63,7 +65,7 @@ FeatureStyler::FeatureStyler(FeatureType const & f,
m_rect(rect)
{
drule::KeysT keys;
- std::pair<int, bool> type = feature::GetDrawRule(f, zoom, keys);
+ std::pair<int, bool> type = feature::GetDrawRule(feature::TypesHolder(f), zoom, keys);
// don't try to do anything to invisible feature
if (keys.empty())
@@ -72,7 +74,7 @@ FeatureStyler::FeatureStyler(FeatureType const & f,
m_hasLineStyles = false;
m_hasPointStyles = false;
- m_geometryType = type.first;
+ m_geometryType = feature::GeomType(type.first);
m_isCoastline = type.second;
f.GetPreferredNames(m_primaryText, m_secondaryText);
@@ -109,11 +111,11 @@ FeatureStyler::FeatureStyler(FeatureType const & f,
else
{
double const upperBound = 3.0E6;
- m_popRank = min(upperBound, population) / upperBound / 4;
+ m_popRank = std::min(upperBound, population) / upperBound / 4;
}
double area = 0.0;
- if (m_geometryType != feature::GEOM_POINT)
+ if (m_geometryType != feature::GeomType::Point)
{
m2::RectD const bbox = f.GetLimitRect(zoom);
area = bbox.SizeX() * bbox.SizeY();
@@ -123,7 +125,7 @@ FeatureStyler::FeatureStyler(FeatureType const & f,
if (area != 0)
{
// making area larger so it's not lost on double conversions
- priorityModifier = min(1.0, area * 10000.0);
+ priorityModifier = std::min(1.0, area * 10000.0);
}
else
{
@@ -179,7 +181,7 @@ FeatureStyler::FeatureStyler(FeatureType const & f,
// show labels of larger objects first
depth += priorityModifier;
// show labels of nodes first
- if (m_geometryType == feature::GEOM_POINT)
+ if (m_geometryType == feature::GeomType::Point)
++depth;
}
else if (keys[i].m_type == drule::area)
@@ -199,12 +201,12 @@ FeatureStyler::FeatureStyler(FeatureType const & f,
CaptionDefProto const * pCap0 = m_rules[i].m_rule->GetCaption(0);
if (pCap0)
{
- if (!m_hasPathText && hasName && (m_geometryType == feature::GEOM_LINE))
+ if (!m_hasPathText && hasName && (m_geometryType == feature::GeomType::Line))
{
m_hasPathText = true;
if (!FilterTextSize(m_rules[i].m_rule))
- m_fontSize = max(m_fontSize, GetTextFontSize(m_rules[i].m_rule));
+ m_fontSize = std::max(m_fontSize, GetTextFontSize(m_rules[i].m_rule));
}
if (keys[i].m_type == drule::caption)
@@ -213,7 +215,7 @@ FeatureStyler::FeatureStyler(FeatureType const & f,
}
// User's language name is better if we don't have secondary text draw rule.
- if (!hasSecondaryText && !m_secondaryText.empty() && (m_geometryType != feature::GEOM_LINE))
+ if (!hasSecondaryText && !m_secondaryText.empty() && (m_geometryType != feature::GeomType::Line))
{
f.GetReadableName(m_primaryText);
if (m_primaryText == m_secondaryText)
@@ -223,7 +225,7 @@ FeatureStyler::FeatureStyler(FeatureType const & f,
// Get or concat house number if feature has one.
if (!houseNumber.empty())
{
- if (m_primaryText.empty() || houseNumber.find(m_primaryText) != string::npos)
+ if (m_primaryText.empty() || houseNumber.find(m_primaryText) != std::string::npos)
houseNumber.swap(m_primaryText);
else
m_primaryText = m_primaryText + " (" + houseNumber + ")";
@@ -263,12 +265,12 @@ FeatureStyler::FeatureStyler(FeatureType const & f,
}
}
- sort(m_rules.begin(), m_rules.end(), less_depth());
+ std::sort(m_rules.begin(), m_rules.end(), less_depth());
}
typedef std::pair<double, double> RangeT;
template <class IterT> class RangeIterT :
- public boost::iterator_facade<RangeIterT<IterT>, RangeT, forward_traversal_tag, RangeT>
+public boost::iterator_facade<RangeIterT<IterT>, RangeT, boost::forward_traversal_tag, RangeT>
{
IterT m_iter;
public:
@@ -307,7 +309,7 @@ void FeatureStyler::LayoutTexts(double pathLength)
{
double const textLength = m_glyphCache->getTextLength(m_fontSize, GetPathName());
/// @todo Choose best constant for minimal space.
- double const emptySize = max(200 * m_visualScale, textLength);
+ double const emptySize = std::max(200 * m_visualScale, textLength);
// multiply on factor because tiles will be rendered in smaller scales
double const minPeriodSize = 1.5 * (emptySize + textLength);
@@ -332,7 +334,7 @@ void FeatureStyler::LayoutTexts(double pathLength)
if (deadZoneStart > m_intervals.back())
break;
- deadZones.push_back(make_pair(deadZoneStart, deadZoneEnd));
+ deadZones.push_back(std::make_pair(deadZoneStart, deadZoneEnd));
}
if (!deadZones.empty())
@@ -341,9 +343,10 @@ void FeatureStyler::LayoutTexts(double pathLength)
// accumulate text layout intervals with cliping intervals
typedef RangeIterT<ClipIntervalsT::iterator> IterT;
- AccumulateIntervals1With2(IterT(m_intervals.begin()), IterT(m_intervals.end()),
- deadZones.begin(), deadZones.end(),
- RangeInserter<ClipIntervalsT>(res));
+ base::AccumulateIntervals1With2(IterT(m_intervals.begin()),
+ IterT(m_intervals.end()),
+ deadZones.begin(), deadZones.end(),
+ RangeInserter<ClipIntervalsT>(res));
m_intervals = res;
ASSERT_EQUAL(m_intervals.size() % 2, 0, ());
@@ -377,7 +380,7 @@ void FeatureStyler::LayoutTexts(double pathLength)
}
}
-string const FeatureStyler::GetPathName() const
+std::string const FeatureStyler::GetPathName() const
{
// Always concat names for linear features because we process only one draw rule now.
if (m_secondaryText.empty())
diff --git a/software_renderer/feature_styler.hpp b/software_renderer/feature_styler.hpp
index 385afd436a..1ab93b080c 100644
--- a/software_renderer/feature_styler.hpp
+++ b/software_renderer/feature_styler.hpp
@@ -1,11 +1,13 @@
#pragma once
#include "indexer/drawing_rules.hpp"
+#include "indexer/feature_decl.hpp"
#include "geometry/rect2d.hpp"
#include <cstddef>
#include <cstdint>
+#include <string>
class FeatureType;
class ScreenBase;
@@ -32,7 +34,7 @@ struct DrawRule
struct FeatureStyler
{
FeatureStyler() = default;
- FeatureStyler(FeatureType const & f,
+ FeatureStyler(FeatureType & f,
int const zoom,
double const visualScale,
GlyphCache * glyphCache,
@@ -46,13 +48,13 @@ struct FeatureStyler
bool m_hasLineStyles;
bool m_hasPointStyles;
bool m_hasPathText;
- int m_geometryType;
+ feature::GeomType m_geometryType;
double m_visualScale;
- string m_primaryText;
- string m_secondaryText;
- string m_refText;
+ std::string m_primaryText;
+ std::string m_secondaryText;
+ std::string m_refText;
typedef buffer_vector<double, 16> ClipIntervalsT;
ClipIntervalsT m_intervals;
@@ -70,7 +72,7 @@ struct FeatureStyler
bool IsEmpty() const;
- string const GetPathName() const;
+ std::string const GetPathName() const;
bool FilterTextSize(drule::BaseRule const * pRule) const;
diff --git a/software_renderer/frame_image.hpp b/software_renderer/frame_image.hpp
index cd6a197706..dfe9231868 100644
--- a/software_renderer/frame_image.hpp
+++ b/software_renderer/frame_image.hpp
@@ -19,7 +19,7 @@ struct FrameImage
// image data.
// TopLeft-to-RightBottom order
// Format - png
- vector<uint8_t> m_data;
+ std::vector<uint8_t> m_data;
uint32_t m_width = 0; // pixel width of image
uint32_t m_height = 0; // pixel height of image
uint32_t m_stride = 0; // row stride in bytes
diff --git a/software_renderer/geometry_processors.cpp b/software_renderer/geometry_processors.cpp
index 895e2edaf3..82985fd999 100644
--- a/software_renderer/geometry_processors.cpp
+++ b/software_renderer/geometry_processors.cpp
@@ -1,11 +1,14 @@
#include "software_renderer/geometry_processors.hpp"
+#include "base/assert.hpp"
+#include "base/math.hpp"
+
#include <functional>
namespace software_renderer
{
base_screen::base_screen(params const & p)
- : base(p)
+ : base_policy(p)
{
m_convertor->GtoP(*p.m_rect, m_rect);
}
diff --git a/software_renderer/geometry_processors.hpp b/software_renderer/geometry_processors.hpp
index fc17f5b819..1bfec1f307 100644
--- a/software_renderer/geometry_processors.hpp
+++ b/software_renderer/geometry_processors.hpp
@@ -25,7 +25,7 @@ namespace software_renderer
/// - convert_point - convert point to screen coordinates;\n
/// - m_rect - clip rect;\n
-struct base
+struct base_policy
{
struct params
{
@@ -34,7 +34,7 @@ struct base
{}
};
- explicit base(params const & p)
+ explicit base_policy(params const & p)
: m_convertor(p.m_convertor)
{
}
@@ -48,7 +48,7 @@ struct base
};
/// in global coordinates
-struct base_global : public base
+struct base_global : public base_policy
{
m2::RectD const * m_rect;
@@ -57,24 +57,24 @@ struct base_global : public base
return g2p(pt);
}
- struct params : base::params
+ struct params : base_policy::params
{
m2::RectD const * m_rect;
params() : m_rect(0){}
};
explicit base_global(params const & p)
- : base(p), m_rect(p.m_rect)
+ : base_policy(p), m_rect(p.m_rect)
{
}
};
/// in screen coordinates
-struct base_screen : public base
+struct base_screen : public base_policy
{
m2::RectD m_rect;
- struct params : base::params
+ struct params : base_policy::params
{
m2::RectD const * m_rect;
params() : m_rect(0)
diff --git a/software_renderer/glyph_cache.cpp b/software_renderer/glyph_cache.cpp
index dea432516c..f857bd418b 100644
--- a/software_renderer/glyph_cache.cpp
+++ b/software_renderer/glyph_cache.cpp
@@ -66,7 +66,7 @@ void GlyphCache::addFonts(std::vector<std::string> const & fontNames)
m_impl->addFonts(fontNames);
}
-pair<Font*, int> GlyphCache::getCharIDX(GlyphKey const & key)
+std::pair<Font*, int> GlyphCache::getCharIDX(GlyphKey const & key)
{
return m_impl->getCharIDX(key);
}
@@ -76,7 +76,7 @@ GlyphMetrics const GlyphCache::getGlyphMetrics(GlyphKey const & key)
return m_impl->getGlyphMetrics(key);
}
-shared_ptr<GlyphBitmap> const GlyphCache::getGlyphBitmap(GlyphKey const & key)
+std::shared_ptr<GlyphBitmap> const GlyphCache::getGlyphBitmap(GlyphKey const & key)
{
return m_impl->getGlyphBitmap(key);
}
diff --git a/software_renderer/glyph_cache_impl.cpp b/software_renderer/glyph_cache_impl.cpp
index e08bbfad62..10a98f3e31 100644
--- a/software_renderer/glyph_cache_impl.cpp
+++ b/software_renderer/glyph_cache_impl.cpp
@@ -412,7 +412,7 @@ GlyphCacheImpl::~GlyphCacheImpl()
}
}
-int GlyphCacheImpl::getCharIDX(shared_ptr<Font> const & font, strings::UniChar symbolCode)
+int GlyphCacheImpl::getCharIDX(std::shared_ptr<Font> const & font, strings::UniChar symbolCode)
{
if (m_isDebugging)
return 0;
@@ -471,7 +471,7 @@ std::pair<Font*, int> const GlyphCacheImpl::getCharIDX(GlyphKey const & key)
GlyphMetrics const GlyphCacheImpl::getGlyphMetrics(GlyphKey const & key)
{
- pair<Font*, int> charIDX = getCharIDX(key);
+ std::pair<Font*, int> charIDX = getCharIDX(key);
FTC_ScalerRec fontScaler =
{
@@ -582,7 +582,7 @@ std::shared_ptr<GlyphBitmap> const GlyphCacheImpl::getGlyphBitmap(GlyphKey const
FTC_Node_Unref(node, m_manager);
- return shared_ptr<GlyphBitmap>(bitmap);
+ return std::shared_ptr<GlyphBitmap>(bitmap);
}
FT_Error GlyphCacheImpl::RequestFace(FTC_FaceID faceID, FT_Library library, FT_Pointer /*requestData*/, FT_Face * face)
diff --git a/software_renderer/pen_info.hpp b/software_renderer/pen_info.hpp
index c165e28fd5..ab669399c5 100644
--- a/software_renderer/pen_info.hpp
+++ b/software_renderer/pen_info.hpp
@@ -59,10 +59,10 @@ struct PenInfo
else
{
// hack for Samsung GT-S5570 (GPU floor()'s texture pattern width)
- m_w = max(m_w, 1.0);
+ m_w = std::max(m_w, 1.0);
buffer_vector<double, 4> tmpV;
- std::copy(pattern, pattern + patternSize, back_inserter(tmpV));
+ std::copy(pattern, pattern + patternSize, std::back_inserter(tmpV));
if (tmpV.size() % 2)
tmpV.push_back(0);
@@ -110,7 +110,7 @@ struct PenInfo
curLen += tmpV[i++];
}
- int periods = max(int((256 - 4) / length), 1);
+ int periods = std::max(int((256 - 4) / length), 1);
m_pat.reserve(periods * vec.size());
for (int i = 0; i < periods; ++i)
std::copy(vec.begin(), vec.end(), std::back_inserter(m_pat));
diff --git a/software_renderer/proto_to_styles.cpp b/software_renderer/proto_to_styles.cpp
index ec4fa7353f..05a981ff90 100644
--- a/software_renderer/proto_to_styles.cpp
+++ b/software_renderer/proto_to_styles.cpp
@@ -97,7 +97,7 @@ void ConvertStyle(SymbolRuleProto const * pSrc, IconInfo & dest)
void ConvertStyle(CaptionDefProto const * pSrc, double scale, dp::FontDecl & dest, m2::PointD & offset)
{
// fonts smaller than 8px look "jumpy" on LDPI devices
- uint8_t const h = max(8, static_cast<int>(pSrc->height() * scale));
+ uint8_t const h = std::max(8, static_cast<int>(pSrc->height() * scale));
offset = m2::PointD(0, 0);
if (pSrc->offset_x() != 0)
@@ -114,7 +114,7 @@ void ConvertStyle(CaptionDefProto const * pSrc, double scale, dp::FontDecl & des
void ConvertStyle(ShieldRuleProto const * pSrc, double scale, dp::FontDecl & dest)
{
// fonts smaller than 8px look "jumpy" on LDPI devices
- uint8_t const h = max(8, static_cast<int>(pSrc->height() * scale));
+ uint8_t const h = std::max(8, static_cast<int>(pSrc->height() * scale));
dest = dp::FontDecl(ConvertColor(pSrc->color()), h);
diff --git a/software_renderer/software_renderer.cpp b/software_renderer/software_renderer.cpp
index 6563f6c98a..cd40b86386 100644
--- a/software_renderer/software_renderer.cpp
+++ b/software_renderer/software_renderer.cpp
@@ -349,13 +349,13 @@ void SoftwareRenderer::DrawText(m2::PointD const & pt, dp::Anchor anchor, dp::Fo
l.apply_font(face);
ml::rect_d bounds = l.calc_bounds(face);
- vector<ml::point_d> base;
- base.push_back(ml::point_d(pt.x - bounds.width() / 2, pt.y));
- base.push_back(ml::point_d(pt.x + bounds.width() / 2, pt.y));
+ vector<ml::point_d> basePoints;
+ basePoints.push_back(ml::point_d(pt.x - bounds.width() / 2, pt.y));
+ basePoints.push_back(ml::point_d(pt.x + bounds.width() / 2, pt.y));
ml::text_options opt(face);
AlignText(opt, anchor);
- l.warp(base, opt);
+ l.warp(basePoints, opt);
agg_symbol_renderer ren(m_baseRenderer, primFont.m_color, primFont.m_outlineColor);
if (HasOutline(primFont))
@@ -377,13 +377,13 @@ void SoftwareRenderer::DrawText(m2::PointD const & pt, dp::Anchor anchor,
prim.apply_font(primFace);
ml::rect_d bounds = prim.calc_bounds(primFace);
- vector<ml::point_d> base;
- base.push_back(ml::point_d(pt.x - bounds.width() / 2, pt.y));
- base.push_back(ml::point_d(pt.x + bounds.width() / 2, pt.y));
+ vector<ml::point_d> basePoints;
+ basePoints.push_back(ml::point_d(pt.x - bounds.width() / 2, pt.y));
+ basePoints.push_back(ml::point_d(pt.x + bounds.width() / 2, pt.y));
ml::text_options opt(primFace);
AlignText(opt, anchor);
- prim.warp(base, opt);
+ prim.warp(basePoints, opt);
bounds = prim.calc_bounds(primFace);
agg_symbol_renderer ren(m_baseRenderer, primFont.m_color, primFont.m_outlineColor);
@@ -399,15 +399,15 @@ void SoftwareRenderer::DrawText(m2::PointD const & pt, dp::Anchor anchor,
ml::face & secFace = m_textEngine.get_face(0, "default", secFont.m_size);
sec.apply_font(secFace);
- base.clear();
+ basePoints.clear();
ml::rect_d boundsSec = sec.calc_bounds(secFace);
double currX = (bounds.min.x + bounds.max.x) / 2;
- base.push_back(ml::point_d(currX - boundsSec.width() / 2, bounds.max.y + boundsSec.height() / 2));
- base.push_back(ml::point_d(currX + boundsSec.width() / 2, bounds.max.y + boundsSec.height() / 2));
+ basePoints.push_back(ml::point_d(currX - boundsSec.width() / 2, bounds.max.y + boundsSec.height() / 2));
+ basePoints.push_back(ml::point_d(currX + boundsSec.width() / 2, bounds.max.y + boundsSec.height() / 2));
ml::text_options secOpt(secFace);
AlignText(secOpt, dp::Center);
- sec.warp(base, secOpt);
+ sec.warp(basePoints, secOpt);
agg_symbol_renderer ren2(m_baseRenderer, secFont.m_color, secFont.m_outlineColor);
if (HasOutline(secFont))
@@ -451,13 +451,13 @@ void SoftwareRenderer::CalculateTextMetric(m2::PointD const & pt, dp::Anchor anc
l.apply_font(face);
ml::rect_d bounds = l.calc_bounds(face);
- vector<ml::point_d> base;
- base.push_back(ml::point_d(pt.x - bounds.width() / 2, pt.y));
- base.push_back(ml::point_d(pt.x + bounds.width() / 2, pt.y));
+ vector<ml::point_d> basePoints;
+ basePoints.push_back(ml::point_d(pt.x - bounds.width() / 2, pt.y));
+ basePoints.push_back(ml::point_d(pt.x + bounds.width() / 2, pt.y));
ml::text_options opt(face);
AlignText(opt, anchor);
- l.warp(base, opt);
+ l.warp(basePoints, opt);
bounds = l.calc_bounds(face);
result = m2::RectD(bounds.min.x, bounds.min.y, bounds.max.x, bounds.max.y);
}
@@ -473,28 +473,28 @@ void SoftwareRenderer::CalculateTextMetric(m2::PointD const & pt, dp::Anchor anc
prim.apply_font(primFace);
ml::rect_d bounds = prim.calc_bounds(primFace);
- vector<ml::point_d> base;
- base.push_back(ml::point_d(pt.x - bounds.width() / 2, pt.y));
- base.push_back(ml::point_d(pt.x + bounds.width() / 2, pt.y));
+ vector<ml::point_d> basePoints;
+ basePoints.push_back(ml::point_d(pt.x - bounds.width() / 2, pt.y));
+ basePoints.push_back(ml::point_d(pt.x + bounds.width() / 2, pt.y));
ml::text_options opt(primFace);
AlignText(opt, anchor);
- prim.warp(base, opt);
+ prim.warp(basePoints, opt);
bounds = prim.calc_bounds(primFace);
ml::text sec(primText);
ml::face & secFace = m_textEngine.get_face(0, "default", secFont.m_size);
sec.apply_font(secFace);
- base.clear();
+ basePoints.clear();
ml::rect_d boundsSec = sec.calc_bounds(secFace);
double currX = (bounds.min.x + bounds.max.x) / 2;
- base.push_back(ml::point_d(currX - boundsSec.width() / 2, bounds.max.y + boundsSec.height() / 2));
- base.push_back(ml::point_d(currX + boundsSec.width() / 2, bounds.max.y + boundsSec.height() / 2));
+ basePoints.push_back(ml::point_d(currX - boundsSec.width() / 2, bounds.max.y + boundsSec.height() / 2));
+ basePoints.push_back(ml::point_d(currX + boundsSec.width() / 2, bounds.max.y + boundsSec.height() / 2));
ml::text_options secOpt(secFace);
AlignText(secOpt, dp::Center);
- sec.warp(base, secOpt);
+ sec.warp(basePoints, secOpt);
boundsSec = sec.calc_bounds(secFace);
bounds.extend(boundsSec);
@@ -508,18 +508,18 @@ void SoftwareRenderer::CalculateTextMetric(PathInfo const & geometry, dp::FontDe
ml::face & face = m_textEngine.get_face(0, "default", font.m_size);
l.apply_font(face);
- vector<ml::point_d> base(geometry.m_path.size());
+ vector<ml::point_d> basePoints(geometry.m_path.size());
size_t i = 0;
for (auto const & p : geometry.m_path)
{
- base[i].x = p.x;
- base[i].y = p.y;
+ basePoints[i].x = p.x;
+ basePoints[i].y = p.y;
++i;
}
ml::text_options opt(face);
AlignText(opt, dp::Center);
- l.warp(base, opt);
+ l.warp(basePoints, opt);
l.calc_bounds(face);
for (auto const & sym : l.symbols())
rects.emplace_back(sym.bounds().min.x, sym.bounds().min.y, sym.bounds().max.x,
@@ -533,18 +533,18 @@ void SoftwareRenderer::DrawPathText(PathInfo const & geometry, dp::FontDecl cons
ml::face & face = m_textEngine.get_face(0, "default", font.m_size);
l.apply_font(face);
- vector<ml::point_d> base(geometry.m_path.size());
+ vector<ml::point_d> basePoints(geometry.m_path.size());
size_t i = 0;
for (auto const & p : geometry.m_path)
{
- base[i].x = p.x;
- base[i].y = p.y;
+ basePoints[i].x = p.x;
+ basePoints[i].y = p.y;
++i;
}
ml::text_options opt(face);
AlignText(opt, dp::Center);
- l.warp(base, opt);
+ l.warp(basePoints, opt);
agg_symbol_renderer ren(m_baseRenderer, font.m_color, font.m_outlineColor);
if (HasOutline(font))
diff --git a/software_renderer/software_renderer.hpp b/software_renderer/software_renderer.hpp
index 38520c777b..9565bd6b25 100644
--- a/software_renderer/software_renderer.hpp
+++ b/software_renderer/software_renderer.hpp
@@ -114,7 +114,7 @@ public:
private:
std::unique_ptr<GlyphCache> m_glyphCache;
- std::map<string, m2::RectU> m_symbolsIndex;
+ std::map<std::string, m2::RectU> m_symbolsIndex;
std::vector<uint8_t> m_symbolsSkin;
uint32_t m_skinWidth, m_skinHeight;
diff --git a/software_renderer/text_engine.cpp b/software_renderer/text_engine.cpp
index d89d4b8efd..5e56c59bab 100644
--- a/software_renderer/text_engine.cpp
+++ b/software_renderer/text_engine.cpp
@@ -426,7 +426,7 @@ FT_Glyph face::glyph(unsigned int code, unsigned int prev_code, ml::point_d * ke
ml::face & text_engine::get_face(size_t font_key, std::string const & name, size_t size)
{
- pair<size_t, size_t> key(font_key, size);
+ std::pair<size_t, size_t> key(font_key, size);
face_cache_type::iterator entry = m_cache.find(key);
if (entry == m_cache.end())
{