diff --git a/graphics/glyph_cache.cpp b/graphics/glyph_cache.cpp index 066cd7c64e..bafedca417 100644 --- a/graphics/glyph_cache.cpp +++ b/graphics/glyph_cache.cpp @@ -23,13 +23,6 @@ namespace graphics m_color() {} - uint32_t GlyphKey::toUInt32() const - { - return static_cast(m_symbolCode) << 16 - | static_cast(m_fontSize) << 8 - | static_cast(m_isMask); - } - bool operator<(GlyphKey const & l, GlyphKey const & r) { if (l.m_symbolCode != r.m_symbolCode) diff --git a/graphics/glyph_cache.hpp b/graphics/glyph_cache.hpp index c6186c298b..eb789284d8 100644 --- a/graphics/glyph_cache.hpp +++ b/graphics/glyph_cache.hpp @@ -40,9 +40,7 @@ namespace graphics int m_fontSize; bool m_isMask; graphics::Color m_color; - /// as it's used for fixed fonts only, the color doesn't matter - /// @TODO REMOVE IT!!! All chars are already 32bit - uint32_t toUInt32() const; + GlyphKey(strings::UniChar symbolCode, int fontSize, bool isMask, diff --git a/graphics/glyph_layout.cpp b/graphics/glyph_layout.cpp index 5860ca1062..ef74503375 100644 --- a/graphics/glyph_layout.cpp +++ b/graphics/glyph_layout.cpp @@ -1,14 +1,9 @@ #include "glyph_layout.hpp" -#include "font_desc.hpp" #include "resource.hpp" #include "../base/logging.hpp" #include "../base/math.hpp" -#include "../std/sstream.hpp" -#include "../geometry/angles.hpp" -#include "../geometry/any_rect2d.hpp" -#include "../base/thread.hpp" namespace graphics { diff --git a/graphics/glyph_layout.hpp b/graphics/glyph_layout.hpp index 9b51a26fe3..45d096e16a 100644 --- a/graphics/glyph_layout.hpp +++ b/graphics/glyph_layout.hpp @@ -1,26 +1,21 @@ #pragma once +#include "glyph_cache.hpp" #include "defines.hpp" - -#include "../base/string_utils.hpp" +#include "text_path.hpp" +#include "font_desc.hpp" #include "../geometry/rect2d.hpp" #include "../geometry/point2d.hpp" #include "../geometry/any_rect2d.hpp" #include "../geometry/angles.hpp" -#include "../std/vector.hpp" -#include "../std/string.hpp" -#include "../std/shared_ptr.hpp" +#include "../base/string_utils.hpp" -#include "glyph_cache.hpp" -#include "text_path.hpp" -#include "font_desc.hpp" namespace graphics { class GlyphCache; - struct FontDesc; struct GlyphLayoutElem { diff --git a/graphics/overlay.cpp b/graphics/overlay.cpp index 8cc8d7ecd3..dc488d138e 100644 --- a/graphics/overlay.cpp +++ b/graphics/overlay.cpp @@ -1,8 +1,5 @@ -#include "../base/SRC_FIRST.hpp" - #include "overlay.hpp" #include "overlay_renderer.hpp" -#include "text_element.hpp" #include "../base/logging.hpp" #include "../base/stl_add.hpp" @@ -16,11 +13,11 @@ namespace graphics bool betterOverlayElement(shared_ptr const & l, shared_ptr const & r) { - /// "frozen" object shouldn't be popped out. + // "frozen" object shouldn't be popped out. if (r->isFrozen()) return false; - /// for the composite elements, collected in OverlayRenderer to replace the part elements + // for the composite elements, collected in OverlayRenderer to replace the part elements return l->priority() > r->priority(); } @@ -360,24 +357,4 @@ namespace graphics // LOG(LINFO, ("clipped out", clippedCnt, "elements,", elemCnt, "elements total")); } - - bool Overlay::checkHasEquals(Overlay const * l) const - { - vector > v0; - m_tree.ForEach(MakeBackInsertFunctor(v0)); - - sort(v0.begin(), v0.end()); - - vector > v1; - l->m_tree.ForEach(MakeBackInsertFunctor(v1)); - - sort(v1.begin(), v1.end()); - - vector > res; - - set_intersection(v0.begin(), v0.end(), v1.begin(), v1.end(), back_inserter(res)); - - return !res.empty(); - } } - diff --git a/graphics/overlay.hpp b/graphics/overlay.hpp index 86b3762a5b..83436b1aa4 100644 --- a/graphics/overlay.hpp +++ b/graphics/overlay.hpp @@ -1,8 +1,5 @@ #pragma once -#include "text_element.hpp" -#include "symbol_element.hpp" - #include "../geometry/rect2d.hpp" #include "../geometry/point2d.hpp" #include "../geometry/tree4d.hpp" @@ -10,11 +7,15 @@ #include "../base/matrix.hpp" #include "../base/mutex.hpp" -#include "../std/map.hpp" #include "../std/list.hpp" +#include "../std/shared_ptr.hpp" + namespace graphics { + class OverlayRenderer; + class OverlayElement; + struct OverlayElementTraits { static m2::RectD const LimitRect(shared_ptr const & elem); @@ -65,8 +66,6 @@ namespace graphics void clip(m2::RectI const & r); - bool checkHasEquals(Overlay const * l) const; - template void forEach(Fn fn) { diff --git a/graphics/overlay_element.cpp b/graphics/overlay_element.cpp index d10552e66b..3d55f82ad9 100644 --- a/graphics/overlay_element.cpp +++ b/graphics/overlay_element.cpp @@ -1,6 +1,6 @@ -#include "../base/SRC_FIRST.hpp" #include "overlay_element.hpp" + namespace graphics { OverlayElement::~OverlayElement() diff --git a/graphics/overlay_element.hpp b/graphics/overlay_element.hpp index f05ee9ae64..eed2c41d43 100644 --- a/graphics/overlay_element.hpp +++ b/graphics/overlay_element.hpp @@ -1,11 +1,15 @@ #pragma once +#include "defines.hpp" + #include "../geometry/point2d.hpp" #include "../geometry/any_rect2d.hpp" + #include "../base/matrix.hpp" -#include "defines.hpp" + #include "../std/vector.hpp" + namespace graphics { class OverlayRenderer; diff --git a/graphics/overlay_renderer.cpp b/graphics/overlay_renderer.cpp index 4a23641faa..64d74fb90d 100644 --- a/graphics/overlay_renderer.cpp +++ b/graphics/overlay_renderer.cpp @@ -1,5 +1,3 @@ -#include "../base/SRC_FIRST.hpp" - #include "overlay_renderer.hpp" #include "straight_text_element.hpp" #include "path_text_element.hpp" @@ -9,6 +7,7 @@ #include "overlay.hpp" #include "resource_manager.hpp" + namespace graphics { OverlayRenderer::Params::Params() diff --git a/graphics/overlay_renderer.hpp b/graphics/overlay_renderer.hpp index 5a643f907e..51f390272d 100644 --- a/graphics/overlay_renderer.hpp +++ b/graphics/overlay_renderer.hpp @@ -1,13 +1,15 @@ #pragma once -#include "../std/shared_ptr.hpp" -#include "../std/map.hpp" - #include "text_renderer.hpp" #include "overlay.hpp" #include "circle_element.hpp" +#include "symbol_element.hpp" #include "straight_text_element.hpp" +#include "../std/shared_ptr.hpp" +#include "../std/map.hpp" + + namespace graphics { class OverlayRenderer : public TextRenderer diff --git a/graphics/path_text_element.cpp b/graphics/path_text_element.cpp index a2b20d912c..ad71b30ad7 100644 --- a/graphics/path_text_element.cpp +++ b/graphics/path_text_element.cpp @@ -1,7 +1,7 @@ -#include "../base/SRC_FIRST.hpp" #include "path_text_element.hpp" #include "overlay_renderer.hpp" + namespace graphics { PathTextElement::Params::Params() diff --git a/graphics/path_text_element.hpp b/graphics/path_text_element.hpp index ab14d8d66c..67f12144e9 100644 --- a/graphics/path_text_element.hpp +++ b/graphics/path_text_element.hpp @@ -1,6 +1,8 @@ #pragma once #include "text_element.hpp" +#include "glyph_layout.hpp" + namespace graphics { diff --git a/graphics/resource.hpp b/graphics/resource.hpp index 4704cdd84b..0d630f2970 100644 --- a/graphics/resource.hpp +++ b/graphics/resource.hpp @@ -2,7 +2,6 @@ #include "../geometry/rect2d.hpp" -#include "../std/shared_ptr.hpp" namespace graphics { diff --git a/graphics/straight_text_element.cpp b/graphics/straight_text_element.cpp index 1dce3a747f..74bc5afe57 100644 --- a/graphics/straight_text_element.cpp +++ b/graphics/straight_text_element.cpp @@ -1,5 +1,3 @@ -#include "../base/SRC_FIRST.hpp" - #include "straight_text_element.hpp" #include "overlay_renderer.hpp" diff --git a/graphics/straight_text_element.hpp b/graphics/straight_text_element.hpp index 3fb4425732..95f6a4100b 100644 --- a/graphics/straight_text_element.hpp +++ b/graphics/straight_text_element.hpp @@ -1,6 +1,8 @@ #pragma once #include "text_element.hpp" +#include "glyph_layout.hpp" + namespace graphics { diff --git a/graphics/text_element.cpp b/graphics/text_element.cpp index c7d897b6a7..4963bdb44c 100644 --- a/graphics/text_element.cpp +++ b/graphics/text_element.cpp @@ -1,13 +1,11 @@ #include "text_element.hpp" -#include "screen.hpp" -#include "resource_cache.hpp" -#include "resource_manager.hpp" #include "overlay_renderer.hpp" #include "glyph.hpp" -#include "resource.hpp" +#include "glyph_layout.hpp" #include "../base/logging.hpp" + namespace graphics { TextElement::TextElement(Params const & p) diff --git a/graphics/text_element.hpp b/graphics/text_element.hpp index 2271dd9b52..279d39018a 100644 --- a/graphics/text_element.hpp +++ b/graphics/text_element.hpp @@ -1,22 +1,15 @@ #pragma once - -#include "../base/string_utils.hpp" +#include "overlay_element.hpp" +#include "font_desc.hpp" #include "../base/matrix.hpp" +#include "../base/string_utils.hpp" -#include "../geometry/any_rect2d.hpp" - -#include "../std/shared_ptr.hpp" - -#include "font_desc.hpp" -#include "glyph_layout.hpp" -#include "overlay_element.hpp" namespace graphics { - class ResourceManager; - class Skin; - class ResourceCache; + class GlyphLayout; + class GlyphCache; class OverlayRenderer; class TextElement : public OverlayElement diff --git a/graphics/text_path.cpp b/graphics/text_path.cpp index 696dfa1e9c..879138b10f 100644 --- a/graphics/text_path.cpp +++ b/graphics/text_path.cpp @@ -1,9 +1,9 @@ -#include "../base/SRC_FIRST.hpp" - #include "text_path.hpp" +#include "glyph_cache.hpp" #include "../geometry/angles.hpp" + namespace graphics { TextPath::TextPath() diff --git a/graphics/text_path.hpp b/graphics/text_path.hpp index e2bd1c48e5..f6cc1b9d17 100644 --- a/graphics/text_path.hpp +++ b/graphics/text_path.hpp @@ -1,13 +1,15 @@ #pragma once +#include "path_view.hpp" + #include "../base/matrix.hpp" #include "../base/buffer_vector.hpp" -#include "glyph_cache.hpp" -#include "path_view.hpp" namespace graphics { + struct GlyphMetrics; + class TextPath { private: