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

Method GetOrCreateBuffer

libs/drape/vertex_array_buffer.cpp:271–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271ref_ptr<DataBuffer> VertexArrayBuffer::GetOrCreateBuffer(BindingInfo const & bindingInfo, bool isDynamic)
272{
273 BuffersMap * buffers = nullptr;
274 if (isDynamic)
275 buffers = &m_dynamicBuffers;
276 else
277 buffers = &m_staticBuffers;
278
279 auto it = buffers->find(bindingInfo);
280 if (it == buffers->end())
281 {
282 drape_ptr<DataBuffer> dataBuffer = make_unique_dp<DataBuffer>(bindingInfo.GetElementSize(), m_dataBufferSize);
283 ref_ptr<DataBuffer> result = make_ref(dataBuffer);
284 (*buffers).insert(std::make_pair(bindingInfo, std::move(dataBuffer)));
285 return result;
286 }
287
288 return make_ref(it->second);
289}
290
291uint32_t VertexArrayBuffer::GetAvailableIndexCount() const
292{

Callers

nothing calls this directly

Calls 5

make_refFunction · 0.85
findMethod · 0.45
endMethod · 0.45
GetElementSizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected