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

Method GetAttributeMutation

libs/drape_frontend/gui/gui_text.cpp:452–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452void MutableLabelHandle::GetAttributeMutation(ref_ptr<dp::AttributeBufferMutator> mutator) const
453{
454 if (!m_isContentDirty)
455 return;
456
457 m_isContentDirty = false;
458 MutableLabel::LabelResult result;
459 m_textView->SetText(result, m_content, m_textureManager);
460
461 size_t const byteCount = result.m_buffer.size() * sizeof(MutableLabel::DynamicVertex);
462 auto const dataPointer = static_cast<MutableLabel::DynamicVertex *>(mutator->AllocateMutationBuffer(byteCount));
463 std::copy(result.m_buffer.begin(), result.m_buffer.end(), dataPointer);
464
465 dp::BindingInfo const & binding = MutableLabel::DynamicVertex::GetBindingInfo();
466 auto const & node = GetOffsetNode(binding.GetID());
467 ASSERT_EQUAL(node.first.GetElementSize(), sizeof(MutableLabel::DynamicVertex), ());
468 ASSERT_EQUAL(node.second.m_count, result.m_buffer.size(), ());
469
470 dp::MutateNode mutateNode;
471 mutateNode.m_data = make_ref(dataPointer);
472 mutateNode.m_region = node.second;
473 mutator->AddMutation(node.first, mutateNode);
474}
475
476bool MutableLabelHandle::Update(ScreenBase const & screen)
477{

Callers 1

RenderMethod · 0.45

Calls 10

GetBindingInfoFunction · 0.85
make_refFunction · 0.85
SetTextMethod · 0.80
AddMutationMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetIDMethod · 0.45
GetElementSizeMethod · 0.45

Tested by

no test coverage detected