Compare commits

...

14 Commits

Author SHA1 Message Date
Konstantin Pastbin
8d551e5fb3 [fdroid] Release version 2025.12.28-2
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-28 23:23:37 +07:00
Konstantin Pastbin
48f6fcf0ac [planet] Update map data to 251227
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-28 23:21:36 +07:00
Konstantin Pastbin
72433c6754 December R3 maps-only release notes
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-27 20:56:50 +07:00
Konstantin Pastbin
7641ea3c74 [fdroid] Release version 2025.12.19-11
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-19 22:44:47 +07:00
Konstantin Pastbin
4f2b479b2c December R2 release notes
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-19 16:38:10 +01:00
Viktor Govako
a972552155 [drape] Refactor UpdateVisualScale.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-12-19 16:26:51 +01:00
Konstantin Pastbin
dc54c45482 [planet] Update map data to 251217
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-19 16:01:17 +01:00
Codeberg Translate
1975b6a0f0 [strings] Update from Codeberg Translate
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: ERYpTION <eryption@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: JanezPavelZebovec <janezpavelzebovec@noreply.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: Priit Jõerüüt <jrtcdbrg@noreply.codeberg.org>
Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>
Co-authored-by: patepelo <patepelo@noreply.codeberg.org>
Translation: CoMaps/Android - Map Feature Types
Translation: CoMaps/Android UI Strings
Translation: CoMaps/iOS - Map Feature Types
Translation: CoMaps/iOS UI Strings
2025-12-19 12:49:54 +00:00
map-per
8683853f46 [search] Check for empty/nullptr to fix editor crash (#2904)
Signed-off-by: map-per <map-per@gmx.de>
2025-12-19 13:49:30 +01:00
Yannik Bloscheck
d7e34c2685 [search] Fix search for vegan and vegetarian places
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
2025-12-19 13:11:05 +01:00
Konstantin Pastbin
0028306b26 [search] Fix compilation (add missing comma)
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-19 12:36:51 +07:00
x7z4w
b5354fd1e3 [search] Add synonyms
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-19 04:12:12 +01:00
x7z4w
964f82510a [drape] Set Harfbuzz language to map language
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-19 04:09:13 +01:00
Konstantin Pastbin
faf49fc574 [tts] Revert values changes done in #2752 4f739d98b
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-19 09:25:00 +07:00
41 changed files with 2563 additions and 2562 deletions

View File

@@ -1,10 +0,0 @@
• OpenStreetMap-Daten vom 9. Dezember
• Material 3 Design
• Im OSM-Editor können nun Ladestationen hinzugefügt werden
• Schuko und Typ E Ladestationen hinzugefügt
• Verbesserte Suchvorschläge
• Litauische und lettische Sprachankündigungen
• Die Fahranweisungen wurden vergrößert
• Der Zoomlevel passt sich an die Distanz zur nächsten Abbiegung an
• Neue Anordnung der Einstellungen
Weitere Einzelheiten auf codeberg.org/comaps/comaps/releases

View File

@@ -1,10 +1,4 @@
• OpenStreetMap data as of December 9
Use Material 3 themes
• Support charging sockets in OSM Editor
• Added schuko/type-E charge sockets
• Improved search results ranking
• Enabled Lithuanian and Latvian in voice announcements
• Improved size of driving indications
• Base zoom level on distance to next turn
• Reordered settings
More details on codeberg.org/comaps/comaps/releases
This is a maps-only update just to keep your maps fresh!
OpenStreetMap data as of December 27
Please see previous releases' changes on codeberg.org/comaps/comaps/releases

View File

@@ -1,11 +0,0 @@
• Datos de OpenStreetMap a fecha 9/12.
• Uso de temas Material 3.
• Compatibilidad con enchufes de recarga en Editor.
• Se añaden enchufes de recarga schuko/tipo E.
• Se mejora la búsqueda.
• Se habilitan el lituano y el letón en las indicaciones de voz.
• Se aumenta el tamaño de las indicaciones de conducción.
• Nivel de zoom base según la distancia al siguiente giro.
• Se han reordenado los ajustes.
Más detalles en codeberg.org/comaps/comaps/releases

View File

@@ -1,10 +0,0 @@
• Données OpenStreetMap du 9 Décembre
• Utilisation de Material 3
• Support de l'édition des bornes de recharge dans l'éditeur OSM
• Ajout du type de prise schuko/type-E
• Amélioration de l'ordre des résultats de recherche
• Ajout du lituanien et du letton dans le guidage vocal
• Amélioration de la taille des instructions dans la navigation
• Niveau de zoom basé sur la distance jusquau prochain virage
• Réorganisation des paramètres
Plus de détails sur codeberg.org/comaps/comaps/releases

View File

@@ -1,10 +0,0 @@
• Podaci OpenStreetMap karte od 9. prosinca
• Korištenje Material 3 tema
• Podrška za utičnice za punjenje u OSM Editoru
• Dodane šuko/tip-E utičnice
• Poboljšano rangiranje rezultata pretraživanja
• Omogućeni litvanski i latvijski jezici u glasovnim najavama
• Povećana veličina indikatora vožnje
• Razina zumiranja se mijenja ovisno o udaljenosti do sljedećeg skretanja
• Promijenjen redoslijed postavki
Više detalja na codeberg.org/comaps/comaps/releases

View File

@@ -1,10 +0,0 @@
• Dane OpenStreetMap z 9 grudnia
• Użycie motywów Material 3
• Obsługa gniazd ładowania w Edytorze OSM
• Dodane gniazda ładowania schuko/type-E
• Poprawiony ranking wyników wyszukiwania
• Dodane litewskie i łotewskie komunikaty głosowe
• Poprawiony rozmiar znaków drogowych
• Poziom powiększenia oparty na odległości do następnego manewru
• Zmieniona kolejność ustawień
Więcej szczegółów na codeberg.org/comaps/comaps/releases

View File

@@ -1,10 +0,0 @@
• Dados OpenStreetMap atualizados em 9 de dezembro
• Uso do estilo Material 3
• Suporte para tomadas de carregamento no Editor OSM
• Adição de tomadas de carregamento Schuko/Tipo E
• Melhoria na classificação dos resultados de busca
• Adição dos idiomas letão e lituano nas orientações por voz
• Melhoria no tamanho das indicações de direção
• Nível de zoom baseado em distância até a próxima curva
• Configurações reordenadas
Mais detalhes em codeberg.org/comaps/comaps/releases

View File

@@ -1 +1 @@
version: 2025.03.02-7-FDroid+25030207
version: 2025.12.28-2-FDroid+25122802

View File

@@ -489,7 +489,7 @@
<string name="placepage_edit_bookmark_button">Rediger bogmærke</string>
<string name="placepage_personal_notes_hint">Personlige notater (tekst eller html)</string>
<string name="editor_reset_edits_message">Kassér alle lokale ændringer?</string>
<string name="editor_reset_edits_button">Kassér</string>
<string name="editor_reset_edits_button">Kassér ændringer</string>
<string name="editor_remove_place_message">Slet tilføjet sted?</string>
<string name="editor_remove_place_button">Slet</string>
<string name="editor_place_doesnt_exist">Stedet eksisterer ikke</string>

View File

@@ -497,7 +497,7 @@
<string name="placepage_edit_bookmark_button">Muuda järjehoidjat</string>
<string name="placepage_personal_notes_hint">Isiklikud märkmed (tekst või html)</string>
<string name="editor_reset_edits_message">Kas loobud kõigist kohalikest muudatustest?</string>
<string name="editor_reset_edits_button">Loobu</string>
<string name="editor_reset_edits_button">Loobu muudatustest</string>
<string name="editor_remove_place_message">Kas kustutad lisatud koha?</string>
<string name="editor_remove_place_button">Kustuta</string>
<string name="editor_place_doesnt_exist">Kohta pole olemas</string>
@@ -911,4 +911,10 @@
<string name="place_page_update_too_old_map">Uuenda piirkonna kaardiandmeid</string>
<string name="place_page_too_old_to_edit">Kuna kaardiandmed on liiga vanad, siis OpenStreetMapi muutmise võimalus on lülitatud välja.</string>
<string name="navigation_start_tts_disabled_message">Hääljuhiste kasutamine on lülitatud välja: kõnesünteesimootorit pole saadaval</string>
<string name="download_resources_custom_url_summary_none">Pole määratud</string>
<string name="advanced">Täiendavad seadistused</string>
<string name="download_resources_custom_url_title">Sinu oma kaardiserver</string>
<string name="download_resources_custom_url_message">Kui tahad kasutada oma kaardiserverit, siis lisa ta siia. CoMapsi vaikimisi serveri kasutamiseks jäta tühjaks.</string>
<string name="download_resources_custom_url_hint">https://cdn-fi-1.comaps.app/</string>
<string name="download_resources_custom_url_error_scheme">Palun sisesta täismahuline võrguaadress, mille alguses on https:// ja lõpus /</string>
</resources>

View File

@@ -851,4 +851,6 @@
<string name="place_page_update_too_old_map">Atjaunināt karšu apgabalu</string>
<string name="place_page_too_old_to_edit">OpenStreetMap labošana ir atspējota, jo kartes dati ir pārāk veci.</string>
<string name="navigation_start_tts_disabled_message">Balss norādes atspējotas: nav pieejams teksta pārveidošanas runā dzinējs</string>
<string name="prefs_speed_cameras_information">Brīdinājumi par ātruma noteikšanas kamerā ir atspējoti valstīs, kurās šādus brīdinājumus aizliedz vietējais likums.</string>
<string name="navigation_start_tts_message">"Uzsāk navigāciju, balss norāžu valoda: "</string>
</resources>

View File

@@ -511,7 +511,7 @@
<string name="placepage_edit_bookmark_button">编辑书签</string>
<string name="placepage_personal_notes_hint">个人注记(文字或 html</string>
<string name="editor_reset_edits_message">舍弃所有本地更改?</string>
<string name="editor_reset_edits_button">舍弃</string>
<string name="editor_reset_edits_button">舍弃更改</string>
<string name="editor_remove_place_message">删除已添加的地点?</string>
<string name="editor_remove_place_button">删除</string>
<string name="editor_place_doesnt_exist">该地点不存在</string>
@@ -917,4 +917,10 @@
<string name="place_page_app_too_old_description">您当前的地图数据非常旧,请更新 CoMaps 应用。</string>
<string name="place_page_update_too_old_map">更新地图区域</string>
<string name="place_page_too_old_to_edit">由于地图数据太旧OpenStreetMap 编辑被禁用。</string>
<string name="download_resources_custom_url_hint">https://cdn-fi-1.comaps.app/</string>
<string name="download_resources_custom_url_summary_none">未设置</string>
<string name="download_resources_custom_url_error_scheme">请输入以 https:// 开头、以 / 结尾的完整 URL</string>
<string name="advanced">高级</string>
<string name="download_resources_custom_url_title">自定义地图服务器</string>
<string name="download_resources_custom_url_message">覆盖用于地图下载的默认地图下载服务器。留空则使用 CoMaps 默认服务器。</string>
</resources>

View File

@@ -1122,7 +1122,7 @@
<string name="type.shop.doityourself">Tienda de bricolaje</string>
<string name="type.shop.dry_cleaning">Tintorería</string>
<string name="type.shop.electronics">Electrónica</string>
<string name="type.shop.erotic">Sex Shop</string>
<string name="type.shop.erotic">Tienda erótica</string>
<string name="type.shop.fabric">Tienda de telas</string>
<string name="type.shop.farm">Tienda de alimentos de granja</string>
<string name="type.shop.fashion_accessories">Accesorios de moda</string>

View File

@@ -457,4 +457,12 @@
<string name="type.entrance.exit">Izhod (samo)</string>
<string name="type.healthcare.laboratory">Zdravstveni laboratorij</string>
<string name="type.healthcare.psychotherapist">Psihoterapevt</string>
<string name="type.highway.cycleway.tunnel">Predor</string>
<string name="type.highway.elevator">Dvigalo</string>
<string name="type.highway.footway">Pešpot</string>
<string name="type.highway.footway.sidewalk">Pločnik</string>
<string name="type.highway.footway.crossing">Prehod za pešce</string>
<string name="type.highway.footway.area">Površina za pešce</string>
<string name="type.highway.footway.bridge">Most za pešce</string>
<string name="type.highway.footway.tunnel">Predor za pešce</string>
</resources>

View File

@@ -34,7 +34,7 @@
"shop-farm|@category_food|@shop": "Farm food",
"shop-garden_centre|@shop": "4Garden Centre|U+1F3E1",
"shop-grocery|@category_food|@shop": "Grocery",
"shop-health_food|@category_food|@shop": "7Health food|7Healthy food|healthfood|organic|vegan|vegetarian",
"shop-health_food|@category_food|@shop": "7Health food|7Healthy food|healthfood|organic",
"shop-hearing_aids|@shop": "7Hearing Aids",
"shop-mobile_phone|@shop": "4Cell Phones|4Mobile Phones|6smartphones|electronics store|U+1F4F1|U+1F4F2",
"shop-florist|@shop": "4Florist|U+1F337|U+1F338|U+1F339|U+1F33A|U+1F33B|U+1F33C|U+1F490|U+1F33E|4flowers|flower shop|floral shop|floral arrangements|same day flowers|bouquet",

File diff suppressed because it is too large Load Diff

View File

@@ -680,7 +680,7 @@
"editor_edits_sent_message" = "Din note vil blive sendt til OpenStreetMap";
"editor_comment_hint" = "Kommentar…";
"editor_reset_edits_message" = "Kassér alle lokale ændringer?";
"editor_reset_edits_button" = "Kassér";
"editor_reset_edits_button" = "Kassér ændringer";
"editor_remove_place_message" = "Slet tilføjet sted?";
"editor_remove_place_button" = "Slet";
"editor_place_doesnt_exist" = "Stedet eksisterer ikke";

View File

@@ -1220,7 +1220,7 @@
"type.shop.doityourself" = "Tienda de bricolaje";
"type.shop.dry_cleaning" = "Tintorería";
"type.shop.electronics" = "Electrónica";
"type.shop.erotic" = "Sex Shop";
"type.shop.erotic" = "Tienda erótica";
"type.shop.fabric" = "Tienda de telas";
"type.shop.farm" = "Tienda de alimentos de granja";
"type.shop.fashion_accessories" = "Accesorios de moda";

View File

@@ -681,7 +681,7 @@
"editor_edits_sent_message" = "Sinu märkus saadetakse OpenStreetMapile";
"editor_comment_hint" = "Kommenteeri…";
"editor_reset_edits_message" = "Kas loobud kõigist kohalikest muudatustest?";
"editor_reset_edits_button" = "Loobu";
"editor_reset_edits_button" = "Loobu muudatustest";
"editor_remove_place_message" = "Kas kustutad lisatud koha?";
"editor_remove_place_button" = "Kustuta";
"editor_place_doesnt_exist" = "Kohta pole olemas";

View File

@@ -456,3 +456,11 @@
"type.entrance.exit" = "Izhod (samo)";
"type.healthcare.laboratory" = "Zdravstveni laboratorij";
"type.healthcare.psychotherapist" = "Psihoterapevt";
"type.highway.cycleway.tunnel" = "Predor";
"type.highway.elevator" = "Dvigalo";
"type.highway.footway" = "Pešpot";
"type.highway.footway.sidewalk" = "Pločnik";
"type.highway.footway.crossing" = "Prehod za pešce";
"type.highway.footway.area" = "Površina za pešce";
"type.highway.footway.bridge" = "Most za pešce";
"type.highway.footway.tunnel" = "Predor za pešce";

View File

@@ -683,7 +683,7 @@
"editor_edits_sent_message" = "您的说明将发送至 OpenStreetMap";
"editor_comment_hint" = "备注…";
"editor_reset_edits_message" = "舍弃所有本地更改?";
"editor_reset_edits_button" = "舍弃";
"editor_reset_edits_button" = "舍弃更改";
"editor_remove_place_message" = "删除已添加的地点?";
"editor_remove_place_button" = "删除";
"editor_place_doesnt_exist" = "该地点不存在";

View File

@@ -81,7 +81,7 @@ public:
QPainter painter(device);
painter.fillRect(QRectF(0.0, 0.0, device->width(), device->height()), Qt::white);
auto const shapedText = m_mng->ShapeText(m_utf8, m_fontPixelSize, m_lang);
auto const shapedText = m_mng->ShapeText(m_utf8, m_fontPixelSize);
std::cout << "Total width: " << shapedText.m_lineWidthInPixels << '\n';
std::cout << "Max height: " << shapedText.m_maxLineHeightInPixels << '\n';

View File

@@ -5,6 +5,7 @@
#include "drape/harfbuzz_shaping.hpp"
#include "platform/platform.hpp"
#include "platform/preferred_languages.hpp"
#include "coding/hex.hpp"
#include "coding/reader.hpp"
@@ -328,6 +329,9 @@ FreetypeError constexpr g_FT_Errors[] =
TUniBlockIter m_lastUsedBlock;
std::vector<std::unique_ptr<Font>> m_fonts;
std::string const lang = languages::GetCurrentOrig();
hb_language_t const m_language = hb_language_from_string(lang.data(), static_cast<int>(lang.size()));
// Required to use std::string_view as a search key for std::unordered_map::find().
struct StringHash : public std::hash<std::string_view>
{
@@ -563,21 +567,8 @@ FreetypeError constexpr g_FT_Errors[] =
return m_impl->m_fonts[key.m_fontIndex]->GetGlyphImage(key.m_glyphId, pixelHeight, sdf);
}
namespace
{
hb_language_t OrganicMapsLanguageToHarfbuzzLanguage(int8_t lang)
{
// TODO(AB): can langs be converted faster?
auto const svLang = StringUtf8Multilang::GetLangByCode(lang);
auto const hbLanguage = hb_language_from_string(svLang.data(), static_cast<int>(svLang.size()));
if (hbLanguage == HB_LANGUAGE_INVALID)
return hb_language_get_default();
return hbLanguage;
}
} // namespace
// This method is NOT multithreading-safe.
text::TextMetrics GlyphManager::ShapeText(std::string_view utf8, int fontPixelHeight, int8_t lang)
text::TextMetrics GlyphManager::ShapeText(std::string_view utf8, int fontPixelHeight)
{
#ifdef DEBUG
static int const fontSize = fontPixelHeight;
@@ -591,9 +582,6 @@ FreetypeError constexpr g_FT_Errors[] =
auto const [text, segments] = harfbuzz_shaping::GetTextSegments(utf8);
// TODO(AB): Optimize language conversion.
hb_language_t const hbLanguage = OrganicMapsLanguageToHarfbuzzLanguage(lang);
text::TextMetrics allGlyphs;
// For SplitText it's enough to know if the last visual (first logical) segment is RTL.
allGlyphs.m_isRTL = segments.back().m_direction == HB_DIRECTION_RTL;
@@ -609,7 +597,8 @@ FreetypeError constexpr g_FT_Errors[] =
static_cast<int>(text.size()), substring.m_start, substring.m_length);
hb_buffer_set_direction(m_impl->m_harfbuzzBuffer, substring.m_direction);
hb_buffer_set_script(m_impl->m_harfbuzzBuffer, substring.m_script);
hb_buffer_set_language(m_impl->m_harfbuzzBuffer, hbLanguage);
// TODO: This property is static, is it possible to set it only once?
hb_buffer_set_language(m_impl->m_harfbuzzBuffer, m_impl->m_language);
auto u32CharacterIter{text.begin() + substring.m_start};
auto const end{u32CharacterIter + substring.m_length};
@@ -646,10 +635,4 @@ FreetypeError constexpr g_FT_Errors[] =
return allGlyphs;
}
text::TextMetrics GlyphManager::ShapeText(std::string_view utf8, int fontPixelHeight, char const * lang)
{
return ShapeText(utf8, fontPixelHeight, StringUtf8Multilang::GetLangIndex(lang));
}
} // namespace dp

