MCPcopy Create free account
hub / github.com/comaps/comaps / Load

Method Load

libs/drape/symbols_texture.cpp:203–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203void SymbolsTexture::Load(ref_ptr<dp::GraphicsContext> context, std::string const & skinPathName,
204 ref_ptr<HWTextureAllocator> allocator)
205{
206 auto definitionInserter = [this](std::string const & name, m2::RectF const & rect)
207 { m_definition.insert(std::make_pair(name, SymbolsTexture::SymbolInfo(rect))); };
208
209 auto completionHandler = [this, &allocator, context](unsigned char * data, uint32_t width, uint32_t height)
210 {
211 Texture::Params p;
212 p.m_allocator = allocator;
213 p.m_format = dp::TextureFormat::RGBA8;
214 p.m_width = width;
215 p.m_height = height;
216
217 Create(context, p, make_ref(data));
218 };
219
220 auto failureHandler = [this, context](std::string const & reason)
221 {
222 LOG(LERROR, (reason));
223 Fail(context);
224 };
225
226 LoadSymbols(skinPathName, m_name, true /* convertToUV */, definitionInserter, completionHandler, failureHandler);
227}
228
229void SymbolsTexture::Invalidate(ref_ptr<dp::GraphicsContext> context, std::string const & skinPathName,
230 ref_ptr<HWTextureAllocator> allocator)

Callers

nothing calls this directly

Calls 5

CreateFunction · 0.85
make_refFunction · 0.85
LoadSymbolsFunction · 0.85
SymbolInfoClass · 0.70
insertMethod · 0.45

Tested by

no test coverage detected