| 450 | } |
| 451 | |
| 452 | void 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 | |
| 476 | bool MutableLabelHandle::Update(ScreenBase const & screen) |
| 477 | { |
no test coverage detected