View File

@@ -73,8 +73,7 @@ public:
int GetFontIndex(strings::UniChar unicodePoint);
int GetFontIndex(std::u16string_view sv);
text::TextMetrics ShapeText(std::string_view utf8, int fontPixelHeight, int8_t lang);
text::TextMetrics ShapeText(std::string_view utf8, int fontPixelHeight, char const * lang);
text::TextMetrics ShapeText(std::string_view utf8, int fontPixelHeight);
GlyphImage GetGlyphImage(GlyphFontAndId key, int pixelHeight, bool sdf) const;

View File

@@ -231,14 +231,6 @@ void SymbolsTexture::Invalidate(ref_ptr<dp::GraphicsContext> context, std::strin
Load(context, skinPathName, allocator);
}
void SymbolsTexture::Invalidate(ref_ptr<dp::GraphicsContext> context, std::string const & skinPathName,
ref_ptr<HWTextureAllocator> allocator,
std::vector<drape_ptr<HWTexture>> & internalTextures)
{
internalTextures.push_back(std::move(m_hwTexture));
Invalidate(context, skinPathName, allocator);
}
ref_ptr<Texture::ResourceInfo> SymbolsTexture::FindResource(Texture::Key const & key, bool & newResource)
{
newResource = false;

View File

@@ -36,8 +36,6 @@ public:
void Invalidate(ref_ptr<dp::GraphicsContext> context, std::string const & skinPathName,
ref_ptr<HWTextureAllocator> allocator);
void Invalidate(ref_ptr<dp::GraphicsContext> context, std::string const & skinPathName,
ref_ptr<HWTextureAllocator> allocator, std::vector<drape_ptr<HWTexture>> & internalTextures);
bool IsSymbolContained(std::string const & symbolName) const;

View File

@@ -73,6 +73,12 @@ public:
static bool IsPowerOfTwo(uint32_t width, uint32_t height);
void DeferredCleanup(std::vector<drape_ptr<HWTexture>> & toCleanup)
{
toCleanup.push_back(std::move(m_hwTexture));
Destroy();
}
protected:
void Destroy();
bool AllocateTexture(ref_ptr<dp::GraphicsContext> context, ref_ptr<HWTextureAllocator> allocator);

View File

@@ -87,6 +87,10 @@ drape_ptr<Texture> CreateArrowTexture(ref_ptr<dp::GraphicsContext> context,
useDefaultResourceFolder ? StaticTexture::kDefaultResource : std::string(),
dp::TextureFormat::RGBA8, textureAllocator, true /* allowOptional */);
}
// There is no "arrow-texture.png".
// BackendRenderer::m_arrow3dPreloadedData mesh is used by default.
/// @todo Texture arrow is still present in case if somebody wants to use it?
return make_unique_dp<StaticTexture>(context, "arrow-texture.png", StaticTexture::kDefaultResource,
dp::TextureFormat::RGBA8, textureAllocator, true /* allowOptional */);
}
@@ -315,39 +319,7 @@ void TextureManager::Init(ref_ptr<dp::GraphicsContext> context, Params const & p
m_smaaSearchTexture = make_unique_dp<StaticTexture>(context, "smaa-search.png", StaticTexture::kDefaultResource,
dp::TextureFormat::Red, make_ref(m_textureAllocator));
// Initialize patterns (reserved ./data/patterns.txt lines count).
std::set<PenPatternT> patterns;
double const visualScale = params.m_visualScale;
uint32_t rowsCount = 0;
impl::ParsePatternsList(params.m_patterns, [&](buffer_vector<double, 8> const & pattern)
{
PenPatternT toAdd;
for (double d : pattern)
toAdd.push_back(PatternFloat2Pixel(d * visualScale));
if (!patterns.insert(toAdd).second)
return;
if (IsTrianglePattern(toAdd))
{
rowsCount = rowsCount + toAdd[2] + toAdd[3];
}
else
{
ASSERT_EQUAL(toAdd.size(), 2, ());
++rowsCount;
}
});
m_stipplePenTexture = make_unique_dp<StipplePenTexture>(StipplePenTextureSize(rowsCount, m_maxTextureSize),
make_ref(m_textureAllocator));
LOG(LDEBUG, ("Patterns texture size =", m_stipplePenTexture->GetWidth(), m_stipplePenTexture->GetHeight()));
ref_ptr<StipplePenTexture> stipplePenTex = make_ref(m_stipplePenTexture);
for (auto const & p : patterns)
stipplePenTex->ReservePattern(p);
InitStipplePen(params);
// Initialize colors (reserved ./data/colors.txt lines count).
std::vector<dp::Color> colors;
@@ -372,7 +344,7 @@ void TextureManager::Init(ref_ptr<dp::GraphicsContext> context, Params const & p
m_maxGlypsCount = static_cast<uint32_t>(ceil(kGlyphAreaCoverage * textureSquare / averageGlyphSquare));
std::string_view constexpr kSpace{" "};
m_spaceGlyph = m_glyphManager->ShapeText(kSpace, dp::kBaseFontSizePixels, "en").m_glyphs.front().m_key;
m_spaceGlyph = m_glyphManager->ShapeText(kSpace, dp::kBaseFontSizePixels).m_glyphs.front().m_key;
LOG(LDEBUG, ("Glyphs texture size =", kGlyphsTextureSize, "with max glyphs count =", m_maxGlypsCount));
@@ -380,25 +352,73 @@ void TextureManager::Init(ref_ptr<dp::GraphicsContext> context, Params const & p
m_nothingToUpload.clear();
}
void TextureManager::InitStipplePen(Params const & params)
{
// Initialize patterns (reserved ./data/patterns.txt lines count).
std::set<PenPatternT> patterns;
uint32_t rowsCount = 0;
impl::ParsePatternsList(params.m_patterns, [&](buffer_vector<double, 8> const & pattern)
{
PenPatternT toAdd;
for (double d : pattern)
toAdd.push_back(PatternFloat2Pixel(d * params.m_visualScale));
if (!patterns.insert(toAdd).second)
return;
if (IsTrianglePattern(toAdd))
{
rowsCount = rowsCount + toAdd[2] + toAdd[3];
}
else
{
ASSERT_EQUAL(toAdd.size(), 2, ());
++rowsCount;
}
});
m_stipplePenTexture = make_unique_dp<StipplePenTexture>(StipplePenTextureSize(rowsCount, m_maxTextureSize),
make_ref(m_textureAllocator));
LOG(LDEBUG, ("Patterns texture size =", m_stipplePenTexture->GetWidth(), m_stipplePenTexture->GetHeight()));
ref_ptr<StipplePenTexture> stipplePenTex = make_ref(m_stipplePenTexture);
for (auto const & p : patterns)
stipplePenTex->ReservePattern(p);
}
void TextureManager::OnSwitchMapStyle(ref_ptr<dp::GraphicsContext> context)
{
CHECK(m_isInitialized, ());
bool const isVulkan = context->GetApiVersion() == dp::ApiVersion::Vulkan;
// Here we need invalidate only textures which can be changed in map style switch.
// Now we update only symbol textures, if we need update other textures they must be added here.
// For Vulkan we use m_texturesToCleanup to defer textures destroying.
for (auto const & m_symbolTexture : m_symbolTextures)
for (auto const & texture : m_symbolTextures)
{
ref_ptr<SymbolsTexture> symbolsTexture = make_ref(m_symbolTexture);
ASSERT(symbolsTexture != nullptr, ());
ref_ptr<SymbolsTexture> symbolsTexture = make_ref(texture);
if (isVulkan)
symbolsTexture->DeferredCleanup(m_texturesToCleanup);
if (context->GetApiVersion() != dp::ApiVersion::Vulkan)
symbolsTexture->Invalidate(context, m_resPostfix, make_ref(m_textureAllocator));
else
symbolsTexture->Invalidate(context, m_resPostfix, make_ref(m_textureAllocator), m_texturesToCleanup);
symbolsTexture->Invalidate(context, m_resPostfix, make_ref(m_textureAllocator));
}
}
void TextureManager::OnVisualScaleChanged(ref_ptr<dp::GraphicsContext> context, Params const & params)
{
m_resPostfix = params.m_resPostfix;
OnSwitchMapStyle(context);
if (context->GetApiVersion() == dp::ApiVersion::Vulkan)
m_stipplePenTexture->DeferredCleanup(m_texturesToCleanup);
InitStipplePen(params);
}
void TextureManager::InvalidateArrowTexture(ref_ptr<dp::GraphicsContext> context,
std::string const & texturePath /* = {} */,
bool useDefaultResourceFolder /* = false */)
@@ -416,10 +436,13 @@ void TextureManager::ApplyInvalidatedStaticTextures()
}
}
void TextureManager::GetTexturesToCleanup(std::vector<drape_ptr<HWTexture>> & textures)
std::vector<drape_ptr<HWTexture>> TextureManager::GetTexturesToCleanup()
{
CHECK(m_isInitialized, ());
std::swap(textures, m_texturesToCleanup);
auto res = std::move(m_texturesToCleanup);
m_texturesToCleanup.clear();
return res;
}
bool TextureManager::GetSymbolRegionSafe(std::string const & symbolName, SymbolRegion & region)
@@ -467,8 +490,7 @@ text::TextMetrics TextureManager::ShapeSingleTextLine(float fontPixelHeight, std
// TODO(AB): Is this mutex too slow?
std::lock_guard lock(m_calcGlyphsMutex);
// TODO(AB): Fix hard-coded lang.
auto textMetrics = m_glyphManager->ShapeText(utf8, fontPixelHeight, "en");
auto textMetrics = m_glyphManager->ShapeText(utf8, fontPixelHeight);
auto const & glyphs = textMetrics.m_glyphs;

View File

@@ -77,7 +77,9 @@ public:
void Init(ref_ptr<dp::GraphicsContext> context, Params const & params);
void OnSwitchMapStyle(ref_ptr<dp::GraphicsContext> context);
void GetTexturesToCleanup(std::vector<drape_ptr<HWTexture>> & textures);
void OnVisualScaleChanged(ref_ptr<dp::GraphicsContext> context, Params const & params);
std::vector<drape_ptr<HWTexture>> GetTexturesToCleanup();
bool GetSymbolRegionSafe(std::string const & symbolName, SymbolRegion & region);
void GetSymbolRegion(std::string const & symbolName, SymbolRegion & region);
@@ -121,6 +123,8 @@ public:
ref_ptr<HWTextureAllocator> GetTextureAllocator() const;
private:
void InitStipplePen(Params const & params);
struct GlyphGroup
{
std::set<GlyphFontAndId> m_glyphKeys;

View File

@@ -17,8 +17,6 @@
#include "drape/support_manager.hpp"
#include "drape/texture_manager.hpp"
#include "indexer/scales.hpp"
#include "platform/platform.hpp"
#include "base/file_name_utils.hpp"
@@ -355,18 +353,37 @@ void BackendRenderer::AcceptMessage(ref_ptr<Message> message)
m_trafficGenerator->InvalidateTexturesCache();
m_transitBuilder->RebuildSchemes(m_context, m_texMng);
// For Vulkan we initialize deferred cleaning up.
if (m_context->GetApiVersion() == dp::ApiVersion::Vulkan)
{
std::vector<drape_ptr<dp::HWTexture>> textures;
m_texMng->GetTexturesToCleanup(textures);
if (!textures.empty())
{
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<CleanupTexturesMessage>(std::move(textures)), MessagePriority::Normal);
}
}
CleanupTextures();
break;
}
case Message::Type::VisualScaleChanged:
{
ref_ptr<VisualScaleChangedMessage> msg = message;
msg->FilterDependentMessages();
CHECK(m_context != nullptr, ());
dp::TextureManager::Params params;
params.m_resPostfix = VisualParams::Instance().GetResourcePostfix();
params.m_visualScale = df::VisualParams::Instance().GetVisualScale();
#ifdef BUILD_DESIGNER
params.m_patterns = "patterns_design.txt";
#else
params.m_patterns = "patterns.txt";
#endif // BUILD_DESIGNER
m_texMng->OnVisualScaleChanged(m_context, params);
RecacheMapShapes();
RecacheGui(m_lastWidgetsInfo, false /* needResetOldGui */);
#ifdef RENDER_DEBUG_INFO_LABELS
RecacheDebugLabels();
#endif
m_trafficGenerator->InvalidateTexturesCache();
m_transitBuilder->RebuildSchemes(m_context, m_texMng);
CleanupTextures();
break;
}
@@ -611,21 +628,8 @@ void BackendRenderer::AcceptMessage(ref_ptr<Message> message)
m_arrow3dPreloadedData = Arrow3d::PreloadMesh(m_arrow3dCustomDecl, m_texMng);
}
// Recache map shapes.
RecacheMapShapes();
// For Vulkan we initialize deferred cleaning up.
if (m_context->GetApiVersion() == dp::ApiVersion::Vulkan)
{
std::vector<drape_ptr<dp::HWTexture>> textures;
m_texMng->GetTexturesToCleanup(textures);
if (!textures.empty())
{
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<CleanupTexturesMessage>(std::move(textures)), MessagePriority::Normal);
}
}
CleanupTextures();
break;
}
@@ -772,6 +776,18 @@ void BackendRenderer::RecacheMapShapes()
m_commutator->PostMessage(ThreadsCommutator::RenderThread, std::move(msg), MessagePriority::Normal);
}
void BackendRenderer::CleanupTextures()
{
// For Vulkan we initialize deferred cleaning up.
if (m_context->GetApiVersion() == dp::ApiVersion::Vulkan)
{
auto textures = m_texMng->GetTexturesToCleanup();
if (!textures.empty())
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<CleanupTexturesMessage>(std::move(textures)), MessagePriority::Normal);
}
}
void BackendRenderer::FlushGeometry(TileKey const & key, dp::RenderState const & state,
drape_ptr<dp::RenderBucket> && buffer)
{

View File

@@ -83,6 +83,7 @@ private:
void RecacheGui(gui::TWidgetsInitInfo const & initInfo, bool needResetOldGui);
void RecacheChoosePositionMark();
void RecacheMapShapes();
void CleanupTextures();
#ifdef RENDER_DEBUG_INFO_LABELS
void RecacheDebugLabels();

View File

@@ -897,10 +897,8 @@ void DrapeEngine::UpdateVisualScale(double vs, bool needStopRendering)
if (needStopRendering)
SetRenderingEnabled();
RecacheGui(false);
RecacheMapShapes();
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<RecoverContextDependentResourcesMessage>(), MessagePriority::Normal);
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread, make_unique_dp<UpdateVisualScaleMessage>(),
MessagePriority::High);
}
void DrapeEngine::UpdateMyPositionRoutingOffset(bool useDefault, int offsetY)

