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

Method GetAttributeMutation

libs/drape_frontend/text_handle.cpp:33–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31{}
32
33void TextHandle::GetAttributeMutation(ref_ptr<dp::AttributeBufferMutator> mutator) const
34{
35 bool const isVisible = IsVisible();
36 if (!m_forceUpdateNormals && m_isLastVisible == isVisible)
37 return;
38
39 TOffsetNode const & node = GetOffsetNode(gpu::TextDynamicVertex::GetDynamicStreamID());
40 ASSERT(node.first.GetElementSize() == sizeof(gpu::TextDynamicVertex), ());
41 ASSERT(node.second.m_count == m_buffer.size(), ());
42
43 uint32_t const byteCount = static_cast<uint32_t>(m_buffer.size()) * sizeof(gpu::TextDynamicVertex);
44 void * buffer = mutator->AllocateMutationBuffer(byteCount);
45 if (isVisible)
46 memcpy(buffer, m_buffer.data(), byteCount);
47 else
48 memset(buffer, 0, byteCount);
49
50 dp::MutateNode mutateNode;
51 mutateNode.m_region = node.second;
52 mutateNode.m_data = make_ref(buffer);
53 mutator->AddMutation(node.first, mutateNode);
54
55 m_isLastVisible = isVisible;
56}
57
58bool TextHandle::Update(ScreenBase const & screen)
59{

Callers

nothing calls this directly

Calls 7

ASSERTFunction · 0.85
make_refFunction · 0.85
AddMutationMethod · 0.80
GetElementSizeMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected