Compare commits

...

8 Commits

Author SHA1 Message Date
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
37 changed files with 2579 additions and 2527 deletions

View File

@@ -1,10 +1,8 @@
• 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
• OpenStreetMap Daten vom 17. Dezember
• Map download server nun wählbar
Warnung über veraltete Karten hinzugefügt + Knopf zum updaten
Vermeidung von Parkplatzwegen im Routing
Neuer Zoombutton
Verbesserte Französchische Suchsynonme
OSM editor: Maximale Länge für OSM-Tags werden nun geprüft
Mehr auf codeberg.org/comaps/comaps/releases

View File

@@ -1,10 +1,8 @@
• 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
• OpenStreetMap data as of December 17
Make map download server configurable
Added info about outdated maps and an update button to the selected place info card
• Avoid using parking aisles for routing
Changed shape of zoom buttons
Improved French search synonyms
OSM editor: check length limit for OSM tags in value validation
More details 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 +1,8 @@
• 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
• Données OpenStreetMap du 17 décembre
Serveur de téléchargement de cartes configurable
Ajout d'un message d'avertissement pour les cartes trop anciennes
Évitement des allées de parking dans les itinéraires
Mise à jour de l'apparence des boutons de zooms
• Amélioration des synonymes de recherche en français
Editeur OSM: vérification de la taille limite des tags OSM
Plus d'informations 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 +1,8 @@
• 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
• Dados OSM de 17/12
Servidor de download de mapas configurável
Adição de informações sobre mapas desatualizados e um botão de atualização ao cartão de informações do local selecionado
Evita o uso de corredores de estacionamento para roteamento
Formato dos botões de zoom alterado
Sinônimos de busca em francês aprimorados
Editor OSM: verificação do limite de comprimento das tags do OSM na validação de valores
Mais detalhes em codeberg.org/comaps/comaps/releases

View File

@@ -0,0 +1,8 @@
• Карты OpenStreetMap от 17 декабря
• Возможность настройки сервера для скачивания карт
• Добавлена ​​информация об устаревании карт и ​​кнопка обновления (при выборе места на карте)
• Парковочные проезды больше не используются для транзитной маршрутизации
• Изменены кнопки масштабирования карты
На карту добавлены ирригационные гидранты
• Редактор OSM: проверка максимальной длины OSM тегов
Подробнее на codeberg.org/comaps/comaps/releases

View File

@@ -1 +1 @@
version: 2025.03.02-7-FDroid+25030207
version: 2025.12.19-11-FDroid+25121911

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

@@ -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;
@@ -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)

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,7 +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-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

@@ -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); }