View File

@@ -640,51 +640,11 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
break;
}
case Message::Type::RecoverContextDependentResources:
{
UpdateContextDependentResources();
break;
}
case Message::Type::RecoverContextDependentResources: UpdateContextDependentResources(); break;
case Message::Type::UpdateMapStyle:
{
#ifdef BUILD_DESIGNER
classificator::Load();
#endif // BUILD_DESIGNER
case Message::Type::UpdateMapStyle: UpdateAll<SwitchMapStyleMessage>(); break;
// Clear all graphics.
for (RenderLayer & layer : m_layers)
{
layer.m_renderGroups.clear();
layer.m_isDirty = false;
}
// Must be recreated on map style changing.
CHECK(m_context != nullptr, ());
m_transitBackground = make_unique_dp<ScreenQuadRenderer>(m_context);
// Invalidate read manager.
{
BaseBlockingMessage::Blocker blocker;
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
make_unique_dp<InvalidateReadManagerRectMessage>(blocker), MessagePriority::Normal);
blocker.Wait();
}
// Delete all messages which can contain render states (and textures references inside).
auto f = [this]() { InstantMessageFilter([](ref_ptr<Message> msg) { return msg->ContainsRenderState(); }); };
// Notify backend renderer and wait for completion.
{
BaseBlockingMessage::Blocker blocker;
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
make_unique_dp<SwitchMapStyleMessage>(blocker, std::move(f)), MessagePriority::Normal);
blocker.Wait();
}
UpdateContextDependentResources();
break;
}
case Message::Type::VisualScaleChanged: UpdateAll<VisualScaleChangedMessage>(); break;
case Message::Type::AllowAutoZoom:
{
@@ -1023,6 +983,46 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
}
}
template <class MessageT>
void FrontendRenderer::UpdateAll()
{
#ifdef BUILD_DESIGNER
classificator::Load();
#endif // BUILD_DESIGNER
// Clear all graphics.
for (RenderLayer & layer : m_layers)
{
layer.m_renderGroups.clear();
layer.m_isDirty = false;
}
// Must be recreated on map style changing.
CHECK(m_context != nullptr, ());
m_transitBackground = make_unique_dp<ScreenQuadRenderer>(m_context);
// Invalidate read manager.
{
BaseBlockingMessage::Blocker blocker;
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
make_unique_dp<InvalidateReadManagerRectMessage>(blocker), MessagePriority::Normal);
blocker.Wait();
}
// Delete all messages which can contain render states (and textures references inside).
auto f = [this]() { InstantMessageFilter([](ref_ptr<Message> msg) { return msg->ContainsRenderState(); }); };
// Notify backend renderer and wait for completion.
{
BaseBlockingMessage::Blocker blocker;
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread, make_unique_dp<MessageT>(blocker, std::move(f)),
MessagePriority::Normal);
blocker.Wait();
}
UpdateContextDependentResources();
}
std::unique_ptr<threads::IRoutine> FrontendRenderer::CreateRoutine()
{
return std::make_unique<Routine>(*this);

View File

@@ -247,6 +247,9 @@ private:
void ReleaseResources();
void UpdateContextDependentResources();
template <class MessageT>
void UpdateAll();
void BeginUpdateOverlayTree(ScreenBase const & modelView);
void UpdateOverlayTree(ScreenBase const & modelView, drape_ptr<RenderGroup> & renderGroup);
void EndUpdateOverlayTree();

View File

@@ -103,6 +103,7 @@ std::string DebugPrint(Message::Type msgType)
case Message::Type::EnableIsolines: return "EnableIsolines";
case Message::Type::OnEnterBackground: return "OnEnterBackground";
case Message::Type::Arrow3dRecache: return "Arrow3dRecache";
case Message::Type::VisualScaleChanged: return "VisualScaleChanged";
}
ASSERT(false, ("Unknown message type."));
return "Unknown type";

