summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-08-27 14:25:55 +0300
committerAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-08-27 16:23:48 +0300
commit21632a66f83e1e42bf6383f877d85a4fab4ad273 (patch)
tree9816cd8893accd71dc1d98ec9b20f40bd0cdd967 /src
parent2c796a72aaa74d3fe91daeb90470073d1cf1f808 (diff)
downloadqtlocation-mapboxgl-21632a66f83e1e42bf6383f877d85a4fab4ad273.tar.gz
[core] Remove programCacheDir parameter from ProgramParameters
Binary shader support has been removed in commit c2f974f2a573 ([core] Remove binary shader support). This left-over parameter is not used anywhere anymore.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/programs/program_parameters.cpp22
-rw-r--r--src/mbgl/programs/program_parameters.hpp4
-rw-r--r--src/mbgl/renderer/render_static_data.cpp6
-rw-r--r--src/mbgl/renderer/render_static_data.hpp2
-rw-r--r--src/mbgl/renderer/renderer.cpp2
-rw-r--r--src/mbgl/renderer/renderer_impl.cpp6
-rw-r--r--src/mbgl/renderer/renderer_impl.hpp2
7 files changed, 9 insertions, 35 deletions
diff --git a/src/mbgl/programs/program_parameters.cpp b/src/mbgl/programs/program_parameters.cpp
index a49dc2bc88..95d2d0f668 100644
--- a/src/mbgl/programs/program_parameters.cpp
+++ b/src/mbgl/programs/program_parameters.cpp
@@ -4,8 +4,7 @@
namespace mbgl {
ProgramParameters::ProgramParameters(const float pixelRatio,
- const bool overdraw,
- optional<std::string> cacheDir_)
+ const bool overdraw)
: defines([&] {
std::string result;
result.reserve(32);
@@ -16,28 +15,11 @@ ProgramParameters::ProgramParameters(const float pixelRatio,
result += "#define OVERDRAW_INSPECTOR\n";
}
return result;
- }()),
- cacheDir(std::move(cacheDir_)) {
+ }()) {
}
const std::string& ProgramParameters::getDefines() const {
return defines;
}
-optional<std::string> ProgramParameters::cachePath(const char* name) const {
- if (!cacheDir) {
- return {};
- } else {
- std::string result;
- result.reserve(cacheDir->length() + 64);
- result += *cacheDir;
- result += "/com.mapbox.gl.shader.";
- result += name;
- result += '.';
- result += util::toHex(static_cast<uint64_t>(std::hash<std::string>()(defines)));
- result += ".pbf";
- return result;
- }
-}
-
} // namespace mbgl
diff --git a/src/mbgl/programs/program_parameters.hpp b/src/mbgl/programs/program_parameters.hpp
index 71ad454399..8af7ab50c0 100644
--- a/src/mbgl/programs/program_parameters.hpp
+++ b/src/mbgl/programs/program_parameters.hpp
@@ -8,14 +8,12 @@ namespace mbgl {
class ProgramParameters {
public:
- ProgramParameters(float pixelRatio, bool overdraw, optional<std::string> cacheDir);
+ ProgramParameters(float pixelRatio, bool overdraw);
const std::string& getDefines() const;
- optional<std::string> cachePath(const char* name) const;
private:
std::string defines;
- optional<std::string> cacheDir;
};
} // namespace mbgl
diff --git a/src/mbgl/renderer/render_static_data.cpp b/src/mbgl/renderer/render_static_data.cpp
index 9090ef6579..6378ad9989 100644
--- a/src/mbgl/renderer/render_static_data.cpp
+++ b/src/mbgl/renderer/render_static_data.cpp
@@ -49,10 +49,10 @@ static gfx::VertexVector<HeatmapTextureLayoutVertex> heatmapTextureVertices() {
return result;
}
-RenderStaticData::RenderStaticData(gfx::Context& context, float pixelRatio, const optional<std::string>& programCacheDir)
- : programs(context, ProgramParameters { pixelRatio, false, programCacheDir })
+RenderStaticData::RenderStaticData(gfx::Context& context, float pixelRatio)
+ : programs(context, ProgramParameters { pixelRatio, false })
#ifndef NDEBUG
- , overdrawPrograms(context, ProgramParameters { pixelRatio, true, programCacheDir })
+ , overdrawPrograms(context, ProgramParameters { pixelRatio, true })
#endif
{
tileTriangleSegments.emplace_back(0, 0, 4, 6);
diff --git a/src/mbgl/renderer/render_static_data.hpp b/src/mbgl/renderer/render_static_data.hpp
index 5b409933af..6bf2c846f4 100644
--- a/src/mbgl/renderer/render_static_data.hpp
+++ b/src/mbgl/renderer/render_static_data.hpp
@@ -19,7 +19,7 @@ class UploadPass;
class RenderStaticData {
public:
- RenderStaticData(gfx::Context&, float pixelRatio, const optional<std::string>& programCacheDir);
+ RenderStaticData(gfx::Context&, float pixelRatio);
void upload(gfx::UploadPass&);
diff --git a/src/mbgl/renderer/renderer.cpp b/src/mbgl/renderer/renderer.cpp
index dd715bd3bc..52cd7a4351 100644
--- a/src/mbgl/renderer/renderer.cpp
+++ b/src/mbgl/renderer/renderer.cpp
@@ -10,11 +10,9 @@ namespace mbgl {
Renderer::Renderer(gfx::RendererBackend& backend,
float pixelRatio_,
- const optional<std::string> programCacheDir_,
const optional<std::string> localFontFamily_)
: impl(std::make_unique<Impl>(backend,
pixelRatio_,
- std::move(programCacheDir_),
std::move(localFontFamily_))) {
}
diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp
index c12f12c06a..113840d059 100644
--- a/src/mbgl/renderer/renderer_impl.cpp
+++ b/src/mbgl/renderer/renderer_impl.cpp
@@ -26,13 +26,11 @@ static RendererObserver& nullObserver() {
Renderer::Impl::Impl(gfx::RendererBackend& backend_,
float pixelRatio_,
- optional<std::string> programCacheDir_,
optional<std::string> localFontFamily_)
: orchestrator(!backend_.contextIsShared(), std::move(localFontFamily_))
, backend(backend_)
, observer(&nullObserver())
- , pixelRatio(pixelRatio_)
- , programCacheDir(std::move(programCacheDir_)) {
+ , pixelRatio(pixelRatio_) {
}
@@ -53,7 +51,7 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
const auto& renderTreeParameters = renderTree.getParameters();
if (!staticData) {
- staticData = std::make_unique<RenderStaticData>(backend.getContext(), pixelRatio, programCacheDir);
+ staticData = std::make_unique<RenderStaticData>(backend.getContext(), pixelRatio);
}
staticData->has3D = renderTreeParameters.has3D;
diff --git a/src/mbgl/renderer/renderer_impl.hpp b/src/mbgl/renderer/renderer_impl.hpp
index 85e37a014a..5f04bfdfed 100644
--- a/src/mbgl/renderer/renderer_impl.hpp
+++ b/src/mbgl/renderer/renderer_impl.hpp
@@ -19,7 +19,6 @@ class Renderer::Impl {
public:
Impl(gfx::RendererBackend&,
float pixelRatio_,
- optional<std::string> programCacheDir,
optional<std::string> localFontFamily_);
~Impl();
@@ -40,7 +39,6 @@ private:
RendererObserver* observer;
const float pixelRatio;
- const optional<std::string> programCacheDir;
std::unique_ptr<RenderStaticData> staticData;
enum class RenderState {