diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-07-30 15:44:09 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:22:49 +0300 |
commit | 64b07cb6dd0d2fe5685d89a73a4f51dafbdb4e11 (patch) | |
tree | dd2cabb4af67306c44bf52ed72e840191bdf6592 /drape | |
parent | 7a3c714e48697e44f2be66d27e90981b59b06959 (diff) |
[drape] move drape into dp namespace
Diffstat (limited to 'drape')
70 files changed, 356 insertions, 10 deletions
diff --git a/drape/attribute_buffer_mutator.cpp b/drape/attribute_buffer_mutator.cpp index 88a2650179..465a25b78a 100644 --- a/drape/attribute_buffer_mutator.cpp +++ b/drape/attribute_buffer_mutator.cpp @@ -1,6 +1,11 @@ #include "attribute_buffer_mutator.hpp" +namespace dp +{ + void AttributeBufferMutator::AddMutation(BindingInfo const & info, MutateNode const & node) { m_data[info].push_back(node); } + +} // namespace dp diff --git a/drape/attribute_buffer_mutator.hpp b/drape/attribute_buffer_mutator.hpp index bc80b60196..150defcd64 100644 --- a/drape/attribute_buffer_mutator.hpp +++ b/drape/attribute_buffer_mutator.hpp @@ -6,6 +6,9 @@ #include "../std/stdint.hpp" #include "../std/map.hpp" +namespace dp +{ + struct MutateRegion { MutateRegion() : m_offset(0), m_count(0) {} @@ -35,3 +38,5 @@ private: private: TMutateData m_data; }; + +} // namespace dp diff --git a/drape/attribute_provider.cpp b/drape/attribute_provider.cpp index a832ed50f1..3efc106de0 100644 --- a/drape/attribute_provider.cpp +++ b/drape/attribute_provider.cpp @@ -12,6 +12,9 @@ #define INIT_STREAM(x) UNUSED_VALUE((x)) #endif +namespace dp +{ + AttributeProvider::AttributeProvider(uint8_t streamCount, uint16_t vertexCount) : m_vertexCount(vertexCount) { @@ -93,3 +96,5 @@ void AttributeProvider::InitCheckStream(uint8_t streamIndex) m_checkInfo[streamIndex] = true; } #endif + +} diff --git a/drape/attribute_provider.hpp b/drape/attribute_provider.hpp index 83658b5670..fb371a96f7 100644 --- a/drape/attribute_provider.hpp +++ b/drape/attribute_provider.hpp @@ -5,6 +5,9 @@ #include "../std/vector.hpp" +namespace dp +{ + class AttributeProvider { public: @@ -39,3 +42,5 @@ private: vector<bool> m_checkInfo; #endif }; + +} // namespace dp diff --git a/drape/batcher.cpp b/drape/batcher.cpp index b784b1bdfd..692f0a04ef 100644 --- a/drape/batcher.cpp +++ b/drape/batcher.cpp @@ -7,6 +7,9 @@ #include "../std/bind.hpp" +namespace dp +{ + class Batcher::CallbacksWrapper { public: @@ -219,3 +222,5 @@ void Batcher::InsertTriangles(GLState const & state, if (!handle.IsNull()) bucket->AddOverlayHandle(handle.Move()); } + +} // namespace dp
\ No newline at end of file diff --git a/drape/batcher.hpp b/drape/batcher.hpp index 584479d13f..01b11b5ad4 100644 --- a/drape/batcher.hpp +++ b/drape/batcher.hpp @@ -9,6 +9,10 @@ #include "../std/map.hpp" #include "../std/function.hpp" + +namespace dp +{ + class RenderBucket; class AttributeProvider; class OverlayHandle; @@ -65,3 +69,5 @@ private: uint32_t m_indexBufferSize; uint32_t m_vertexBufferSize; }; + +} // namespace dp diff --git a/drape/batcher_helpers.cpp b/drape/batcher_helpers.cpp index a1ae3f29a6..c92f9193b1 100644 --- a/drape/batcher_helpers.cpp +++ b/drape/batcher_helpers.cpp @@ -6,6 +6,9 @@ #include "../std/algorithm.hpp" +namespace dp +{ + namespace { @@ -449,3 +452,5 @@ void TriangleListOfStripBatch::GenerateIndexes(uint16_t * indexStorage, uint16_t uint8_t const vertexStride = GetVertexStride(); generate(indexStorage, indexStorage + count, ListOfStriptGenerator(startIndex, vertexStride, VtoICount(vertexStride))); } + +} // namespace dp
\ No newline at end of file diff --git a/drape/batcher_helpers.hpp b/drape/batcher_helpers.hpp index 914de48aed..844083c02b 100644 --- a/drape/batcher_helpers.hpp +++ b/drape/batcher_helpers.hpp @@ -4,6 +4,9 @@ #include "../std/function.hpp" +namespace dp +{ + class AttributeProvider; class BindingInfo; @@ -119,3 +122,5 @@ protected: virtual uint16_t AlignVCount(uint16_t vCount) const; virtual void GenerateIndexes(uint16_t * indexStorage, uint16_t count, uint16_t startIndex) const; }; + +} // namespace dp diff --git a/drape/binding_info.cpp b/drape/binding_info.cpp index 92aca9b9fa..95d5ce5624 100644 --- a/drape/binding_info.cpp +++ b/drape/binding_info.cpp @@ -2,6 +2,9 @@ #include "../base/assert.hpp" +namespace dp +{ + namespace { @@ -120,3 +123,5 @@ bool BindingInfo::operator<(BindingInfo const & other) const return false; } + +} // namespace dp diff --git a/drape/binding_info.hpp b/drape/binding_info.hpp index 026403c3ba..d334f6fbb6 100644 --- a/drape/binding_info.hpp +++ b/drape/binding_info.hpp @@ -5,6 +5,9 @@ #include "../std/string.hpp" #include "../std/shared_array.hpp" +namespace dp +{ + struct BindingDecl { string m_attributeName; @@ -37,3 +40,5 @@ protected: shared_array<BindingDecl> m_bindings; uint16_t m_info; }; + +} // namespace dp diff --git a/drape/buffer_base.cpp b/drape/buffer_base.cpp index c5e2774a74..7e97ca7cfa 100644 --- a/drape/buffer_base.cpp +++ b/drape/buffer_base.cpp @@ -1,6 +1,9 @@ #include "buffer_base.hpp" #include "../base/assert.hpp" +namespace dp +{ + BufferBase::BufferBase(uint8_t elementSize, uint16_t capacity) : m_elementSize(elementSize) , m_capacity(capacity) @@ -45,3 +48,5 @@ void BufferBase::UploadData(uint16_t elementCount) ASSERT(m_size + elementCount <= m_capacity, ()); m_size += elementCount; } + +} // namespace dp diff --git a/drape/buffer_base.hpp b/drape/buffer_base.hpp index bad4683305..a27f49f2cf 100644 --- a/drape/buffer_base.hpp +++ b/drape/buffer_base.hpp @@ -2,6 +2,9 @@ #include "../std/stdint.hpp" +namespace dp +{ + class BufferBase { public: @@ -22,3 +25,5 @@ private: uint16_t m_capacity; uint16_t m_size; }; + +} // namespace dp diff --git a/drape/color.cpp b/drape/color.cpp index 91b422558a..ad60134abf 100644 --- a/drape/color.cpp +++ b/drape/color.cpp @@ -1,5 +1,8 @@ #include "color.hpp" +namespace dp +{ + namespace { @@ -86,3 +89,30 @@ void Convert(Color const & c, float & r, float & g, float & b, float & a) b = c.m_blue / (float)MaxChannelValue; a = c.m_alfa / (float)MaxChannelValue; } + +ColorF::ColorF(Color const & clr) +{ + Convert(clr, m_r, m_g, m_b, m_a); +} + +bool ColorF::operator< (ColorF const & other) const +{ + if (other.m_r != m_r) + return m_r < other.m_r; + if (other.m_g != m_g) + return m_g < other.m_g; + if (other.m_b != m_b) + return m_b < other.m_b; + + return m_a < other.m_a; +} + +bool ColorF::operator== (ColorF const & other) const +{ + return m_r == other.m_r && + m_g == other.m_g && + m_b == other.m_b && + m_a == other.m_a; +} + +} // namespace dp diff --git a/drape/color.hpp b/drape/color.hpp index c96e5fdef2..fb71eafa2e 100644 --- a/drape/color.hpp +++ b/drape/color.hpp @@ -2,28 +2,32 @@ #include "../std/stdint.hpp" +namespace dp +{ + struct Color { Color(); Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alfa); + bool operator < (Color const & other) const; + bool operator == (Color const & other) const; + uint8_t m_red; uint8_t m_green; uint8_t m_blue; uint8_t m_alfa; - - bool operator < (Color const & other) const; - bool operator == (Color const & other) const; }; struct ColorF { ColorF() {} - ColorF(Color const & clr) - : m_r(clr.m_red / 255.0f), m_g(clr.m_green / 255.0f), - m_b(clr.m_blue / 255.0f), m_a(clr.m_alfa / 255.0f) {} + ColorF(Color const & clr); ColorF(float r, float g, float b, float a) : m_r (r), m_g (g), m_b (b), m_a (a) {} + bool operator < (ColorF const & other) const; + bool operator == (ColorF const & other) const; + float m_r; float m_g; float m_b; @@ -38,4 +42,4 @@ Color Extract(uint32_t argb); Color Extract(uint32_t xrgb, uint8_t a); void Convert(Color const & c, float & r, float & g, float & b, float & a); - +} diff --git a/drape/cpu_buffer.cpp b/drape/cpu_buffer.cpp index b011089ce2..3ba8abe26d 100644 --- a/drape/cpu_buffer.cpp +++ b/drape/cpu_buffer.cpp @@ -6,6 +6,9 @@ #include "../std/cstring.hpp" +namespace dp +{ + CPUBuffer::CPUBuffer(uint8_t elementSize, uint16_t capacity) : base_t(elementSize, capacity) { @@ -61,3 +64,5 @@ unsigned char * CPUBuffer::GetCursor() const { return m_memoryCursor; } + +} // namespace dp diff --git a/drape/cpu_buffer.hpp b/drape/cpu_buffer.hpp index d96b3dbf09..a0bff314b6 100644 --- a/drape/cpu_buffer.hpp +++ b/drape/cpu_buffer.hpp @@ -5,6 +5,9 @@ #include "../std/vector.hpp" #include "../std/shared_ptr.hpp" +namespace dp +{ + class CPUBuffer : public BufferBase { typedef BufferBase base_t; @@ -28,3 +31,5 @@ private: unsigned char * m_memoryCursor; shared_ptr<vector<unsigned char> > m_memory; }; + +} //namespace dp diff --git a/drape/data_buffer.cpp b/drape/data_buffer.cpp index 71acbb0392..961ed65412 100644 --- a/drape/data_buffer.cpp +++ b/drape/data_buffer.cpp @@ -1,6 +1,11 @@ #include "data_buffer.hpp" +namespace dp +{ + DataBuffer::DataBuffer(uint8_t elementSize, uint16_t capacity) : GPUBuffer(GPUBuffer::ElementBuffer, elementSize, capacity) { } + +} diff --git a/drape/data_buffer.hpp b/drape/data_buffer.hpp index ab241166ae..0607d6469a 100644 --- a/drape/data_buffer.hpp +++ b/drape/data_buffer.hpp @@ -2,9 +2,14 @@ #include "gpu_buffer.hpp" +namespace dp +{ + class DataBuffer : public GPUBuffer { public: DataBuffer(uint8_t elementSize, uint16_t capacity); }; +} // namespace dp + diff --git a/drape/drape_tests/attribute_provides_tests.cpp b/drape/drape_tests/attribute_provides_tests.cpp index 6ea7f94f8a..3713ea864b 100644 --- a/drape/drape_tests/attribute_provides_tests.cpp +++ b/drape/drape_tests/attribute_provides_tests.cpp @@ -4,6 +4,8 @@ #include <gmock/gmock.h> +using namespace dp; + UNIT_TEST(InitStreamsTest) { int const VERTEX_COUNT = 10; diff --git a/drape/drape_tests/batcher_tests.cpp b/drape/drape_tests/batcher_tests.cpp index 64801bfcc6..0ab82b4132 100644 --- a/drape/drape_tests/batcher_tests.cpp +++ b/drape/drape_tests/batcher_tests.cpp @@ -24,6 +24,7 @@ using testing::InSequence; using testing::Invoke; using testing::IgnoreResult; using testing::AnyOf; +using namespace dp; namespace { diff --git a/drape/drape_tests/bingind_info_tests.cpp b/drape/drape_tests/bingind_info_tests.cpp index 3b990a0377..d78231916d 100644 --- a/drape/drape_tests/bingind_info_tests.cpp +++ b/drape/drape_tests/bingind_info_tests.cpp @@ -2,6 +2,8 @@ #include "../../drape/binding_info.hpp" +using namespace dp; + UNIT_TEST(BindingInfoIDTest) { { diff --git a/drape/drape_tests/buffer_tests.cpp b/drape/drape_tests/buffer_tests.cpp index dbac3aae5a..21f2788eec 100644 --- a/drape/drape_tests/buffer_tests.cpp +++ b/drape/drape_tests/buffer_tests.cpp @@ -12,6 +12,7 @@ using namespace emul; using ::testing::_; using ::testing::Return; using ::testing::InSequence; +using namespace dp; UNIT_TEST(CreateDestroyDataBufferTest) { diff --git a/drape/drape_tests/font_texture_tests.cpp b/drape/drape_tests/font_texture_tests.cpp index 536b807b91..c7fe334078 100644 --- a/drape/drape_tests/font_texture_tests.cpp +++ b/drape/drape_tests/font_texture_tests.cpp @@ -14,6 +14,7 @@ using ::testing::_; using ::testing::Return; using ::testing::InSequence; using ::testing::AnyNumber; +using namespace dp; namespace { diff --git a/drape/drape_tests/pointers_tests.cpp b/drape/drape_tests/pointers_tests.cpp index 5715b8a6b3..6448cfc7cb 100644 --- a/drape/drape_tests/pointers_tests.cpp +++ b/drape/drape_tests/pointers_tests.cpp @@ -15,6 +15,7 @@ using ::testing::MatchResultListener; using ::testing::Matcher; using my::SrcPoint; +using namespace dp; namespace { @@ -48,6 +49,7 @@ void MyOnAssertFailed(SrcPoint const & src, string const & msg) g_asserter->Assert(src, msg); } +#if defined(CHECK_POINTERS) MockAssertExpector * InitAsserter() { if (g_asserter != NULL) @@ -66,6 +68,7 @@ void DestroyAsserter() delete g_asserter; g_asserter = NULL; } +#endif SrcPoint ConstructSrcPoint(char const * fileName, char const * function) { diff --git a/drape/drape_tests/uniform_value_tests.cpp b/drape/drape_tests/uniform_value_tests.cpp index d1aeb18b97..32fdf92738 100644 --- a/drape/drape_tests/uniform_value_tests.cpp +++ b/drape/drape_tests/uniform_value_tests.cpp @@ -17,6 +17,7 @@ using ::testing::AnyOf; using ::testing::IgnoreResult; using ::testing::Invoke; using ::testing::InSequence; +using namespace dp; namespace { diff --git a/drape/font_texture.cpp b/drape/font_texture.cpp index df87a1642e..1fe1b234eb 100644 --- a/drape/font_texture.cpp +++ b/drape/font_texture.cpp @@ -30,6 +30,9 @@ typedef gray8c_view_t const_view_t; typedef gray8_pixel_t pixel_t; typedef gray8c_pixel_t const_pixel_t; +namespace dp +{ + FontTexture::GlyphInfo::GlyphInfo(m2::RectF const & texRect, float xOffset, float yOffset, float advance) : ResourceInfo(texRect) @@ -251,3 +254,5 @@ void LoadFont(string const & resourcePrefix, vector<TransferPointer<Texture> > & grid.ParseMetrics(metrics); grid.GetTextures(textures); } + +} // namespace dp diff --git a/drape/font_texture.hpp b/drape/font_texture.hpp index 9edb92fc68..d3750d32da 100644 --- a/drape/font_texture.hpp +++ b/drape/font_texture.hpp @@ -7,6 +7,9 @@ #include "../std/vector.hpp" #include "../std/string.hpp" +namespace dp +{ + class FontTexture : public Texture { public: @@ -47,3 +50,5 @@ private: }; void LoadFont(string const & resourcePrefix, vector<TransferPointer<Texture> > & textures); + +} diff --git a/drape/glextensions_list.cpp b/drape/glextensions_list.cpp index e18bba571f..0f255ba868 100644 --- a/drape/glextensions_list.cpp +++ b/drape/glextensions_list.cpp @@ -5,6 +5,9 @@ #include "../std/string.hpp" +namespace dp +{ + #ifdef DEBUG #include "../std/map.hpp" @@ -85,3 +88,5 @@ bool GLExtensionsList::IsSupported(ExtensionName const & extName) const { return m_impl->IsSupported(extName); } + +} // namespace dp diff --git a/drape/glextensions_list.hpp b/drape/glextensions_list.hpp index 6aa9fb6e21..55f714cc83 100644 --- a/drape/glextensions_list.hpp +++ b/drape/glextensions_list.hpp @@ -2,6 +2,9 @@ #include "../std/noncopyable.hpp" +namespace dp +{ + class GLExtensionsList : private noncopyable { public: @@ -24,3 +27,5 @@ private: class Impl; Impl * m_impl; }; + +} // namespace dp diff --git a/drape/glfunctions.cpp b/drape/glfunctions.cpp index 5265d65a6e..3e1a694176 100644 --- a/drape/glfunctions.cpp +++ b/drape/glfunctions.cpp @@ -317,8 +317,7 @@ void * GLFunctions::glMapBuffer(glConst target) void GLFunctions::glUnmapBuffer(glConst target) { ASSERT(glUnmapBufferFn != NULL, ()); - GLboolean result = glUnmapBufferFn(target); - ASSERT(result == GL_TRUE, ()); + VERIFY(glUnmapBufferFn(target) == GL_TRUE, ()); GLCHECKCALL(); } diff --git a/drape/glstate.cpp b/drape/glstate.cpp index 60462af542..be5715b1d8 100644 --- a/drape/glstate.cpp +++ b/drape/glstate.cpp @@ -7,6 +7,9 @@ #define COLOR_BIT 0x1 #define TEXTURE_BIT 0x2 +namespace dp +{ + Blending::Blending(bool isEnabled) : m_isEnabled(isEnabled) , m_blendFunction(gl_const::GLAddBlend) @@ -129,7 +132,7 @@ void ApplyState(GLState state, RefPointer<GpuProgram> program, { int8_t location = program->GetUniformLocation("u_color"); float c[4]; - ::Convert(state.GetColor(), c[0], c[1], c[2], c[3]); + Convert(state.GetColor(), c[0], c[1], c[2], c[3]); GLFunctions::glUniformValuef(location, c[0], c[1], c[2], c[3]); } @@ -148,3 +151,5 @@ void ApplyState(GLState state, RefPointer<GpuProgram> program, state.GetBlending().Apply(); } + +} diff --git a/drape/glstate.hpp b/drape/glstate.hpp index eaa87ec014..f39781d4dc 100644 --- a/drape/glstate.hpp +++ b/drape/glstate.hpp @@ -5,6 +5,9 @@ #include "texture_set_controller.hpp" #include "color.hpp" +namespace dp +{ + struct Blending { Blending(bool isEnabled = false); @@ -61,3 +64,5 @@ private: void ApplyUniforms(UniformValuesStorage const & uniforms, RefPointer<GpuProgram> program); void ApplyState(GLState state, RefPointer<GpuProgram> program, RefPointer<TextureSetController> textures); + +} // namespace dp diff --git a/drape/gpu_buffer.cpp b/drape/gpu_buffer.cpp index e34e59175b..6c76f52d4d 100644 --- a/drape/gpu_buffer.cpp +++ b/drape/gpu_buffer.cpp @@ -6,6 +6,8 @@ #include "../std/cstring.hpp" +namespace dp +{ namespace { @@ -156,3 +158,5 @@ void GPUBufferMapper::UpdateData(void const * data, uint16_t elementOffset, uint uint32_t GPUBufferMapper::m_mappedDataBuffer; uint32_t GPUBufferMapper::m_mappedIndexBuffer; #endif + +} // namespace dp diff --git a/drape/gpu_buffer.hpp b/drape/gpu_buffer.hpp index 4593f1813d..572ab88403 100644 --- a/drape/gpu_buffer.hpp +++ b/drape/gpu_buffer.hpp @@ -3,6 +3,9 @@ #include "pointers.hpp" #include "buffer_base.hpp" +namespace dp +{ + class GPUBuffer : public BufferBase { typedef BufferBase base_t; @@ -55,3 +58,5 @@ private: RefPointer<GPUBuffer> m_buffer; void * m_gpuPtr; }; + +} // namespace dp diff --git a/drape/gpu_program.cpp b/drape/gpu_program.cpp index 81ea373d7c..b0e13f2bda 100644 --- a/drape/gpu_program.cpp +++ b/drape/gpu_program.cpp @@ -6,7 +6,12 @@ #ifdef DEBUG #include "../std/map.hpp" +#endif + +namespace dp +{ +#ifdef DEBUG class UniformValidator { private: @@ -92,3 +97,5 @@ int8_t GpuProgram::GetUniformLocation(string const & uniformName) const { return GLFunctions::glGetUniformLocation(m_programID, uniformName); } + +} // namespace dp diff --git a/drape/gpu_program.hpp b/drape/gpu_program.hpp index f10f2f7991..a6e65136ee 100644 --- a/drape/gpu_program.hpp +++ b/drape/gpu_program.hpp @@ -8,7 +8,12 @@ #ifdef DEBUG #include "../std/scoped_ptr.hpp" +#endif + +namespace dp +{ +#ifdef DEBUG class UniformValidator; typedef int32_t UniformSize; typedef pair<glConst, UniformSize> UniformTypeAndSize; @@ -37,3 +42,5 @@ public: bool HasUniform(string const & name, glConst type, UniformSize size); #endif }; + +} // namespace dp diff --git a/drape/gpu_program_manager.cpp b/drape/gpu_program_manager.cpp index c048ff3b08..71cb7c178d 100644 --- a/drape/gpu_program_manager.cpp +++ b/drape/gpu_program_manager.cpp @@ -4,6 +4,9 @@ #include "../base/stl_add.hpp" #include "../base/assert.hpp" +namespace dp +{ + namespace { @@ -67,3 +70,5 @@ RefPointer<Shader> GpuProgramManager::GetShader(int index, string const & source else return it->second.GetRefPointer(); } + +} // namespace dp diff --git a/drape/gpu_program_manager.hpp b/drape/gpu_program_manager.hpp index cf3aeb4ef4..e3d27dd04d 100644 --- a/drape/gpu_program_manager.hpp +++ b/drape/gpu_program_manager.hpp @@ -7,6 +7,9 @@ #include "../std/map.hpp" #include "../std/noncopyable.hpp" +namespace dp +{ + class GpuProgramManager : public noncopyable { public: @@ -23,3 +26,5 @@ private: program_map_t m_programs; shader_map_t m_shaders; }; + +} // namespace dp diff --git a/drape/index_buffer.cpp b/drape/index_buffer.cpp index 2d6dd0edf0..d2607123ea 100644 --- a/drape/index_buffer.cpp +++ b/drape/index_buffer.cpp @@ -1,5 +1,8 @@ #include "index_buffer.hpp" +namespace dp +{ + IndexBuffer::IndexBuffer(uint16_t capacity) : GPUBuffer(GPUBuffer::IndexBuffer, sizeof(uint16_t), capacity) { @@ -15,3 +18,5 @@ void IndexBuffer::UpdateData(uint16_t const * data, uint16_t size) GPUBuffer::Resize(size); UploadData(data, size); } + +} // namespace dp diff --git a/drape/index_buffer.hpp b/drape/index_buffer.hpp index 899a8c066d..14fe83b63c 100644 --- a/drape/index_buffer.hpp +++ b/drape/index_buffer.hpp @@ -2,6 +2,9 @@ #include "gpu_buffer.hpp" +namespace dp +{ + class IndexBuffer : public GPUBuffer { public: @@ -12,3 +15,5 @@ public: /// resize buffer to new size, and discard old data void UpdateData(uint16_t const * data, uint16_t size); }; + +} // namespace dp diff --git a/drape/index_buffer_mutator.cpp b/drape/index_buffer_mutator.cpp index 637c79b711..48a5e7876c 100644 --- a/drape/index_buffer_mutator.cpp +++ b/drape/index_buffer_mutator.cpp @@ -4,6 +4,9 @@ #include "../std/cstring.hpp" // for memcpy #include "../std/algorithm.hpp" // for max +namespace dp +{ + IndexBufferMutator::IndexBufferMutator(uint16_t baseSize) : m_activeSize(0) { @@ -30,3 +33,4 @@ uint16_t IndexBufferMutator::GetIndexCount() const return m_activeSize; } +} // namespace dp diff --git a/drape/index_buffer_mutator.hpp b/drape/index_buffer_mutator.hpp index 44884ff539..62fb81f57e 100644 --- a/drape/index_buffer_mutator.hpp +++ b/drape/index_buffer_mutator.hpp @@ -2,6 +2,9 @@ #include "pointers.hpp" +namespace dp +{ + class VertexArrayBuffer; class IndexBufferMutator @@ -20,3 +23,5 @@ private: vector<uint16_t> m_buffer; uint16_t m_activeSize; }; + +} // namespace dp diff --git a/drape/oglcontext.hpp b/drape/oglcontext.hpp index 942e3ef748..5581a75a0e 100644 --- a/drape/oglcontext.hpp +++ b/drape/oglcontext.hpp @@ -1,5 +1,8 @@ #pragma once +namespace dp +{ + class OGLContext { public: @@ -8,3 +11,5 @@ public: virtual void makeCurrent() = 0; virtual void setDefaultFramebuffer() = 0; }; + +} // namespace dp diff --git a/drape/oglcontextfactory.cpp b/drape/oglcontextfactory.cpp index 6a9aeb4a42..90665fd0d4 100644 --- a/drape/oglcontextfactory.cpp +++ b/drape/oglcontextfactory.cpp @@ -1,5 +1,7 @@ #include "oglcontextfactory.hpp" +namespace dp +{ ThreadSafeFactory::ThreadSafeFactory(OGLContextFactory * factory) : m_factory(factory) @@ -22,3 +24,5 @@ OGLContext *ThreadSafeFactory::getResourcesUploadContext() threads::MutexGuard lock(m_mutex); return m_factory->getResourcesUploadContext(); } + +} // namespace dp diff --git a/drape/oglcontextfactory.hpp b/drape/oglcontextfactory.hpp index 47730fa54a..0eae1995ad 100644 --- a/drape/oglcontextfactory.hpp +++ b/drape/oglcontextfactory.hpp @@ -4,6 +4,9 @@ #include "../base/mutex.hpp" +namespace dp +{ + class OGLContextFactory { public: @@ -24,3 +27,5 @@ private: OGLContextFactory * m_factory; threads::Mutex m_mutex; }; + +} // namespace dp diff --git a/drape/overlay_handle.cpp b/drape/overlay_handle.cpp index 4dc0e07588..f720bdc970 100644 --- a/drape/overlay_handle.cpp +++ b/drape/overlay_handle.cpp @@ -2,6 +2,9 @@ #include "../base/macros.hpp" +namespace dp +{ + struct OverlayHandle::OffsetNodeFinder { public: @@ -117,3 +120,5 @@ m2::RectD SquareHandle::GetPixelRect(ScreenBase const & screen) const result.Offset(offset); return result; } + +} // namespace dp diff --git a/drape/overlay_handle.hpp b/drape/overlay_handle.hpp index 41776b01b6..1106dffdc8 100644 --- a/drape/overlay_handle.hpp +++ b/drape/overlay_handle.hpp @@ -11,6 +11,8 @@ #include "../geometry/point2d.hpp" #include "../geometry/rect2d.hpp" +namespace dp +{ class OverlayHandle { @@ -78,3 +80,5 @@ private: m2::PointD m_gbPivot; m2::PointD m_pxHalfSize; }; + +} // namespace dp diff --git a/drape/overlay_tree.cpp b/drape/overlay_tree.cpp index 3fb4ccde64..172d69a1ef 100644 --- a/drape/overlay_tree.cpp +++ b/drape/overlay_tree.cpp @@ -2,6 +2,9 @@ #include "../std/bind.hpp" +namespace dp +{ + void OverlayTree::StartOverlayPlacing(ScreenBase const & screen, bool canOverlap) { m_modelView = screen; @@ -104,3 +107,5 @@ void OverlayTree::FindIntersectedFunctor::operator()(OverlayTree::Node const & n if (isIntersect) m_intersections.push_back(&node); } + +} // namespace dp diff --git a/drape/overlay_tree.hpp b/drape/overlay_tree.hpp index 6cfe68cd9b..29344086af 100644 --- a/drape/overlay_tree.hpp +++ b/drape/overlay_tree.hpp @@ -7,6 +7,9 @@ #include "../std/kdtree.hpp" +namespace dp +{ + class OverlayTree { public: @@ -59,3 +62,5 @@ private: find_result_t & m_intersections; }; }; + +} // namespace dp diff --git a/drape/pointers.cpp b/drape/pointers.cpp index 3ffdd24045..a59107e5c9 100644 --- a/drape/pointers.cpp +++ b/drape/pointers.cpp @@ -1,5 +1,8 @@ #include "pointers.hpp" +namespace dp +{ + PointerTracker::~PointerTracker() { ASSERT(m_countMap.empty(), ()); @@ -39,3 +42,5 @@ void PointerTracker::Destroy(void * p) #if defined(CHECK_POINTERS) PointerTracker g_tracker; #endif + +} // namespace dp diff --git a/drape/pointers.hpp b/drape/pointers.hpp index bf46924b91..6116bab638 100644 --- a/drape/pointers.hpp +++ b/drape/pointers.hpp @@ -5,6 +5,9 @@ #include "../std/map.hpp" +namespace dp +{ + class PointerTracker { public: @@ -282,3 +285,5 @@ private: value.Destroy(); } }; + +} // namespace dp diff --git a/drape/render_bucket.cpp b/drape/render_bucket.cpp index 8f50414aa0..9e627f1a73 100644 --- a/drape/render_bucket.cpp +++ b/drape/render_bucket.cpp @@ -8,6 +8,9 @@ #include "../base/stl_add.hpp" #include "../std/bind.hpp" +namespace dp +{ + RenderBucket::RenderBucket(TransferPointer<VertexArrayBuffer> buffer) : m_buffer(buffer) { @@ -67,3 +70,5 @@ void RenderBucket::Render() } m_buffer->Render(); } + +} // namespace dp diff --git a/drape/render_bucket.hpp b/drape/render_bucket.hpp index bcd778167c..0e6771f890 100644 --- a/drape/render_bucket.hpp +++ b/drape/render_bucket.hpp @@ -2,6 +2,10 @@ #include "pointers.hpp" + +namespace dp +{ + class OverlayHandle; class OverlayTree; class VertexArrayBuffer; @@ -23,3 +27,5 @@ private: vector<MasterPointer<OverlayHandle> > m_overlay; MasterPointer<VertexArrayBuffer> m_buffer; }; + +} // namespace dp diff --git a/drape/shader.cpp b/drape/shader.cpp index 77bd2b251b..ed27bdbdc6 100644 --- a/drape/shader.cpp +++ b/drape/shader.cpp @@ -3,6 +3,9 @@ #include "../base/assert.hpp" +namespace dp +{ + namespace { @@ -37,3 +40,5 @@ int Shader::GetID() const { return m_glID; } + +} // namespace dp diff --git a/drape/shader.hpp b/drape/shader.hpp index 2e4c482acc..31cdf02638 100644 --- a/drape/shader.hpp +++ b/drape/shader.hpp @@ -3,6 +3,9 @@ #include "../std/string.hpp" #include "../std/stdint.hpp" +namespace dp +{ + class Shader { public: @@ -22,3 +25,5 @@ private: Type m_type; uint32_t m_glID; }; + +} // namespace dp diff --git a/drape/symbols_texture.cpp b/drape/symbols_texture.cpp index c426c58b66..b1615f129b 100644 --- a/drape/symbols_texture.cpp +++ b/drape/symbols_texture.cpp @@ -8,6 +8,9 @@ #include "../base/string_utils.hpp" +namespace dp +{ + class SymbolsTexture::DefinitionLoader { public: @@ -176,3 +179,5 @@ void SymbolsTexture::Fail() int32_t alfaTexture = 0; Create(1, 1, Texture::RGBA8, MakeStackRefPointer(&alfaTexture)); } + +} // namespace dp diff --git a/drape/symbols_texture.hpp b/drape/symbols_texture.hpp index 349335f8f6..5fbc662c3e 100644 --- a/drape/symbols_texture.hpp +++ b/drape/symbols_texture.hpp @@ -5,6 +5,9 @@ #include "../std/string.hpp" #include "../std/map.hpp" +namespace dp +{ + class SymbolsTexture : public Texture { public: @@ -38,3 +41,5 @@ private: class DefinitionLoader; }; + +} // namespace dp diff --git a/drape/texture.cpp b/drape/texture.cpp index 06868277e4..b20f4f4fb9 100644 --- a/drape/texture.cpp +++ b/drape/texture.cpp @@ -7,6 +7,9 @@ #define ASSERT_ID ASSERT(GetID() != -1, ()) +namespace dp +{ + Texture::ResourceInfo::ResourceInfo(m2::RectF const & texRect) : m_texRect(texRect) {} @@ -144,3 +147,5 @@ int32_t Texture::GetID() const { return m_textureID; } + +} // namespace dp diff --git a/drape/texture.hpp b/drape/texture.hpp index fdf7f5073a..ed19b6f9b6 100644 --- a/drape/texture.hpp +++ b/drape/texture.hpp @@ -8,6 +8,9 @@ #include "../std/stdint.hpp" #include "../std/function.hpp" +namespace dp +{ + class Texture { public: @@ -76,3 +79,5 @@ private: uint32_t m_width; uint32_t m_height; }; + +} // namespace dp diff --git a/drape/texture_manager.cpp b/drape/texture_manager.cpp index 06b66686ab..14e9146ee8 100644 --- a/drape/texture_manager.cpp +++ b/drape/texture_manager.cpp @@ -12,6 +12,9 @@ #include "../std/vector.hpp" +namespace dp +{ + class TextureManager::TextureSet { public: @@ -168,3 +171,5 @@ uint32_t TextureSetBinder::GetTextureCount(uint32_t textureSet) const { return m_manager->GetTextureCount(textureSet); } + +} // namespace dp diff --git a/drape/texture_manager.hpp b/drape/texture_manager.hpp index 86402a8835..a733d92e63 100644 --- a/drape/texture_manager.hpp +++ b/drape/texture_manager.hpp @@ -6,6 +6,9 @@ #include "texture_set_holder.hpp" #include "texture_set_controller.hpp" +namespace dp +{ + class TextureManager : public TextureSetHolder { public: @@ -34,3 +37,5 @@ public: private: RefPointer<TextureManager> m_manager; }; + +} // namespace dp diff --git a/drape/texture_set_controller.hpp b/drape/texture_set_controller.hpp index 75ad546155..48e658472a 100644 --- a/drape/texture_set_controller.hpp +++ b/drape/texture_set_controller.hpp @@ -1,5 +1,8 @@ #pragma once +namespace dp +{ + class TextureSetController { public: @@ -7,3 +10,5 @@ public: virtual void BindTextureSet(uint32_t textureSet) const = 0; virtual uint32_t GetTextureCount(uint32_t textureSet) const = 0; }; + +} // namespace dp diff --git a/drape/texture_set_holder.cpp b/drape/texture_set_holder.cpp index 2eba7f56f8..3385693db3 100644 --- a/drape/texture_set_holder.cpp +++ b/drape/texture_set_holder.cpp @@ -2,6 +2,9 @@ #include "font_texture.hpp" +namespace dp +{ + TextureSetHolder::TextureNode::TextureNode() : m_width(-1) , m_height(-1) @@ -67,3 +70,5 @@ void TextureSetHolder::GlyphRegion::GetMetrics(float & xOffset, float & yOffset, FontTexture::GlyphInfo const * info = static_cast<FontTexture::GlyphInfo const *>(m_info); info->GetMetrics(xOffset, yOffset, advance); } + +} // namespace dp diff --git a/drape/texture_set_holder.hpp b/drape/texture_set_holder.hpp index 6d33bfe00d..c2ec0e0329 100644 --- a/drape/texture_set_holder.hpp +++ b/drape/texture_set_holder.hpp @@ -7,6 +7,9 @@ #include "../geometry/point2d.hpp" #include "../geometry/rect2d.hpp" +namespace dp +{ + class TextureSetHolder { public: @@ -60,3 +63,5 @@ public: virtual bool GetGlyphRegion(strings::UniChar charCode, GlyphRegion & region) const = 0; virtual int GetMaxTextureSet() const = 0; }; + +} // namespace dp diff --git a/drape/uniform_value.cpp b/drape/uniform_value.cpp index 32b766ec6c..3eb7c5f51a 100644 --- a/drape/uniform_value.cpp +++ b/drape/uniform_value.cpp @@ -3,6 +3,9 @@ #include "../base/assert.hpp" #include "../std/cstring.hpp" +namespace dp +{ + namespace { @@ -287,3 +290,5 @@ void UniformValue::Allocate(size_t byteCount) { m_values.reset(new uint8_t[byteCount]); } + +} // namespace dp diff --git a/drape/uniform_value.hpp b/drape/uniform_value.hpp index e8f1d80aaa..9307e2a879 100644 --- a/drape/uniform_value.hpp +++ b/drape/uniform_value.hpp @@ -7,6 +7,9 @@ #include "../std/shared_array.hpp" #include "../std/cstring.hpp" +namespace dp +{ + class UniformValue { public: @@ -87,3 +90,5 @@ private: shared_array<uint8_t> m_values; }; + +} // namespace dp diff --git a/drape/uniform_values_storage.cpp b/drape/uniform_values_storage.cpp index 492f897f96..2cbbc7645c 100644 --- a/drape/uniform_values_storage.cpp +++ b/drape/uniform_values_storage.cpp @@ -5,6 +5,9 @@ #include "../std/algorithm.hpp" #include "../std/bind.hpp" +namespace dp +{ + void UniformValuesStorage::SetIntValue(string const & name, int32_t v) { UniformValue * uniform = findByName(name); @@ -126,3 +129,5 @@ UniformValue * UniformValuesStorage::findByName(string const & name) return &(*it); } + +} // namespace dp diff --git a/drape/uniform_values_storage.hpp b/drape/uniform_values_storage.hpp index 1507387eda..7a319c64c9 100644 --- a/drape/uniform_values_storage.hpp +++ b/drape/uniform_values_storage.hpp @@ -6,6 +6,9 @@ #include "../std/string.hpp" #include "../std/function.hpp" +namespace dp +{ + class UniformValuesStorage { public: @@ -33,3 +36,5 @@ private: typedef vector<UniformValue> uniforms_t; uniforms_t m_uniforms; }; + +} // namespace dp diff --git a/drape/vertex_array_buffer.cpp b/drape/vertex_array_buffer.cpp index 4477fbb0af..b041a216a4 100644 --- a/drape/vertex_array_buffer.cpp +++ b/drape/vertex_array_buffer.cpp @@ -5,6 +5,9 @@ #include "../base/stl_add.hpp" #include "../base/assert.hpp" +namespace dp +{ + VertexArrayBuffer::VertexArrayBuffer(uint32_t indexBufferSize, uint32_t dataBufferSize) : m_VAO(0) , m_dataBufferSize(dataBufferSize) @@ -236,3 +239,5 @@ void VertexArrayBuffer::BindBuffers(TBuffersMap const & buffers) const } } } + +} // namespace dp diff --git a/drape/vertex_array_buffer.hpp b/drape/vertex_array_buffer.hpp index 90f09ebbf7..855ff32d56 100644 --- a/drape/vertex_array_buffer.hpp +++ b/drape/vertex_array_buffer.hpp @@ -10,6 +10,9 @@ #include "../std/map.hpp" +namespace dp +{ + class VertexArrayBuffer { typedef map<BindingInfo, MasterPointer<DataBuffer> > TBuffersMap; @@ -59,3 +62,5 @@ private: RefPointer<GpuProgram> m_program; }; + +} // namespace dp |