View File

@@ -103,7 +103,8 @@ public:
NotifyGraphicsReady,
EnableIsolines,
OnEnterBackground,
Arrow3dRecache
Arrow3dRecache,
VisualScaleChanged,
};
virtual ~Message() = default;

View File

@@ -1,7 +1,6 @@
#pragma once
#include "drape_frontend/circles_pack_shape.hpp"
#include "drape_frontend/color_constants.hpp"
#include "drape_frontend/custom_features_context.hpp"
#include "drape_frontend/drape_api.hpp"
#include "drape_frontend/drape_api_builder.hpp"
@@ -14,8 +13,7 @@
#include "drape_frontend/overlay_batcher.hpp"
#include "drape_frontend/postprocess_renderer.hpp"
#include "drape_frontend/render_node.hpp"
#include "drape_frontend/render_state_extension.hpp"
#include "drape_frontend/route_builder.hpp"
#include "drape_frontend/route_shape.hpp"
#include "drape_frontend/selection_shape.hpp"
#include "drape_frontend/tile_utils.hpp"
#include "drape_frontend/traffic_generator.hpp"
@@ -26,13 +24,10 @@
#include "drape/pointers.hpp"
#include "drape/render_bucket.hpp"
#include "drape/viewport.hpp"
#include "platform/location.hpp"
#include "geometry/polyline2d.hpp"
#include "geometry/rect2d.hpp"
#include "geometry/screenbase.hpp"
#include "geometry/triangle2d.hpp"
#include <condition_variable>
@@ -40,7 +35,6 @@
#include <map>
#include <mutex>
#include <optional>
#include <utility>
#include <vector>
namespace df
@@ -737,6 +731,12 @@ public:
Type GetType() const override { return Type::UpdateMapStyle; }
};
class UpdateVisualScaleMessage : public Message
{
public:
Type GetType() const override { return Type::VisualScaleChanged; }
};
class FollowRouteMessage : public Message
{
public:
@@ -783,6 +783,14 @@ private:
FilterMessagesHandler m_filterMessagesHandler;
};
class VisualScaleChangedMessage : public SwitchMapStyleMessage
{
public:
using SwitchMapStyleMessage::SwitchMapStyleMessage;
Type GetType() const override { return Type::VisualScaleChanged; }
};
class InvalidateMessage : public Message
{
public:

View File

@@ -65,6 +65,7 @@ static std::pair<UniString, UniString> const kPreprocessReplacements[] = {
{MakeUniString("ff. cc."), MakeUniString("ferrocarrís")},
{MakeUniString("f.ta"), MakeUniString("fondamenta")},
{MakeUniString("g.n.r."), MakeUniString("guarda nacional republicana")},
{MakeUniString("g-ral"), MakeUniString("general")},
{MakeUniString("g. v."), MakeUniString("gran vía")},
{MakeUniString("i.d."), MakeUniString("in der")},
{MakeUniString("k/s"), MakeUniString("khách sạn")},

View File

@@ -244,12 +244,12 @@ void NotificationManager::SetLengthUnits(measurement_utils::Units units)
switch (units)
{
case measurement_utils::Units::Metric:
m_settings.SetState(30 /* notificationTimeSeconds */, 400 /* minNotificationDistanceUnits */,
m_settings.SetState(30 /* notificationTimeSeconds */, 200 /* minNotificationDistanceUnits */,
2000 /* maxNotificationDistanceUnits */, GetSoundedDistMeters() /* soundedDistancesUnits */,
measurement_utils::Units::Metric /* lengthUnits */);
return;
case measurement_utils::Units::Imperial:
m_settings.SetState(30 /* notificationTimeSeconds */, 1000 /* minNotificationDistanceUnits */,
m_settings.SetState(30 /* notificationTimeSeconds */, 500 /* minNotificationDistanceUnits */,
5000 /* maxNotificationDistanceUnits */, GetSoundedDistFeet() /* soundedDistancesUnits */,
measurement_utils::Units::Imperial /* lengthUnits */);
return;

View File

@@ -93,11 +93,13 @@ public:
ForEachIndexImpl(intervals, scale, [&](uint32_t index)
{
fn(*GetFeature(index, ignoreEditedStatus));
std::unique_ptr<FeatureType> ft = GetFeature(index, ignoreEditedStatus);
if (ft)
fn(*ft);
});
}
// Returns false if feature was deleted by user.
// Returns empty unique_ptr if feature was deleted by user.
std::unique_ptr<FeatureType> GetFeature(uint32_t index, bool ignoreEditedStatus = false) const;
[[nodiscard]] inline bool GetCenter(uint32_t index, m2::PointD & center) { return m_centers.Get(index, center); }

View File

@@ -725,7 +725,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"low", {"lower"}},
{"lp", {"loop"}},
{"lr", {"lower"}},
{"lt", {"lote", "lieutenant", "little"}},
{"lt", {"lote", "lieutenant", "little", "locotelent"}},
{"lug", {"lugar"}},
{"luit", {"luitenant"}},
{"lung", {"lungsod"}},
@@ -1111,6 +1111,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"seventh", {"7th"}},
{"sexta", {"6", "6a"}},
{"sexto", {"6", "6o"}},
{"sf", {"sfântul", "sfânta", "sfinții"}},
{"sgda", {"sagrada"}},
{"sg", {"schottergrube", "sungai", "sandgrube"}},
{"sgt", {"sagrat", "sergeant"}},
@@ -1390,6 +1391,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"б", {"большая", "большой"}},
{"бл", {"блок"}},
{"бол", {"большая", "большой"}},
{"буд", {"будинок"}},
{"бул", {"булевард", "бульвар"}},
{"вул", {"вулиця"}},
{"вх", {"вход"}},
@@ -1402,7 +1404,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"кв", {"квартал"}},
{"мал", {"малый", "малая"}},
{"мит", {"митрополит"}},
{"м", {"малый", "малая"}},
{"м", {"малый", "малая", "місто"}},
{"наб", {"набережная", "набережна", "набярэжная"}},
{"нов", {"новый", "новая"}},
{"обл", {"область"}},
@@ -1416,6 +1418,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"с", {"село"}},
{"стар", {"старая", "старый"}},
{"туп", {"тупик", "тупік"}},
{"узв", {"узвіз"}},
{"ул", {"улица"}},
{"ш", {"шаша", "шосе", "шоссе"}},
{"اثنان", {"2"}},