diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-08-10 21:25:37 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:24:05 +0300 |
commit | ea5f105f55eece846c65ab25065ec0650f6ba3e5 (patch) | |
tree | 1c55371a733ba07b5323760b0a0a701f4892e92b /drape/attribute_buffer_mutator.cpp | |
parent | 818242f2d7ea8317ef1e30ad40e3ac44ae1d4fc3 (diff) |
[drape] Text shape refactoring. Move placing algos into TextLayout class.
Diffstat (limited to 'drape/attribute_buffer_mutator.cpp')
-rw-r--r-- | drape/attribute_buffer_mutator.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drape/attribute_buffer_mutator.cpp b/drape/attribute_buffer_mutator.cpp index 465a25b78a..4554482385 100644 --- a/drape/attribute_buffer_mutator.cpp +++ b/drape/attribute_buffer_mutator.cpp @@ -3,9 +3,25 @@ namespace dp { +AttributeBufferMutator::~AttributeBufferMutator() +{ + SharedBufferManager & mng = SharedBufferManager::instance(); + for (size_t i = 0; i < m_array.size(); ++i) + { + TBufferNode & node = m_array[i]; + mng.freeSharedBuffer(node.second, node.first); + } +} + void AttributeBufferMutator::AddMutation(BindingInfo const & info, MutateNode const & node) { m_data[info].push_back(node); } +void * AttributeBufferMutator::AllocateMutationBuffer(uint32_t byteCount) +{ + m_array.push_back(make_pair(SharedBufferManager::instance().reserveSharedBuffer(byteCount), byteCount)); + return &((*m_array.back().first)[0]); +} + } // namespace dp |