Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drape/attribute_provider.cpp7
-rw-r--r--drape/attribute_provider.hpp11
-rw-r--r--drape/batcher.cpp2
-rw-r--r--drape/batcher_helpers.cpp80
-rw-r--r--drape/batcher_helpers.hpp52
-rw-r--r--drape/binding_info.hpp6
-rw-r--r--drape/buffer_base.hpp9
-rw-r--r--drape/color.hpp30
-rw-r--r--drape/cpu_buffer.cpp10
-rw-r--r--drape/cpu_buffer.hpp17
-rw-r--r--drape/data_buffer.cpp4
-rw-r--r--drape/data_buffer.hpp2
-rw-r--r--drape/data_buffer_impl.hpp17
-rw-r--r--drape/drape_tests/buffer_tests.cpp24
-rw-r--r--drape/drape_tests/font_texture_tests.cpp2
-rw-r--r--drape/drape_tests/gl_functions.cpp20
-rw-r--r--drape/drape_tests/gl_mock_functions.hpp21
-rw-r--r--drape/drape_tests/glyph_mng_tests.cpp2
-rw-r--r--drape/drape_tests/testing_graphics_context.hpp8
-rw-r--r--drape/drape_tests/testingmain.cpp49
-rw-r--r--drape/gl_constants.hpp7
-rw-r--r--drape/gl_functions.cpp2
-rw-r--r--drape/gpu_buffer.cpp1
-rw-r--r--drape/gpu_buffer.hpp3
-rw-r--r--drape/graphics_context_factory.cpp3
-rw-r--r--drape/graphics_context_factory.hpp9
-rw-r--r--drape/hw_texture.cpp3
-rw-r--r--drape/hw_texture_ios.hpp2
-rw-r--r--drape/index_storage.cpp16
-rw-r--r--drape/index_storage.hpp13
-rw-r--r--drape/mesh_object.cpp1
-rw-r--r--drape/metal/metal_states.mm3
-rw-r--r--drape/render_state.cpp2
-rw-r--r--drape/support_manager.cpp2
-rw-r--r--drape/symbols_texture.hpp2
-rw-r--r--drape/texture.cpp1
-rw-r--r--drape/texture.hpp3
-rw-r--r--drape/texture_manager.cpp3
-rw-r--r--drape/utils/glyph_usage_tracker.cpp14
-rw-r--r--drape/utils/glyph_usage_tracker.hpp28
-rw-r--r--drape/utils/projection.cpp8
-rw-r--r--drape/utils/projection.hpp10
-rw-r--r--drape/vertex_array_buffer.cpp1
-rw-r--r--drape_frontend/apply_feature_functors.cpp3
-rw-r--r--drape_frontend/backend_renderer.hpp2
-rw-r--r--drape_frontend/drape_api_renderer.hpp2
-rwxr-xr-xdrape_frontend/frontend_renderer.cpp2
-rw-r--r--drape_frontend/rule_drawer.hpp2
-rw-r--r--drape_frontend/transit_scheme_builder.hpp3
-rw-r--r--drape_frontend/visual_params.cpp2
-rw-r--r--map/traffic_manager.hpp4
-rw-r--r--shaders/shaders_tests/gl_program_params_tests.cpp4
52 files changed, 271 insertions, 263 deletions
diff --git a/drape/attribute_provider.cpp b/drape/attribute_provider.cpp
index 768bcee738..9623b9c237 100644
--- a/drape/attribute_provider.cpp
+++ b/drape/attribute_provider.cpp
@@ -2,7 +2,7 @@
#include "base/assert.hpp"
#ifdef DEBUG
- #define INIT_CHECK_INFO(x) m_checkInfo = vector<bool>((vector<bool>::size_type)(x), false);
+ #define INIT_CHECK_INFO(x) m_checkInfo = std::vector<bool>((std::vector<bool>::size_type)(x), false);
#define CHECK_STREAMS CheckStreams()
#define INIT_STREAM(x) InitCheckStream((x))
#else
@@ -14,7 +14,6 @@
namespace dp
{
-
AttributeProvider::AttributeProvider(uint8_t streamCount, uint32_t vertexCount)
: m_vertexCount(vertexCount)
{
@@ -22,7 +21,6 @@ AttributeProvider::AttributeProvider(uint8_t streamCount, uint32_t vertexCount)
INIT_CHECK_INFO(streamCount);
}
-/// interface for batcher
bool AttributeProvider::IsDataExists() const
{
CHECK_STREAMS;
@@ -108,5 +106,4 @@ void AttributeProvider::InitCheckStream(uint8_t streamIndex)
m_checkInfo[streamIndex] = true;
}
#endif
-
-}
+} // namespace dp
diff --git a/drape/attribute_provider.hpp b/drape/attribute_provider.hpp
index a5aa46ddfa..8558458ba6 100644
--- a/drape/attribute_provider.hpp
+++ b/drape/attribute_provider.hpp
@@ -3,17 +3,15 @@
#include "drape/pointers.hpp"
#include "drape/binding_info.hpp"
-#include "std/vector.hpp"
+#include <vector>
namespace dp
{
-
class AttributeProvider
{
public:
AttributeProvider(uint8_t streamCount, uint32_t vertexCount);
- /// interface for batcher
bool IsDataExists() const;
uint32_t GetVertexCount() const;
@@ -38,12 +36,11 @@ private:
BindingInfo m_binding;
ref_ptr<void> m_data;
};
- vector<AttributeStream> m_streams;
+ std::vector<AttributeStream> m_streams;
#ifdef DEBUG
void CheckStreams() const;
void InitCheckStream(uint8_t streamIndex);
- vector<bool> m_checkInfo;
+ std::vector<bool> m_checkInfo;
#endif
};
-
-} // namespace dp
+} // namespace dp
diff --git a/drape/batcher.cpp b/drape/batcher.cpp
index 88f70985ed..278e466075 100644
--- a/drape/batcher.cpp
+++ b/drape/batcher.cpp
@@ -266,7 +266,7 @@ IndicesRange Batcher::InsertPrimitives(RenderState const & state, ref_ptr<Attrib
wrapper.SetVAO(vao);
TBatcher batch(wrapper, batcherArgs ...);
- batch.SetCanDevideStreams(handle == nullptr);
+ batch.SetCanDivideStreams(handle == nullptr);
batch.SetVertexStride(vertexStride);
batch.BatchData(params);
diff --git a/drape/batcher_helpers.cpp b/drape/batcher_helpers.cpp
index ecb4a5a82d..af80d1b5f6 100644
--- a/drape/batcher_helpers.cpp
+++ b/drape/batcher_helpers.cpp
@@ -2,47 +2,46 @@
#include "drape/attribute_provider.hpp"
#include "drape/cpu_buffer.hpp"
#include "drape/index_storage.hpp"
-#include "drape/gl_extensions_list.hpp"
#include "base/assert.hpp"
#include "base/math.hpp"
-#include "std/algorithm.hpp"
+#include <algorithm>
namespace dp
{
-
namespace
{
-
bool IsEnoughMemory(uint32_t avVertex, uint32_t existVertex, uint32_t avIndex, uint32_t existIndex)
{
return avVertex >= existVertex && avIndex >= existIndex;
}
-template<typename TGenerator> void GenerateIndices(void * indexStorage, uint32_t count, uint32_t startIndex)
+template<typename TGenerator>
+void GenerateIndices(void * indexStorage, uint32_t count, uint32_t startIndex)
{
GenerateIndices<TGenerator>(indexStorage, count, TGenerator(startIndex));
}
-template<typename TGenerator> void GenerateIndices(void * indexStorage, uint32_t count, TGenerator const & generator)
+template<typename TGenerator>
+void GenerateIndices(void * indexStorage, uint32_t count, TGenerator const & generator)
{
if (dp::IndexStorage::IsSupported32bit())
{
- uint32_t * pIndexStorage = static_cast<uint32_t *>(indexStorage);
- generate(pIndexStorage, pIndexStorage + count, generator);
+ auto pIndexStorage = static_cast<uint32_t *>(indexStorage);
+ std::generate(pIndexStorage, pIndexStorage + count, generator);
}
else
{
- uint16_t * pIndexStorage = static_cast<uint16_t *>(indexStorage);
- generate(pIndexStorage, pIndexStorage + count, generator);
+ auto pIndexStorage = static_cast<uint16_t *>(indexStorage);
+ std::generate(pIndexStorage, pIndexStorage + count, generator);
}
}
class IndexGenerator
{
public:
- IndexGenerator(uint32_t startIndex)
+ explicit IndexGenerator(uint32_t startIndex)
: m_startIndex(startIndex)
, m_counter(0)
, m_minStripCounter(0) {}
@@ -61,7 +60,7 @@ protected:
int16_t GetCWNormalizer()
{
int16_t tmp = m_minStripCounter;
- m_minStripCounter = base::cyclicClamp(m_minStripCounter + 1, 0, 5);
+ m_minStripCounter = static_cast<uint8_t>(base::cyclicClamp(m_minStripCounter + 1, 0, 5));
switch (tmp)
{
case 4: return 1;
@@ -78,14 +77,16 @@ private:
class ListIndexGenerator : public IndexGenerator
{
public:
- ListIndexGenerator(uint32_t startIndex) : IndexGenerator(startIndex) {}
+ explicit ListIndexGenerator(uint32_t startIndex)
+ : IndexGenerator(startIndex)
+ {}
uint32_t operator()() { return m_startIndex + GetCounter(); }
};
class StripIndexGenerator : public IndexGenerator
{
public:
- StripIndexGenerator(uint32_t startIndex)
+ explicit StripIndexGenerator(uint32_t startIndex)
: IndexGenerator(startIndex)
{}
@@ -99,7 +100,7 @@ public:
class LineStripIndexGenerator : public IndexGenerator
{
public:
- LineStripIndexGenerator(uint32_t startIndex)
+ explicit LineStripIndexGenerator(uint32_t startIndex)
: IndexGenerator(startIndex)
{}
@@ -120,7 +121,7 @@ private:
class LineRawIndexGenerator : public IndexGenerator
{
public:
- LineRawIndexGenerator(uint32_t startIndex, vector<int> const & indices)
+ LineRawIndexGenerator(uint32_t startIndex, std::vector<int> const & indices)
: IndexGenerator(startIndex)
, m_indices(indices)
{}
@@ -133,13 +134,15 @@ public:
}
private:
- vector<int> const & m_indices;
+ std::vector<int> const & m_indices;
};
class FanIndexGenerator : public IndexGenerator
{
public:
- FanIndexGenerator(uint32_t startIndex) : IndexGenerator(startIndex) {}
+ explicit FanIndexGenerator(uint32_t startIndex)
+ : IndexGenerator(startIndex)
+ {}
uint32_t operator()()
{
@@ -178,25 +181,24 @@ private:
uint32_t m_indexPerStrip;
uint32_t m_base;
};
-
-} // namespace
+} // namespace
UniversalBatch::UniversalBatch(BatchCallbacks & callbacks, uint8_t minVerticesCount,
uint8_t minIndicesCount)
: m_callbacks(callbacks)
- , m_canDevideStreams(true)
+ , m_canDivideStreams(true)
, m_minVerticesCount(minVerticesCount)
, m_minIndicesCount(minIndicesCount)
{}
-void UniversalBatch::SetCanDevideStreams(bool canDevide)
+void UniversalBatch::SetCanDivideStreams(bool canDivide)
{
- m_canDevideStreams = canDevide;
+ m_canDivideStreams = canDivide;
}
bool UniversalBatch::CanDevideStreams() const
{
- return m_canDevideStreams;
+ return m_canDivideStreams;
}
void UniversalBatch::SetVertexStride(uint8_t vertexStride)
@@ -272,8 +274,8 @@ void TriangleListBatch::BatchData(ref_ptr<AttributeProvider> streams)
if (CanDevideStreams())
{
- vertexCount = min(vertexCount, avVertex);
- vertexCount = min(vertexCount, avIndex);
+ vertexCount = std::min(vertexCount, avVertex);
+ vertexCount = std::min(vertexCount, avIndex);
ASSERT(vertexCount >= 3, ());
vertexCount -= vertexCount % 3;
}
@@ -296,7 +298,6 @@ void TriangleListBatch::BatchData(ref_ptr<AttributeProvider> streams)
}
}
-
LineStripBatch::LineStripBatch(BatchCallbacks & callbacks)
: TBase(callbacks, 2 /* minVerticesCount */, 2 /* minIndicesCount */)
{}
@@ -332,8 +333,7 @@ void LineStripBatch::BatchData(ref_ptr<AttributeProvider> streams)
}
}
-
-LineRawBatch::LineRawBatch(BatchCallbacks & callbacks, vector<int> const & indices)
+LineRawBatch::LineRawBatch(BatchCallbacks & callbacks, std::vector<int> const & indices)
: TBase(callbacks, 2 /* minVerticesCount */, 2 /* minIndicesCount */)
, m_indices(indices)
{}
@@ -349,7 +349,7 @@ void LineRawBatch::BatchData(ref_ptr<AttributeProvider> streams)
uint32_t avIndex = GetAvailableIndexCount();
uint32_t vertexCount = streams->GetVertexCount();
ASSERT_GREATER_OR_EQUAL(vertexCount, 2, ());
- uint32_t const indexCount = static_cast<uint32_t>(m_indices.size());
+ auto const indexCount = static_cast<uint32_t>(m_indices.size());
if (!IsEnoughMemory(avVertex, vertexCount, avIndex, indexCount))
{
@@ -370,7 +370,6 @@ void LineRawBatch::BatchData(ref_ptr<AttributeProvider> streams)
}
}
-
FanStripHelper::FanStripHelper(BatchCallbacks & callbacks)
: TBase(callbacks, 3 /* minVerticesCount */, 3 /* minIndicesCount */)
, m_isFullUploaded(false)
@@ -481,7 +480,6 @@ void TriangleStripBatch::GenerateIndexes(void * indexStorage, uint32_t count, ui
TriangleFanBatch::TriangleFanBatch(BatchCallbacks & callbacks) : TBase(callbacks) {}
-
/*
* What happens here
*
@@ -502,7 +500,7 @@ TriangleFanBatch::TriangleFanBatch(BatchCallbacks & callbacks) : TBase(callbacks
*/
void TriangleFanBatch::BatchData(ref_ptr<AttributeProvider> streams)
{
- vector<CPUBuffer> cpuBuffers;
+ std::vector<CPUBuffer> cpuBuffers;
while (streams->IsDataExists())
{
if (IsBufferFilled(GetAvailableVertexCount(), GetAvailableIndexCount()))
@@ -513,7 +511,7 @@ void TriangleFanBatch::BatchData(ref_ptr<AttributeProvider> streams)
if (!cpuBuffers.empty())
{
- // if cpuBuffers not empty than on previous interation we not move data on gpu
+ // if cpuBuffers not empty than on previous integration we not move data on gpu
// and in cpuBuffers stored first vertex of fan.
// To avoid two separate call of glBufferSubData
// (for first vertex and for next part of data)
@@ -561,10 +559,10 @@ void TriangleFanBatch::BatchData(ref_ptr<AttributeProvider> streams)
const void * rawDataPointer = streams->GetRawPointer(i);
FlushData(binding, rawDataPointer, batchVertexCount);
- /// "(vertexCount + 1) - batchVertexCount" we allocate CPUBuffer on all remaining data
- /// + first vertex of fan, that must be duplicate in nex buffer
- /// + last vertex of currently uploaded data.
- cpuBuffers.push_back(CPUBuffer(binding.GetElementSize(), (vertexCount + 2) - batchVertexCount));
+ // "(vertexCount + 1) - batchVertexCount" we allocate CPUBuffer on all remaining data
+ // + first vertex of fan, that must be duplicate in nex buffer
+ // + last vertex of currently uploaded data.
+ cpuBuffers.emplace_back(binding.GetElementSize(), (vertexCount + 2) - batchVertexCount);
CPUBuffer & cpuBuffer = cpuBuffers.back();
cpuBuffer.UploadData(rawDataPointer, 1);
@@ -603,7 +601,8 @@ void TriangleListOfStripBatch::BatchData(ref_ptr<AttributeProvider> streams)
}
}
-bool TriangleListOfStripBatch::IsBufferFilled(uint32_t availableVerticesCount, uint32_t availableIndicesCount) const
+bool TriangleListOfStripBatch::IsBufferFilled(uint32_t availableVerticesCount,
+ uint32_t availableIndicesCount) const
{
uint8_t const vertexStride = GetVertexStride();
ASSERT_GREATER_OR_EQUAL(vertexStride, 4, ());
@@ -650,5 +649,4 @@ void TriangleListOfStripBatch::GenerateIndexes(void * indexStorage, uint32_t cou
uint8_t const vertexStride = GetVertexStride();
GenerateIndices(indexStorage, count, ListOfStripGenerator(startIndex, vertexStride, VtoICount(vertexStride)));
}
-
-} // namespace dp
+} // namespace dp
diff --git a/drape/batcher_helpers.hpp b/drape/batcher_helpers.hpp
index 1d8ee5ae3b..96c468ff34 100644
--- a/drape/batcher_helpers.hpp
+++ b/drape/batcher_helpers.hpp
@@ -2,18 +2,17 @@
#include "drape/pointers.hpp"
-#include "std/function.hpp"
-#include "std/vector.hpp"
+#include <vector>
namespace dp
{
-
class AttributeProvider;
class BindingInfo;
class BatchCallbacks
{
public:
+ virtual ~BatchCallbacks() = default;
virtual void FlushData(BindingInfo const & binding, void const * data, uint32_t count) = 0;
virtual void * GetIndexStorage(uint32_t indexCount, uint32_t & startIndex) = 0;
virtual void SubmitIndices() = 0;
@@ -26,10 +25,10 @@ class UniversalBatch
{
public:
UniversalBatch(BatchCallbacks & callbacks, uint8_t minVerticesCount, uint8_t minIndicesCount);
- virtual ~UniversalBatch(){}
+ virtual ~UniversalBatch() = default;
virtual void BatchData(ref_ptr<AttributeProvider> streams) = 0;
- void SetCanDevideStreams(bool canDevide);
+ void SetCanDivideStreams(bool canDivide);
bool CanDevideStreams() const;
void SetVertexStride(uint8_t vertexStride);
@@ -47,7 +46,7 @@ protected:
private:
BatchCallbacks & m_callbacks;
- bool m_canDevideStreams;
+ bool m_canDivideStreams;
uint8_t m_vertexStride;
uint8_t const m_minVerticesCount;
uint8_t const m_minIndicesCount;
@@ -58,7 +57,7 @@ class TriangleListBatch : public UniversalBatch
using TBase = UniversalBatch;
public:
- TriangleListBatch(BatchCallbacks & callbacks);
+ explicit TriangleListBatch(BatchCallbacks & callbacks);
void BatchData(ref_ptr<AttributeProvider> streams) override;
};
@@ -68,7 +67,7 @@ class LineStripBatch : public UniversalBatch
using TBase = UniversalBatch;
public:
- LineStripBatch(BatchCallbacks & callbacks);
+ explicit LineStripBatch(BatchCallbacks & callbacks);
void BatchData(ref_ptr<AttributeProvider> streams) override;
};
@@ -78,12 +77,12 @@ class LineRawBatch : public UniversalBatch
using TBase = UniversalBatch;
public:
- LineRawBatch(BatchCallbacks & callbacks, vector<int> const & indices);
+ LineRawBatch(BatchCallbacks & callbacks, std::vector<int> const & indices);
void BatchData(ref_ptr<AttributeProvider> streams) override;
private:
- vector<int> const & m_indices;
+ std::vector<int> const & m_indices;
};
class FanStripHelper : public UniversalBatch
@@ -91,7 +90,7 @@ class FanStripHelper : public UniversalBatch
using TBase = UniversalBatch;
public:
- FanStripHelper(BatchCallbacks & callbacks);
+ explicit FanStripHelper(BatchCallbacks & callbacks);
protected:
uint32_t BatchIndexes(uint32_t vertexCount);
@@ -114,11 +113,11 @@ class TriangleStripBatch : public FanStripHelper
using TBase = FanStripHelper;
public:
- TriangleStripBatch(BatchCallbacks & callbacks);
+ explicit TriangleStripBatch(BatchCallbacks & callbacks);
- virtual void BatchData(ref_ptr<AttributeProvider> streams);
+ void BatchData(ref_ptr<AttributeProvider> streams) override;
protected:
- virtual void GenerateIndexes(void * indexStorage, uint32_t count, uint32_t startIndex) const;
+ void GenerateIndexes(void * indexStorage, uint32_t count, uint32_t startIndex) const override;
};
class TriangleFanBatch : public FanStripHelper
@@ -126,11 +125,11 @@ class TriangleFanBatch : public FanStripHelper
using TBase = FanStripHelper;
public:
- TriangleFanBatch(BatchCallbacks & callbacks);
+ explicit TriangleFanBatch(BatchCallbacks & callbacks);
- virtual void BatchData(ref_ptr<AttributeProvider> streams);
+ void BatchData(ref_ptr<AttributeProvider> streams) override;
protected:
- virtual void GenerateIndexes(void * indexStorage, uint32_t count, uint32_t startIndex) const;
+ void GenerateIndexes(void * indexStorage, uint32_t count, uint32_t startIndex) const override;
};
class TriangleListOfStripBatch : public FanStripHelper
@@ -138,17 +137,16 @@ class TriangleListOfStripBatch : public FanStripHelper
using TBase = FanStripHelper;
public:
- TriangleListOfStripBatch(BatchCallbacks & callbacks);
+ explicit TriangleListOfStripBatch(BatchCallbacks & callbacks);
- virtual void BatchData(ref_ptr<AttributeProvider> streams);
+ void BatchData(ref_ptr<AttributeProvider> streams) override;
protected:
- virtual bool IsBufferFilled(uint32_t availableVerticesCount, uint32_t availableIndicesCount) const;
- virtual uint32_t VtoICount(uint32_t vCount) const;
- virtual uint32_t ItoVCount(uint32_t iCount) const;
- virtual uint32_t AlignVCount(uint32_t vCount) const;
- virtual uint32_t AlignICount(uint32_t iCount) const;
- virtual void GenerateIndexes(void * indexStorage, uint32_t count, uint32_t startIndex) const;
+ bool IsBufferFilled(uint32_t availableVerticesCount, uint32_t availableIndicesCount) const override;
+ uint32_t VtoICount(uint32_t vCount) const override;
+ uint32_t ItoVCount(uint32_t iCount) const override;
+ uint32_t AlignVCount(uint32_t vCount) const override;
+ uint32_t AlignICount(uint32_t iCount) const override;
+ void GenerateIndexes(void * indexStorage, uint32_t count, uint32_t startIndex) const override;
};
-
-} // namespace dp
+} // namespace dp
diff --git a/drape/binding_info.hpp b/drape/binding_info.hpp
index 3994bac2b5..50bcc0a6d4 100644
--- a/drape/binding_info.hpp
+++ b/drape/binding_info.hpp
@@ -12,7 +12,7 @@ namespace dp
{
struct BindingDecl
{
- string m_attributeName;
+ std::string m_attributeName;
uint8_t m_componentCount;
glConst m_componentType;
uint8_t m_stride;
@@ -44,7 +44,7 @@ protected:
};
template <typename TFieldType, typename TVertexType>
-uint8_t FillDecl(size_t index, string const & attrName, dp::BindingInfo & info, uint8_t offset)
+uint8_t FillDecl(size_t index, std::string const & attrName, dp::BindingInfo & info, uint8_t offset)
{
dp::BindingDecl & decl = info.GetBindingDecl(static_cast<uint16_t>(index));
decl.m_attributeName = attrName;
@@ -63,7 +63,7 @@ public:
explicit BindingFiller(uint8_t count, uint8_t id = 0) : m_info(count, id) {}
template <typename TFieldType>
- void FillDecl(string const & attrName)
+ void FillDecl(std::string const & attrName)
{
m_offset += dp::FillDecl<TFieldType, TVertex>(m_index, attrName, m_info, m_offset);
++m_index;
diff --git a/drape/buffer_base.hpp b/drape/buffer_base.hpp
index 78b0ee4194..013cbe68f3 100644
--- a/drape/buffer_base.hpp
+++ b/drape/buffer_base.hpp
@@ -1,14 +1,14 @@
#pragma once
-#include "std/cstdint.hpp"
+#include <cstdint>
namespace dp
{
-
class BufferBase
{
public:
BufferBase(uint8_t elementSize, uint32_t capacity);
+ virtual ~BufferBase() = default;
uint32_t GetCapacity() const;
uint32_t GetCurrentSize() const;
@@ -16,7 +16,7 @@ public:
uint8_t GetElementSize() const;
- void Seek(uint32_t elementNumber);
+ virtual void Seek(uint32_t elementNumber);
protected:
void Resize(uint32_t elementCount);
@@ -28,5 +28,4 @@ private:
uint32_t m_capacity;
uint32_t m_size;
};
-
-} // namespace dp
+} // namespace dp
diff --git a/drape/color.hpp b/drape/color.hpp
index 0fbb174dad..031c4140d5 100644
--- a/drape/color.hpp
+++ b/drape/color.hpp
@@ -2,13 +2,12 @@
#include "base/math.hpp"
-#include "std/cstdint.hpp"
-#include "std/sstream.hpp"
-#include "std/string.hpp"
+#include <cstdint>
+#include <sstream>
+#include <string>
namespace dp
{
-
struct Color
{
Color();
@@ -27,20 +26,20 @@ struct Color
bool operator==(Color const & other) const { return m_rgba == other.m_rgba; }
bool operator!=(Color const & other) const { return m_rgba != other.m_rgba; }
- bool operator< (Color const & other) const { return m_rgba < other.m_rgba; }
+ bool operator<(Color const & other) const { return m_rgba < other.m_rgba; }
+
Color operator*(float s) const
{
return Color(static_cast<uint8_t>(base::clamp(GetRedF() * s, 0.0f, 1.0f) * 255.0f),
static_cast<uint8_t>(base::clamp(GetGreenF() * s, 0.0f, 1.0f) * 255.0f),
- static_cast<uint8_t>(base::clamp(GetBlueF() * s, 0.0f, 1.0f) * 255.0f),
- GetAlpha());
+ static_cast<uint8_t>(base::clamp(GetBlueF() * s, 0.0f, 1.0f) * 255.0f), GetAlpha());
}
- static Color Black() { return Color(0, 0, 0, 255); }
- static Color White() { return Color(255, 255, 255, 255); }
- static Color Red() { return Color(255, 0, 0, 255); }
- static Color Green() { return Color(0, 255, 0, 255); }
- static Color Yellow() { return Color(255, 255, 0, 255); }
+ static Color Black() { return Color(0, 0, 0, 255); }
+ static Color White() { return Color(255, 255, 255, 255); }
+ static Color Red() { return Color(255, 0, 0, 255); }
+ static Color Green() { return Color(0, 255, 0, 255); }
+ static Color Yellow() { return Color(255, 255, 0, 255); }
static Color Transparent() { return Color(0, 0, 0, 0); }
private:
@@ -54,14 +53,13 @@ inline uint8_t ExtractAlpha(uint32_t argb);
Color Extract(uint32_t argb);
Color Extract(uint32_t xrgb, uint8_t a);
-inline string DebugPrint(Color const & c)
+inline std::string DebugPrint(Color const & c)
{
- ostringstream out;
+ std::ostringstream out;
out << "[R = " << static_cast<uint32_t>(c.GetRed())
<< ", G = " << static_cast<uint32_t>(c.GetGreen())
<< ", B = " << static_cast<uint32_t>(c.GetBlue())
<< ", A = " << static_cast<uint32_t>(c.GetAlpha()) << "]";
return out.str();
}
-
-}
+} // namespace dp
diff --git a/drape/cpu_buffer.cpp b/drape/cpu_buffer.cpp
index 69b6a34ae5..5e1b8a3472 100644
--- a/drape/cpu_buffer.cpp
+++ b/drape/cpu_buffer.cpp
@@ -4,11 +4,10 @@
#include "base/shared_buffer_manager.hpp"
#include "base/assert.hpp"
-#include "std/cstring.hpp"
+#include <cstring>
namespace dp
{
-
CPUBuffer::CPUBuffer(uint8_t elementSize, uint32_t capacity)
: TBase(elementSize, capacity)
{
@@ -19,7 +18,7 @@ CPUBuffer::CPUBuffer(uint8_t elementSize, uint32_t capacity)
CPUBuffer::~CPUBuffer()
{
- m_memoryCursor = NULL;
+ m_memoryCursor = nullptr;
SharedBufferManager::instance().freeSharedBuffer(m_memory->size(), m_memory);
}
@@ -45,7 +44,7 @@ void CPUBuffer::Seek(uint32_t elementNumber)
uint32_t CPUBuffer::GetCurrentElementNumber() const
{
- uint32_t pointerDiff = static_cast<uint32_t>(GetCursor() - Data());
+ auto pointerDiff = static_cast<uint32_t>(GetCursor() - Data());
ASSERT(pointerDiff % GetElementSize() == 0, ());
return pointerDiff / GetElementSize();
}
@@ -64,5 +63,4 @@ unsigned char * CPUBuffer::GetCursor() const
{
return m_memoryCursor;
}
-
-} // namespace dp
+} // namespace dp
diff --git a/drape/cpu_buffer.hpp b/drape/cpu_buffer.hpp
index addbce9bff..28a935b0f4 100644
--- a/drape/cpu_buffer.hpp
+++ b/drape/cpu_buffer.hpp
@@ -2,23 +2,22 @@
#include "drape/buffer_base.hpp"
-#include "std/vector.hpp"
-#include "std/shared_ptr.hpp"
+#include <memory>
+#include <vector>
namespace dp
{
-
class CPUBuffer : public BufferBase
{
- typedef BufferBase TBase;
+ using TBase = BufferBase;
public:
CPUBuffer(uint8_t elementSize, uint32_t capacity);
- ~CPUBuffer();
+ ~CPUBuffer() override;
void UploadData(void const * data, uint32_t elementCount);
// Set memory cursor on element with number == "elementNumber"
// Element numbers start from 0
- void Seek(uint32_t elementNumber);
+ void Seek(uint32_t elementNumber) override;
// Check function. In real world use must use it only in assert
uint32_t GetCurrentElementNumber() const;
unsigned char const * Data() const;
@@ -27,9 +26,7 @@ private:
unsigned char * NonConstData();
unsigned char * GetCursor() const;
-private:
unsigned char * m_memoryCursor;
- shared_ptr<vector<unsigned char> > m_memory;
+ std::shared_ptr<std::vector<unsigned char>> m_memory;
};
-
-} //namespace dp
+} // namespace dp
diff --git a/drape/data_buffer.cpp b/drape/data_buffer.cpp
index 672741fa9d..c659069b75 100644
--- a/drape/data_buffer.cpp
+++ b/drape/data_buffer.cpp
@@ -5,8 +5,7 @@ namespace dp
{
DataBuffer::DataBuffer(uint8_t elementSize, uint32_t capacity)
: m_impl(make_unique_dp<CpuBufferImpl>(elementSize, capacity))
-{
-}
+{}
ref_ptr<DataBufferBase> DataBuffer::GetBuffer() const
{
@@ -39,6 +38,7 @@ DataBufferMapper::DataBufferMapper(ref_ptr<DataBuffer> buffer, uint32_t elementO
}
DataBufferMapper::~DataBufferMapper() { m_buffer->GetBuffer()->Unmap(); }
+
void DataBufferMapper::UpdateData(void const * data, uint32_t elementOffset, uint32_t elementCount)
{
m_buffer->GetBuffer()->UpdateData(m_ptr, data, elementOffset, elementCount);
diff --git a/drape/data_buffer.hpp b/drape/data_buffer.hpp
index 15871a0326..627d84d202 100644
--- a/drape/data_buffer.hpp
+++ b/drape/data_buffer.hpp
@@ -8,7 +8,7 @@ namespace dp
class DataBufferBase
{
public:
- virtual ~DataBufferBase() {}
+ virtual ~DataBufferBase() = default;
virtual uint32_t GetCapacity() const = 0;
virtual uint32_t GetCurrentSize() const = 0;
virtual uint32_t GetAvailableSize() const = 0;
diff --git a/drape/data_buffer_impl.hpp b/drape/data_buffer_impl.hpp
index 1d46204a55..7b3d967912 100644
--- a/drape/data_buffer_impl.hpp
+++ b/drape/data_buffer_impl.hpp
@@ -4,7 +4,8 @@
#include "drape/data_buffer.hpp"
#include "drape/gpu_buffer.hpp"
-#include "std/utility.hpp"
+#include <cstdint>
+#include <utility>
namespace dp
{
@@ -14,7 +15,8 @@ class DataBufferImpl : public DataBufferBase
{
public:
template <typename... Args>
- DataBufferImpl(Args &&... params) : m_buffer(make_unique_dp<TBuffer>(forward<Args>(params)...))
+ DataBufferImpl(Args &&... params)
+ : m_buffer(make_unique_dp<TBuffer>(std::forward<Args>(params)...))
{}
uint32_t GetCapacity() const override { return m_buffer->GetCapacity(); }
@@ -22,6 +24,7 @@ public:
uint32_t GetAvailableSize() const override { return m_buffer->GetAvailableSize(); }
uint8_t GetElementSize() const override { return m_buffer->GetElementSize(); }
void Seek(uint32_t elementNumber) override { m_buffer->Seek(elementNumber); }
+
protected:
drape_ptr<TBuffer> m_buffer;
};
@@ -31,10 +34,12 @@ class CpuBufferImpl : public DataBufferImpl<CPUBuffer>
{
public:
template <typename... Args>
- CpuBufferImpl(Args &&... params) : DataBufferImpl(forward<Args>(params)...)
+ CpuBufferImpl(Args &&... params)
+ : DataBufferImpl(std::forward<Args>(params)...)
{}
void const * Data() const override { return m_buffer->Data(); }
+
void UploadData(void const * data, uint32_t elementCount) override
{
m_buffer->UploadData(data, elementCount);
@@ -49,6 +54,7 @@ public:
}
void Bind() override { ASSERT(false, ("Binding is unavailable for CPU buffer")); }
+
void * Map(uint32_t elementOffset, uint32_t elementCount) override
{
ASSERT(false, ("Mapping is unavailable for CPU buffer"));
@@ -63,7 +69,8 @@ class GpuBufferImpl : public DataBufferImpl<GPUBuffer>
{
public:
template <typename... Args>
- GpuBufferImpl(Args &&... params) : DataBufferImpl(forward<Args>(params)...)
+ GpuBufferImpl(Args &&... params)
+ : DataBufferImpl(std::forward<Args>(params)...)
{}
void const * Data() const override
@@ -84,10 +91,12 @@ public:
}
void Bind() override { m_buffer->Bind(); }
+
void * Map(uint32_t elementOffset, uint32_t elementCount) override
{
return m_buffer->Map(elementOffset, elementCount);
}
+
void Unmap() override { return m_buffer->Unmap(); }
};
} // namespace dp
diff --git a/drape/drape_tests/buffer_tests.cpp b/drape/drape_tests/buffer_tests.cpp
index b006403faf..bf753fc09d 100644
--- a/drape/drape_tests/buffer_tests.cpp
+++ b/drape/drape_tests/buffer_tests.cpp
@@ -7,8 +7,8 @@
#include "drape/index_buffer.hpp"
#include "drape/index_storage.hpp"
-#include "std/cstdlib.hpp"
-#include "std/unique_ptr.hpp"
+#include <cstdlib>
+#include <memory>
#include <gmock/gmock.h>
@@ -24,11 +24,12 @@ UNIT_TEST(CreateDestroyDataBufferTest)
InSequence s;
EXPECTGL(glGenBuffer()).WillOnce(Return(1));
EXPECTGL(glBindBuffer(1, gl_const::GLArrayBuffer));
- EXPECTGL(glBufferData(gl_const::GLArrayBuffer, 3 * 100 * sizeof(float), NULL, gl_const::GLDynamicDraw));
+ EXPECTGL(glBufferData(gl_const::GLArrayBuffer,
+ 3 * 100 * sizeof(float), nullptr, gl_const::GLDynamicDraw));
EXPECTGL(glBindBuffer(0, gl_const::GLArrayBuffer));
EXPECTGL(glDeleteBuffer(1));
- unique_ptr<DataBuffer> buffer(new DataBuffer(3 * sizeof(float), 100));
+ std::unique_ptr<DataBuffer> buffer(new DataBuffer(3 * sizeof(float), 100));
buffer->MoveToGPU(GPUBuffer::ElementBuffer);
}
@@ -37,11 +38,12 @@ UNIT_TEST(CreateDestroyIndexBufferTest)
InSequence s;
EXPECTGL(glGenBuffer()).WillOnce(Return(1));
EXPECTGL(glBindBuffer(1, gl_const::GLElementArrayBuffer));
- EXPECTGL(glBufferData(gl_const::GLElementArrayBuffer, 100 * dp::IndexStorage::SizeOfIndex(), NULL, gl_const::GLDynamicDraw));
+ EXPECTGL(glBufferData(gl_const::GLElementArrayBuffer,
+ 100 * dp::IndexStorage::SizeOfIndex(), nullptr, gl_const::GLDynamicDraw));
EXPECTGL(glBindBuffer(0, gl_const::GLElementArrayBuffer));
EXPECTGL(glDeleteBuffer(1));
- unique_ptr<DataBuffer> buffer(new IndexBuffer(100));
+ std::unique_ptr<DataBuffer> buffer(new IndexBuffer(100));
buffer->MoveToGPU(GPUBuffer::IndexBuffer);
}
@@ -51,12 +53,13 @@ UNIT_TEST(UploadDataTest)
for (int i = 0; i < 3 * 100; ++i)
data[i] = (float)i;
- unique_ptr<DataBuffer> buffer(new DataBuffer(3 * sizeof(float), 100));
+ std::unique_ptr<DataBuffer> buffer(new DataBuffer(3 * sizeof(float), 100));
InSequence s;
EXPECTGL(glGenBuffer()).WillOnce(Return(1));
EXPECTGL(glBindBuffer(1, gl_const::GLArrayBuffer));
- EXPECTGL(glBufferData(gl_const::GLArrayBuffer, 3 * 100 * sizeof(float), buffer->GetBuffer()->Data(), gl_const::GLDynamicDraw));
+ EXPECTGL(glBufferData(gl_const::GLArrayBuffer, 3 * 100 * sizeof(float),
+ buffer->GetBuffer()->Data(), gl_const::GLDynamicDraw));
EXPECTGL(glBindBuffer(0, gl_const::GLArrayBuffer));
EXPECTGL(glDeleteBuffer(1));
@@ -76,12 +79,13 @@ UNIT_TEST(ParticalUploadDataTest)
for (size_t i = 0; i < kPart2Size; ++i)
part2Data[i] = (float)i;
- unique_ptr<DataBuffer> buffer(new DataBuffer(3 * sizeof(float), 100));
+ std::unique_ptr<DataBuffer> buffer(new DataBuffer(3 * sizeof(float), 100));
InSequence s;
EXPECTGL(glGenBuffer()).WillOnce(Return(1));
EXPECTGL(glBindBuffer(1, gl_const::GLArrayBuffer));
- EXPECTGL(glBufferData(gl_const::GLArrayBuffer, 3 * 100 * sizeof(float), buffer->GetBuffer()->Data(), gl_const::GLDynamicDraw));
+ EXPECTGL(glBufferData(gl_const::GLArrayBuffer, 3 * 100 * sizeof(float),
+ buffer->GetBuffer()->Data(),gl_const::GLDynamicDraw));
EXPECTGL(glBindBuffer(0, gl_const::GLArrayBuffer));
EXPECTGL(glDeleteBuffer(1));
diff --git a/drape/drape_tests/font_texture_tests.cpp b/drape/drape_tests/font_texture_tests.cpp
index 8326b3b35a..3bbdfb34c7 100644
--- a/drape/drape_tests/font_texture_tests.cpp
+++ b/drape/drape_tests/font_texture_tests.cpp
@@ -11,6 +11,8 @@
#include "drape/font_texture.hpp"
#include "drape/glyph_manager.hpp"
+#include "std/target_os.hpp"
+
#include <functional>
#include <QtCore/QPoint>
diff --git a/drape/drape_tests/gl_functions.cpp b/drape/drape_tests/gl_functions.cpp
index 396d239c98..93da5c2afa 100644
--- a/drape/drape_tests/gl_functions.cpp
+++ b/drape/drape_tests/gl_functions.cpp
@@ -3,8 +3,6 @@
#include "base/assert.hpp"
-#include "std/string.hpp"
-
using namespace emul;
dp::ApiVersion GLFunctions::CurrentApiVersion = dp::ApiVersion::Invalid;
@@ -66,12 +64,12 @@ uint32_t GLFunctions::glCreateShader(glConst type)
return MOCK_CALL(glCreateShader(type));
}
-void GLFunctions::glShaderSource(uint32_t shaderID, string const & src, string const & defines)
+void GLFunctions::glShaderSource(uint32_t shaderID, std::string const & src, std::string const & defines)
{
MOCK_CALL(glShaderSource(shaderID, src));
}
-bool GLFunctions::glCompileShader(uint32_t shaderID, string & errorLog)
+bool GLFunctions::glCompileShader(uint32_t shaderID, std::string & errorLog)
{
return MOCK_CALL(glCompileShader(shaderID, errorLog));
}
@@ -96,7 +94,7 @@ void GLFunctions::glDetachShader(uint32_t programID, uint32_t shaderID)
MOCK_CALL(glDetachShader(programID, shaderID));
}
-bool GLFunctions::glLinkProgram(uint32_t programID, string & errorLog)
+bool GLFunctions::glLinkProgram(uint32_t programID, std::string & errorLog)
{
return MOCK_CALL(glLinkProgram(programID, errorLog));
}
@@ -111,12 +109,12 @@ void GLFunctions::glUseProgram(uint32_t programID)
MOCK_CALL(glUseProgram(programID));
}
-int8_t GLFunctions::glGetAttribLocation(uint32_t programID, string const & name)
+int8_t GLFunctions::glGetAttribLocation(uint32_t programID, std::string const & name)
{
return MOCK_CALL(glGetAttribLocation(programID, name));
}
-void GLFunctions::glBindAttribLocation(uint32_t programID, uint8_t index, string const & name)
+void GLFunctions::glBindAttribLocation(uint32_t programID, uint8_t index, std::string const & name)
{}
// Enable vertex attribute binding. To get attributeLocation need to call glGetAttributeLocation.
@@ -135,7 +133,7 @@ void GLFunctions::glVertexAttributePointer(int32_t attrLocation,
MOCK_CALL(glVertexAttributePointer(attrLocation, count, type, needNormalize, stride, offset));
}
-int8_t GLFunctions::glGetUniformLocation(uint32_t programID, string const & name)
+int8_t GLFunctions::glGetUniformLocation(uint32_t programID, std::string const & name)
{
return MOCK_CALL(glGetUniformLocation(programID, name));
}
@@ -190,7 +188,7 @@ uint32_t GLFunctions::glGetCurrentProgram()
return MOCK_CALL(glGetCurrentProgram());
}
-bool GLFunctions::glHasExtension(string const & extName)
+bool GLFunctions::glHasExtension(std::string const & extName)
{
return MOCK_CALL(glHasExtension(extName));
}
@@ -201,7 +199,7 @@ int32_t GLFunctions::glGetProgramiv(uint32_t program, glConst paramName)
}
void GLFunctions::glGetActiveUniform(uint32_t programID, uint32_t uniformIndex,
- int32_t * uniformSize, glConst * type, string &name)
+ int32_t * uniformSize, glConst * type, std::string & name)
{
MOCK_CALL(glGetActiveUniform(programID, uniformIndex, uniformSize, type, name));
}
@@ -247,7 +245,7 @@ int32_t GLFunctions::glGetInteger(glConst pname)
return MOCK_CALL(glGetInteger(pname));
}
-string GLFunctions::glGetString(glConst pname)
+std::string GLFunctions::glGetString(glConst pname)
{
return MOCK_CALL(glGetString(pname));
}
diff --git a/drape/drape_tests/gl_mock_functions.hpp b/drape/drape_tests/gl_mock_functions.hpp
index 06d01704e3..bfb4fd2370 100644
--- a/drape/drape_tests/gl_mock_functions.hpp
+++ b/drape/drape_tests/gl_mock_functions.hpp
@@ -5,6 +5,8 @@
#include <gmock/gmock.h>
+#include <string>
+
namespace emul
{
class GLMockFunctions
@@ -30,7 +32,7 @@ public:
MOCK_METHOD4(glBufferSubData, void(glConst target, uint32_t size, void const * data, uint32_t offset));
MOCK_METHOD2(glGetBufferParameter, int32_t(glConst target, glConst name));
- MOCK_METHOD2(glGetUniformLocation, int8_t(uint32_t programID, string const & name));
+ MOCK_METHOD2(glGetUniformLocation, int8_t(uint32_t programID, std::string const & name));
MOCK_METHOD2(glUniformValuei, void(int8_t location, int32_t v));
MOCK_METHOD3(glUniformValuei, void(int8_t location, int32_t v1, int32_t v2));
MOCK_METHOD4(glUniformValuei, void(int8_t location, int32_t v1, int32_t v2, int32_t v3));
@@ -44,17 +46,17 @@ public:
MOCK_METHOD0(glGetCurrentProgram, uint32_t());
MOCK_METHOD1(glCreateShader, uint32_t(glConst type));
- MOCK_METHOD2(glShaderSource, void(uint32_t shaderID, string const & src));
- MOCK_METHOD2(glCompileShader, bool(uint32_t shaderID, string & errorLog));
+ MOCK_METHOD2(glShaderSource, void(uint32_t shaderID, std::string const & src));
+ MOCK_METHOD2(glCompileShader, bool(uint32_t shaderID, std::string & errorLog));
MOCK_METHOD1(glDeleteShader, void(uint32_t shaderID));
MOCK_METHOD0(glCreateProgram, uint32_t());
MOCK_METHOD2(glAttachShader, void(uint32_t programID, uint32_t shaderID));
MOCK_METHOD2(glDetachShader, void(uint32_t programID, uint32_t shaderID));
- MOCK_METHOD2(glLinkProgram, bool(uint32_t programID, string & errorLog));
+ MOCK_METHOD2(glLinkProgram, bool(uint32_t programID, std::string & errorLog));
MOCK_METHOD1(glDeleteProgram, void(uint32_t programID));
- MOCK_METHOD2(glGetAttribLocation, int32_t(uint32_t programID, string const & name));
+ MOCK_METHOD2(glGetAttribLocation, int32_t(uint32_t programID, std::string const & name));
MOCK_METHOD1(glEnableVertexAttribute, void(int32_t attributeLocation));
MOCK_METHOD6(glVertexAttributePointer, void(int32_t attrLocation,
uint32_t count,
@@ -64,13 +66,12 @@ public:
uint32_t offset));
MOCK_METHOD1(glUseProgram, void(uint32_t programID));
- MOCK_METHOD1(glHasExtension, bool(string const & extName));
+ MOCK_METHOD1(glHasExtension, bool(std::string const & extName));
MOCK_METHOD2(glGetProgramiv, int32_t(uint32_t, glConst));
- MOCK_METHOD5(glGetActiveUniform, void(uint32_t, uint32_t,
- int32_t*, glConst *,
- string &));
+ MOCK_METHOD5(glGetActiveUniform, void(uint32_t, uint32_t, int32_t*, glConst *,
+ std::string &));
// Texture functions
MOCK_METHOD1(glActiveTexture, void(glConst));
@@ -82,7 +83,7 @@ public:
MOCK_METHOD2(glTexParameter, void(glConst, glConst));
MOCK_METHOD1(glGetInteger, int32_t(glConst));
- MOCK_METHOD1(glGetString, string(glConst));
+ MOCK_METHOD1(glGetString, std::string(glConst));
MOCK_METHOD0(glGetMaxLineWidth, int32_t());
MOCK_METHOD1(glLineWidth, void(uint32_t value));
diff --git a/drape/drape_tests/glyph_mng_tests.cpp b/drape/drape_tests/glyph_mng_tests.cpp
index ad156dc0ba..0c4a6be025 100644
--- a/drape/drape_tests/glyph_mng_tests.cpp
+++ b/drape/drape_tests/glyph_mng_tests.cpp
@@ -9,6 +9,8 @@
#include "qt_tstfrm/test_main_loop.hpp"
+#include "std/target_os.hpp"
+
#include <cstring>
#include <functional>
#include <memory>
diff --git a/drape/drape_tests/testing_graphics_context.hpp b/drape/drape_tests/testing_graphics_context.hpp
index b65fdfe6f3..380f7260d1 100644
--- a/drape/drape_tests/testing_graphics_context.hpp
+++ b/drape/drape_tests/testing_graphics_context.hpp
@@ -6,13 +6,16 @@
class TestingGraphicsContext : public dp::GraphicsContext
{
public:
+ TestingGraphicsContext() = default;
+ explicit TestingGraphicsContext(dp::ApiVersion apiVersion) : m_apiVersion(apiVersion) {}
+
void Present() override {}
void MakeCurrent() override {}
void SetFramebuffer(ref_ptr<dp::BaseFramebuffer> framebuffer) override {}
void ApplyFramebuffer(std::string const & framebufferLabel) override {}
void Init(dp::ApiVersion apiVersion) override {}
- dp::ApiVersion GetApiVersion() const override { return dp::ApiVersion::OpenGLES2; }
+ dp::ApiVersion GetApiVersion() const override { return m_apiVersion; }
std::string GetRendererName() const override { return {}; }
std::string GetRendererVersion() const override { return {}; }
@@ -26,4 +29,7 @@ public:
void SetStencilFunction(dp::StencilFace face, dp::TestFunction stencilFunction) override {}
void SetStencilActions(dp::StencilFace face, dp::StencilAction stencilFailAction,
dp::StencilAction depthFailAction, dp::StencilAction passAction) override {}
+
+private:
+ dp::ApiVersion m_apiVersion = dp::ApiVersion::OpenGLES2;
};
diff --git a/drape/drape_tests/testingmain.cpp b/drape/drape_tests/testingmain.cpp
index 4cde0e6c90..3162df67c7 100644
--- a/drape/drape_tests/testingmain.cpp
+++ b/drape/drape_tests/testingmain.cpp
@@ -4,12 +4,13 @@
#include "base/logging.hpp"
#include "base/scope_guard.hpp"
-#include "std/algorithm.hpp"
-#include "std/iostream.hpp"
-#include "std/string.hpp"
-#include "std/vector.hpp"
#include "std/target_os.hpp"
-#include "std/bind.hpp"
+
+#include <algorithm>
+#include <functional>
+#include <iostream>
+#include <string>
+#include <vector>
#include "drape/drape_tests/gl_mock_functions.hpp"
@@ -39,16 +40,17 @@ int main(int argc, char * argv[])
base::ScopedLogLevelChanger const infoLogLevel(LINFO);
emul::GLMockFunctions::Init(&argc, argv);
- SCOPE_GUARD(GLMockScope, bind(&emul::GLMockFunctions::Teardown));
- vector<string> testNames;
- vector<bool> testResults;
+ SCOPE_GUARD(GLMockScope, std::bind(&emul::GLMockFunctions::Teardown));
+
+ std::vector<std::string> testNames;
+ std::vector<bool> testResults;
int numFailedTests = 0;
for (TestRegister * pTest = TestRegister::FirstRegister(); pTest; pTest = pTest->m_pNext)
{
- string fileName(pTest->m_FileName);
- string testName(pTest->m_TestName);
+ std::string fileName(pTest->m_FileName);
+ std::string testName(pTest->m_TestName);
// Retrieve fine file name
{
int iFirstSlash = static_cast<int>(fileName.size()) - 1;
@@ -65,11 +67,11 @@ int main(int argc, char * argv[])
int iTest = 0;
for (TestRegister * pTest = TestRegister::FirstRegister(); pTest; ++iTest, pTest = pTest->m_pNext)
{
- cerr << "Running " << testNames[iTest] << endl << flush;
+ std::cerr << "Running " << testNames[iTest] << std::endl << std::flush;
if (!g_bLastTestOK)
{
// Somewhere else global variables have been reset.
- cerr << "\n\nSOMETHING IS REALLY WRONG IN THE UNIT TEST FRAMEWORK!!!" << endl;
+ std::cerr << "\n\nSOMETHING IS REALLY WRONG IN THE UNIT TEST FRAMEWORK!!!" << std::endl;
return 5;
}
try
@@ -80,7 +82,7 @@ int main(int argc, char * argv[])
if (g_bLastTestOK)
{
- cerr << "OK" << endl;
+ std::cerr << "OK" << std::endl;
}
else
{
@@ -90,18 +92,21 @@ int main(int argc, char * argv[])
++numFailedTests;
}
- } catch (TestFailureException const & )
+ }
+ catch (TestFailureException const &)
{
testResults[iTest] = false;
++numFailedTests;
- } catch (std::exception const & ex)
+ }
+ catch (std::exception const & ex)
{
- cerr << "FAILED" << endl << "<<<Exception thrown [" << ex.what() << "].>>>" << endl;
+ std::cerr << "FAILED" << endl << "<<<Exception thrown [" << ex.what() << "].>>>" << std::endl;
testResults[iTest] = false;
++numFailedTests;
- } catch (...)
+ }
+ catch (...)
{
- cerr << "FAILED" << endl << "<<<Unknown exception thrown.>>>" << endl;
+ std::cerr << "FAILED" << endl << "<<<Unknown exception thrown.>>>" << std::endl;
testResults[iTest] = false;
++numFailedTests;
}
@@ -110,18 +115,18 @@ int main(int argc, char * argv[])
if (numFailedTests == 0)
{
- cerr << endl << "All tests passed." << endl << flush;
+ std::cerr << std::endl << "All tests passed." << std::endl << std::flush;
return 0;
}
else
{
- cerr << endl << numFailedTests << " tests failed:" << endl;
+ std::cerr << std::endl << numFailedTests << " tests failed:" << std::endl;
for (size_t i = 0; i < testNames.size(); ++i)
{
if (!testResults[i])
- cerr << testNames[i] << endl;
+ std::cerr << testNames[i] << std::endl;
}
- cerr << "Some tests FAILED." << endl << flush;
+ std::cerr << "Some tests FAILED." << std::endl << flush;
return 1;
}
}
diff --git a/drape/gl_constants.hpp b/drape/gl_constants.hpp
index 9517174334..fa98924b23 100644
--- a/drape/gl_constants.hpp
+++ b/drape/gl_constants.hpp
@@ -1,8 +1,8 @@
#pragma once
-#include "std/cstdint.hpp"
+#include <cstdint>
-typedef uint32_t glConst;
+using glConst = uint32_t;
namespace gl_const
{
@@ -188,5 +188,4 @@ extern const glConst GLDepthStencilAttachment;
/// Framebuffer status
extern const glConst GLFramebufferComplete;
-
-} // namespace GLConst
+} // namespace gl_const
diff --git a/drape/gl_functions.cpp b/drape/gl_functions.cpp
index ddde95461c..cd784901f7 100644
--- a/drape/gl_functions.cpp
+++ b/drape/gl_functions.cpp
@@ -8,6 +8,8 @@
#include "base/mutex.hpp"
#include "base/string_utils.hpp"
+#include "std/target_os.hpp"
+
#include <algorithm>
#include <limits>
#include <map>
diff --git a/drape/gpu_buffer.cpp b/drape/gpu_buffer.cpp
index 7c80e85887..be80ea5658 100644
--- a/drape/gpu_buffer.cpp
+++ b/drape/gpu_buffer.cpp
@@ -1,6 +1,5 @@
#include "drape/gpu_buffer.hpp"
#include "drape/drape_diagnostics.hpp"
-#include "drape/gl_extensions_list.hpp"
#include "drape/gl_functions.hpp"
#include "drape/utils/gpu_mem_tracker.hpp"
diff --git a/drape/gpu_buffer.hpp b/drape/gpu_buffer.hpp
index b04ef21ff8..5265958865 100644
--- a/drape/gpu_buffer.hpp
+++ b/drape/gpu_buffer.hpp
@@ -18,7 +18,7 @@ public:
public:
GPUBuffer(Target t, void const * data, uint8_t elementSize, uint32_t capacity);
- ~GPUBuffer();
+ ~GPUBuffer() override;
void UploadData(void const * data, uint32_t elementCount);
void Bind();
@@ -32,7 +32,6 @@ protected:
void Resize(void const * data, uint32_t elementCount);
private:
- friend class GPUBufferMapper;
Target m_t;
uint32_t m_bufferID;
uint32_t m_mappingOffset;
diff --git a/drape/graphics_context_factory.cpp b/drape/graphics_context_factory.cpp
index d3bc5728bc..18457d3188 100644
--- a/drape/graphics_context_factory.cpp
+++ b/drape/graphics_context_factory.cpp
@@ -24,7 +24,8 @@ GraphicsContext * ThreadSafeFactory::GetResourcesUploadContext()
[this](){ return m_factory->IsDrawContextCreated(); });
}
-GraphicsContext * ThreadSafeFactory::CreateContext(TCreateCtxFn const & createFn, TIsSeparateCreatedFn const checkFn)
+GraphicsContext * ThreadSafeFactory::CreateContext(TCreateCtxFn const & createFn,
+ TIsSeparateCreatedFn const & checkFn)
{
threads::ConditionGuard g(m_condition);
GraphicsContext * ctx = createFn();
diff --git a/drape/graphics_context_factory.hpp b/drape/graphics_context_factory.hpp
index 423beff117..395c06a56c 100644
--- a/drape/graphics_context_factory.hpp
+++ b/drape/graphics_context_factory.hpp
@@ -5,7 +5,7 @@
#include "base/condition.hpp"
#include "base/assert.hpp"
-#include "std/function.hpp"
+#include <functional>
namespace dp
{
@@ -40,9 +40,10 @@ public:
void SetPresentAvailable(bool available) override;
protected:
- typedef function<GraphicsContext * ()> TCreateCtxFn;
- typedef function<bool()> TIsSeparateCreatedFn;
- GraphicsContext * CreateContext(TCreateCtxFn const & createFn, TIsSeparateCreatedFn const checkFn);
+ using TCreateCtxFn = std::function<GraphicsContext * ()>;
+ using TIsSeparateCreatedFn = std::function<bool()>;
+ GraphicsContext * CreateContext(TCreateCtxFn const & createFn,
+ TIsSeparateCreatedFn const & checkFn);
private:
GraphicsContextFactory * m_factory;
diff --git a/drape/hw_texture.cpp b/drape/hw_texture.cpp
index a14a5a47d9..06297605d6 100644
--- a/drape/hw_texture.cpp
+++ b/drape/hw_texture.cpp
@@ -1,6 +1,5 @@
#include "drape/hw_texture.hpp"
-#include "drape/gl_extensions_list.hpp"
#include "drape/gl_functions.hpp"
#include "drape/utils/gpu_mem_tracker.hpp"
@@ -9,6 +8,8 @@
#include "base/logging.hpp"
#include "base/math.hpp"
+#include "std/target_os.hpp"
+
#if defined(OMIM_OS_IPHONE)
#include "drape/hw_texture_ios.hpp"
diff --git a/drape/hw_texture_ios.hpp b/drape/hw_texture_ios.hpp
index 2825d8599e..b6d52d6441 100644
--- a/drape/hw_texture_ios.hpp
+++ b/drape/hw_texture_ios.hpp
@@ -3,6 +3,8 @@
#include "drape/gl_constants.hpp"
#include "drape/hw_texture.hpp"
+#include "std/target_os.hpp"
+
#ifndef OMIM_OS_IPHONE
#error Only for iOS
#endif
diff --git a/drape/index_storage.cpp b/drape/index_storage.cpp
index 52322a4a98..5f6bb8fc91 100644
--- a/drape/index_storage.cpp
+++ b/drape/index_storage.cpp
@@ -1,26 +1,25 @@
#include "drape/index_storage.hpp"
-#include "drape/gl_extensions_list.hpp"
+#include "drape/gl_functions.hpp"
-#include "std/utility.hpp"
+#include <utility>
namespace dp
{
-
IndexStorage::IndexStorage()
: m_size(0)
{}
-IndexStorage::IndexStorage(vector<uint32_t> && initial)
+IndexStorage::IndexStorage(std::vector<uint32_t> && initial)
{
m_size = (uint32_t)initial.size();
if (IsSupported32bit())
{
- m_storage = move(initial);
+ m_storage = std::move(initial);
}
else
{
- /// we pack 2 uint16_t indices into single m_storage element
- /// every element of "initial" vector is single index
+ // We pack 2 uint16_t indices into single m_storage element.
+ // Every element of "initial" vector is a single index.
m_storage.resize(GetStorageSize(m_size));
for (size_t i = 0; i < initial.size(); i++)
{
@@ -70,5 +69,4 @@ uint32_t IndexStorage::GetStorageSize(uint32_t elementsCount) const
{
return IsSupported32bit() ? elementsCount : (elementsCount / 2 + 1);
}
-
-}
+} // namespace dp
diff --git a/drape/index_storage.hpp b/drape/index_storage.hpp
index 447f28d351..0a5a8714aa 100644
--- a/drape/index_storage.hpp
+++ b/drape/index_storage.hpp
@@ -1,16 +1,15 @@
#pragma once
-#include "std/vector.hpp"
-#include "std/cstdint.hpp"
+#include <cstdint>
+#include <vector>
namespace dp
{
-
class IndexStorage
{
public:
IndexStorage();
- IndexStorage(vector<uint32_t> && initial);
+ explicit IndexStorage(std::vector<uint32_t> && initial);
uint32_t Size() const;
void Resize(uint32_t size);
@@ -22,11 +21,9 @@ public:
static uint32_t SizeOfIndex();
private:
- vector<uint32_t> m_storage;
+ std::vector<uint32_t> m_storage;
uint32_t m_size;
uint32_t GetStorageSize(uint32_t elementsCount) const;
};
-
-
-} // namespace dp
+} // namespace dp
diff --git a/drape/mesh_object.cpp b/drape/mesh_object.cpp
index fa76639193..d898afb5ac 100644
--- a/drape/mesh_object.cpp
+++ b/drape/mesh_object.cpp
@@ -2,7 +2,6 @@
#include "drape/gl_constants.hpp"
#include "drape/gl_gpu_program.hpp"
-#include "drape/gl_extensions_list.hpp"
#include "drape/gl_functions.hpp"
#include "drape/glsl_func.hpp"
#include "drape/glsl_types.hpp"
diff --git a/drape/metal/metal_states.mm b/drape/metal/metal_states.mm
index 37bc5ab702..f55a32f412 100644
--- a/drape/metal/metal_states.mm
+++ b/drape/metal/metal_states.mm
@@ -4,7 +4,6 @@
#include <algorithm>
#include <string>
-#include <vector>
#include <utility>
namespace dp
@@ -23,7 +22,7 @@ uint8_t constexpr kStencilFrontFailActionByte = 2;
uint8_t constexpr kStencilFrontDepthFailActionByte = 1;
uint8_t constexpr kStencilFrontPassActionByte = 0;
-// Stencil package.
+// Sampler package.
uint8_t constexpr kWrapSModeByte = 3;
uint8_t constexpr kWrapTModeByte = 2;
uint8_t constexpr kMagFilterByte = 1;
diff --git a/drape/render_state.cpp b/drape/render_state.cpp
index 9765486922..eb797fc404 100644
--- a/drape/render_state.cpp
+++ b/drape/render_state.cpp
@@ -4,6 +4,8 @@
#include "base/buffer_vector.hpp"
+#include "std/target_os.hpp"
+
namespace dp
{
namespace
diff --git a/drape/support_manager.cpp b/drape/support_manager.cpp
index 939cc3797f..65af54dc70 100644
--- a/drape/support_manager.cpp
+++ b/drape/support_manager.cpp
@@ -7,6 +7,8 @@
#include "3party/Alohalytics/src/alohalytics.h"
+#include "std/target_os.hpp"
+
#include <algorithm>
#include <string>
#include <vector>
diff --git a/drape/symbols_texture.hpp b/drape/symbols_texture.hpp
index c18d488b81..3b8dae8c22 100644
--- a/drape/symbols_texture.hpp
+++ b/drape/symbols_texture.hpp
@@ -14,7 +14,7 @@ public:
class SymbolKey : public Key
{
public:
- explicit SymbolKey(string const & symbolName);
+ explicit SymbolKey(std::string const & symbolName);
ResourceType GetType() const override;
std::string const & GetSymbolName() const;
diff --git a/drape/texture.cpp b/drape/texture.cpp
index 948b55f1ac..5a3d43e6fa 100644
--- a/drape/texture.cpp
+++ b/drape/texture.cpp
@@ -1,6 +1,5 @@
#include "drape/texture.hpp"
-#include "drape/gl_extensions_list.hpp"
#include "drape/gl_functions.hpp"
#include "drape/glsl_func.hpp"
#include "drape/utils/gpu_mem_tracker.hpp"
diff --git a/drape/texture.hpp b/drape/texture.hpp
index ed6b58b594..e3f62610b8 100644
--- a/drape/texture.hpp
+++ b/drape/texture.hpp
@@ -9,8 +9,7 @@
#include "base/macros.hpp"
-#include "std/cstdint.hpp"
-#include "std/function.hpp"
+#include <cstdint>
namespace dp
{
diff --git a/drape/texture_manager.cpp b/drape/texture_manager.cpp
index 9e77acbd83..2d5880657c 100644
--- a/drape/texture_manager.cpp
+++ b/drape/texture_manager.cpp
@@ -20,6 +20,7 @@
#include <algorithm>
#include <cstdint>
#include <limits>
+#include <sstream>
#include <vector>
namespace dp
@@ -75,7 +76,7 @@ string ReadFileToString(string const & filename)
template <typename ToDo>
void ParseColorsList(string const & colorsFile, ToDo toDo)
{
- istringstream fin(ReadFileToString(colorsFile));
+ std::istringstream fin(ReadFileToString(colorsFile));
while (true)
{
uint32_t color;
diff --git a/drape/utils/glyph_usage_tracker.cpp b/drape/utils/glyph_usage_tracker.cpp
index 0713944df7..a3b8dc889c 100644
--- a/drape/utils/glyph_usage_tracker.cpp
+++ b/drape/utils/glyph_usage_tracker.cpp
@@ -4,14 +4,13 @@
#include "base/assert.hpp"
-#include "std/sstream.hpp"
+#include <sstream>
namespace dp
{
-
string GlyphUsageTracker::GlyphUsageStatistic::ToString() const
{
- ostringstream ss;
+ std::ostringstream ss;
ss << " ----- Glyphs usage report ----- \n";
ss << " Current language = " << languages::GetCurrentOrig() << "\n";
ss << " Invalid glyphs count = " << m_invalidGlyphs.size() << "\n";
@@ -45,13 +44,13 @@ GlyphUsageTracker & GlyphUsageTracker::Instance()
GlyphUsageTracker::GlyphUsageStatistic GlyphUsageTracker::Report()
{
- lock_guard<mutex> lock(m_mutex);
+ std::lock_guard<std::mutex> lock(m_mutex);
return m_glyphStat;
}
void GlyphUsageTracker::AddInvalidGlyph(strings::UniString const & str, strings::UniChar const & c)
{
- lock_guard<mutex> lock(m_mutex);
+ std::lock_guard<std::mutex> lock(m_mutex);
if (m_processedStrings.find(strings::ToUtf8(str)) != m_processedStrings.end())
return;
@@ -64,7 +63,7 @@ void GlyphUsageTracker::AddInvalidGlyph(strings::UniString const & str, strings:
void GlyphUsageTracker::AddUnexpectedGlyph(strings::UniString const & str, strings::UniChar const & c,
size_t const group, size_t const expectedGroup)
{
- lock_guard<mutex> lock(m_mutex);
+ std::lock_guard<std::mutex> lock(m_mutex);
if (m_processedStrings.find(strings::ToUtf8(str)) != m_processedStrings.end())
return;
@@ -76,5 +75,4 @@ void GlyphUsageTracker::AddUnexpectedGlyph(strings::UniString const & str, strin
m_processedStrings.insert(strings::ToUtf8(str));
}
-
-} // namespace dp
+} // namespace dp
diff --git a/drape/utils/glyph_usage_tracker.hpp b/drape/utils/glyph_usage_tracker.hpp
index ee92268ef2..a43f4c19e3 100644
--- a/drape/utils/glyph_usage_tracker.hpp
+++ b/drape/utils/glyph_usage_tracker.hpp
@@ -4,16 +4,15 @@
#include "base/string_utils.hpp"
-#include "std/map.hpp"
-#include "std/set.hpp"
-#include "std/list.hpp"
-#include "std/mutex.hpp"
-#include "std/string.hpp"
-#include "std/unordered_set.hpp"
+#include <list>
+#include <map>
+#include <mutex>
+#include <set>
+#include <string>
+#include <unordered_set>
namespace dp
{
-
class GlyphUsageTracker
{
public:
@@ -21,14 +20,14 @@ public:
{
size_t m_counter = 0;
size_t m_group = 0;
- set<size_t> m_expectedGroups;
+ std::set<size_t> m_expectedGroups;
};
- using UnexpectedGlyphs = map<strings::UniChar, UnexpectedGlyphData>;
- using InvalidGlyphs = map<strings::UniChar, size_t>;
+ using UnexpectedGlyphs = std::map<strings::UniChar, UnexpectedGlyphData>;
+ using InvalidGlyphs = std::map<strings::UniChar, size_t>;
struct GlyphUsageStatistic
{
- string ToString() const;
+ std::string ToString() const;
InvalidGlyphs m_invalidGlyphs;
UnexpectedGlyphs m_unexpectedGlyphs;
@@ -49,9 +48,8 @@ private:
private:
GlyphUsageStatistic m_glyphStat;
- unordered_set<string> m_processedStrings;
+ std::unordered_set<std::string> m_processedStrings;
- mutex m_mutex;
+ std::mutex m_mutex;
};
-
-} // namespace dp
+} // namespace dp
diff --git a/drape/utils/projection.cpp b/drape/utils/projection.cpp
index ba7c30c11a..012a450414 100644
--- a/drape/utils/projection.cpp
+++ b/drape/utils/projection.cpp
@@ -1,9 +1,8 @@
-#include "projection.hpp"
+#include "drape/utils/projection.hpp"
namespace dp
{
-
-void MakeProjection(array<float, 16> & result, float left, float right, float bottom, float top)
+void MakeProjection(std::array<float, 16> & result, float left, float right, float bottom, float top)
{
result.fill(0.0f);
@@ -19,5 +18,4 @@ void MakeProjection(array<float, 16> & result, float left, float right, float bo
result[11] = -(maxDepth + minDepth) / depth;
result[15] = 1.0;
}
-
-} // namespace dp
+} // namespace dp
diff --git a/drape/utils/projection.hpp b/drape/utils/projection.hpp
index 896be9cf6d..2744bd23ff 100644
--- a/drape/utils/projection.hpp
+++ b/drape/utils/projection.hpp
@@ -1,11 +1,11 @@
#pragma once
-#include "std/array.hpp"
+#include <array>
namespace dp
{
- float constexpr minDepth = -20000.0f;
- float constexpr maxDepth = 20000.0f;
+float constexpr minDepth = -20000.0f;
+float constexpr maxDepth = 20000.0f;
- void MakeProjection(array<float, 16> & result, float left, float right, float bottom, float top);
-} // namespace dp
+void MakeProjection(std::array<float, 16> & result, float left, float right, float bottom, float top);
+} // namespace dp
diff --git a/drape/vertex_array_buffer.cpp b/drape/vertex_array_buffer.cpp
index 1ddf72a5c8..06f6d4e530 100644
--- a/drape/vertex_array_buffer.cpp
+++ b/drape/vertex_array_buffer.cpp
@@ -1,6 +1,5 @@
#include "drape/vertex_array_buffer.hpp"
-#include "drape/gl_extensions_list.hpp"
#include "drape/gl_functions.hpp"
#include "drape/index_storage.hpp"
#include "drape/support_manager.hpp"
diff --git a/drape_frontend/apply_feature_functors.cpp b/drape_frontend/apply_feature_functors.cpp
index 66ac6ec91b..ce3644f57c 100644
--- a/drape_frontend/apply_feature_functors.cpp
+++ b/drape_frontend/apply_feature_functors.cpp
@@ -39,7 +39,6 @@
namespace df
{
-
dp::Color ToDrapeColor(uint32_t src)
{
return dp::Extract(src, static_cast<uint8_t>(255 - (src >> 24)));
@@ -463,7 +462,7 @@ string BaseApplyFeature::ExtractHotelInfo() const
if (!m_hotelData.m_isHotel)
return "";
- ostringstream out;
+ std::ostringstream out;
if (!m_hotelData.m_rating.empty() && m_hotelData.m_rating != "0")
{
out << m_hotelData.m_rating << kStarSymbol;
diff --git a/drape_frontend/backend_renderer.hpp b/drape_frontend/backend_renderer.hpp
index 69001e642e..d0a651dccb 100644
--- a/drape_frontend/backend_renderer.hpp
+++ b/drape_frontend/backend_renderer.hpp
@@ -35,7 +35,7 @@ using TIsUGCFn = std::function<bool(FeatureID const &)>;
class BackendRenderer : public BaseRenderer
{
public:
- using TUpdateCurrentCountryFn = function<void (m2::PointD const &, int)>;
+ using TUpdateCurrentCountryFn = std::function<void (m2::PointD const &, int)>;
struct Params : BaseRenderer::Params
{
diff --git a/drape_frontend/drape_api_renderer.hpp b/drape_frontend/drape_api_renderer.hpp
index 18bcffe76c..f778a1885f 100644
--- a/drape_frontend/drape_api_renderer.hpp
+++ b/drape_frontend/drape_api_renderer.hpp
@@ -19,7 +19,7 @@ public:
void AddRenderProperties(ref_ptr<gpu::ProgramManager> mng,
std::vector<drape_ptr<DrapeApiRenderProperty>> && properties);
- void RemoveRenderProperty(string const & id);
+ void RemoveRenderProperty(std::string const & id);
void Clear();
void Render(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, ScreenBase const & screen,
diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp
index 14cf948eb4..8dd5db5446 100755
--- a/drape_frontend/frontend_renderer.cpp
+++ b/drape_frontend/frontend_renderer.cpp
@@ -34,6 +34,8 @@
#include "base/stl_helpers.hpp"
#include "base/timer.hpp"
+#include "std/target_os.hpp"
+
#include <algorithm>
#include <chrono>
#include <cmath>
diff --git a/drape_frontend/rule_drawer.hpp b/drape_frontend/rule_drawer.hpp
index 24222e3684..601cabde95 100644
--- a/drape_frontend/rule_drawer.hpp
+++ b/drape_frontend/rule_drawer.hpp
@@ -32,7 +32,7 @@ public:
using TDrawerCallback = std::function<void(FeatureType &, Stylist &)>;
using TCheckCancelledCallback = std::function<bool()>;
using TIsCountryLoadedByNameFn = std::function<bool(std::string const &)>;
- using TInsertShapeFn = function<void(drape_ptr<MapShape> && shape)>;
+ using TInsertShapeFn = std::function<void(drape_ptr<MapShape> && shape)>;
using TFilterFeatureFn = std::function<bool(FeatureType &)>;
RuleDrawer(TDrawerCallback const & drawerFn,
diff --git a/drape_frontend/transit_scheme_builder.hpp b/drape_frontend/transit_scheme_builder.hpp
index 0d09b3d9e1..ff237b10bd 100644
--- a/drape_frontend/transit_scheme_builder.hpp
+++ b/drape_frontend/transit_scheme_builder.hpp
@@ -7,6 +7,7 @@
#include "transit/transit_display_info.hpp"
+#include <functional>
#include <map>
#include <set>
#include <string>
@@ -104,7 +105,7 @@ public:
TransferMax = 60
};
- using TFlushRenderDataFn = function<void (TransitRenderData && renderData)>;
+ using TFlushRenderDataFn = std::function<void (TransitRenderData && renderData)>;
TransitSchemeBuilder(TFlushRenderDataFn const & flushFn)
: m_flushRenderDataFn(flushFn)
diff --git a/drape_frontend/visual_params.cpp b/drape_frontend/visual_params.cpp
index db74bf8bd4..8ed7513a49 100644
--- a/drape_frontend/visual_params.cpp
+++ b/drape_frontend/visual_params.cpp
@@ -8,6 +8,8 @@
#include "indexer/scales.hpp"
+#include "std/target_os.hpp"
+
#include <algorithm>
#include <cmath>
#include <limits>
diff --git a/map/traffic_manager.hpp b/map/traffic_manager.hpp
index 18069dcaf4..bf939c12ef 100644
--- a/map/traffic_manager.hpp
+++ b/map/traffic_manager.hpp
@@ -52,8 +52,8 @@ public:
{}
};
- using TrafficStateChangedFn = function<void(TrafficState)>;
- using GetMwmsByRectFn = function<vector<MwmSet::MwmId>(m2::RectD const &)>;
+ using TrafficStateChangedFn = std::function<void(TrafficState)>;
+ using GetMwmsByRectFn = std::function<vector<MwmSet::MwmId>(m2::RectD const &)>;
TrafficManager(GetMwmsByRectFn const & getMwmsByRectFn, size_t maxCacheSizeBytes,
traffic::TrafficObserver & observer);
diff --git a/shaders/shaders_tests/gl_program_params_tests.cpp b/shaders/shaders_tests/gl_program_params_tests.cpp
index ec5c1d9257..9f2922b47a 100644
--- a/shaders/shaders_tests/gl_program_params_tests.cpp
+++ b/shaders/shaders_tests/gl_program_params_tests.cpp
@@ -5,6 +5,7 @@
#include "shaders/gl_program_pool.hpp"
#include "drape/drape_global.hpp"
+#include "drape/drape_tests/testing_graphics_context.hpp"
#include "drape/gl_functions.hpp"
#include <functional>
@@ -15,6 +16,7 @@ template <typename ProgramParams>
void TestProgramParams(bool apiOpenGLES3)
{
auto const api = apiOpenGLES3 ? dp::ApiVersion::OpenGLES3 : dp::ApiVersion::OpenGLES2;
+ TestingGraphicsContext context(api);
GLFunctions::Init(api);
gpu::GLProgramPool pool(api);
gpu::GLProgramParamsSetter paramsSetter;
@@ -24,7 +26,7 @@ void TestProgramParams(bool apiOpenGLES3)
{
auto const program = pool.Get(p);
program->Bind();
- paramsSetter.Apply(make_ref(program), params);
+ paramsSetter.Apply(make_ref(&context), make_ref(program), params);
program->Unbind();
}
}