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

Function GetDefaultAllocator

libs/drape/hw_texture.cpp:288–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288ref_ptr<HWTextureAllocator> GetDefaultAllocator(ref_ptr<dp::GraphicsContext> context)
289{
290 CHECK(context != nullptr, ());
291 auto const apiVersion = context->GetApiVersion();
292 if (apiVersion == dp::ApiVersion::Metal)
293 {
294#if defined(OMIM_METAL_AVAILABLE)
295 return GetDefaultMetalAllocator();
296#endif
297 CHECK(false, ("Metal rendering is supported now only on iOS."));
298 return nullptr;
299 }
300
301 if (apiVersion == dp::ApiVersion::Vulkan)
302 return GetDefaultVulkanAllocator();
303
304 static OpenGLHWTextureAllocator s_allocator;
305 return make_ref<HWTextureAllocator>(&s_allocator);
306}
307} // namespace dp

Callers 5

SetSizeMethod · 0.85
FailMethod · 0.85
FailMethod · 0.85
UNIT_TESTFunction · 0.85
RecreateDepthTextureMethod · 0.85

Calls 2

GetApiVersionMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.68