[core] Rename "onLowMemory" to "reduceMemoryUse".

Android still calls "reduceMemoryUse" only while handling a low memory event.
iOS, on the other hand, calls "reduceMemoryUse" every time it enters the background.
This commit is contained in:
Chris Loer
2018-02-14 10:11:45 -08:00
committed by Chris Loer
parent f721779963
commit a11b277bc1
25 changed files with 36 additions and 36 deletions

View File

@@ -73,8 +73,8 @@ std::vector<Feature> RenderAnnotationSource::querySourceFeatures(const SourceQue
return {};
}
void RenderAnnotationSource::onLowMemory() {
tilePyramid.onLowMemory();
void RenderAnnotationSource::reduceMemoryUse() {
tilePyramid.reduceMemoryUse();
}
void RenderAnnotationSource::dumpDebugLogs() const {

View File

@@ -33,7 +33,7 @@ public:
std::vector<Feature>
querySourceFeatures(const SourceQueryOptions&) const final;
void onLowMemory() final;
void reduceMemoryUse() final;
void dumpDebugLogs() const final;
private:

View File

@@ -70,7 +70,7 @@ public:
virtual std::vector<Feature>
querySourceFeatures(const SourceQueryOptions&) const = 0;
virtual void onLowMemory() = 0;
virtual void reduceMemoryUse() = 0;
virtual void dumpDebugLogs() const = 0;

View File

@@ -94,9 +94,9 @@ void Renderer::dumpDebugLogs() {
impl->dumDebugLogs();
}
void Renderer::onLowMemory() {
void Renderer::reduceMemoryUse() {
BackendScope guard { impl->backend };
impl->onLowMemory();
impl->reduceMemoryUse();
}
} // namespace mbgl

View File

@@ -722,10 +722,10 @@ std::vector<Feature> Renderer::Impl::querySourceFeatures(const std::string& sour
return source->querySourceFeatures(options);
}
void Renderer::Impl::onLowMemory() {
void Renderer::Impl::reduceMemoryUse() {
assert(BackendScope::exists());
for (const auto& entry : renderSources) {
entry.second->onLowMemory();
entry.second->reduceMemoryUse();
}
backend.getContext().performCleanup();
observer->onInvalidate();

View File

@@ -53,7 +53,7 @@ public:
std::vector<Feature> querySourceFeatures(const std::string& sourceID, const SourceQueryOptions&) const;
std::vector<Feature> queryShapeAnnotations(const ScreenLineString&) const;
void onLowMemory();
void reduceMemoryUse();
void dumDebugLogs();
private:

View File

@@ -76,8 +76,8 @@ std::vector<Feature> RenderCustomGeometrySource::querySourceFeatures(const Sourc
return tilePyramid.querySourceFeatures(options);
}
void RenderCustomGeometrySource::onLowMemory() {
tilePyramid.onLowMemory();
void RenderCustomGeometrySource::reduceMemoryUse() {
tilePyramid.reduceMemoryUse();
}
void RenderCustomGeometrySource::dumpDebugLogs() const {

View File

@@ -33,7 +33,7 @@ public:
std::vector<Feature>
querySourceFeatures(const SourceQueryOptions&) const final;
void onLowMemory() final;
void reduceMemoryUse() final;
void dumpDebugLogs() const final;
private:

View File

@@ -94,8 +94,8 @@ std::vector<Feature> RenderGeoJSONSource::querySourceFeatures(const SourceQueryO
return tilePyramid.querySourceFeatures(options);
}
void RenderGeoJSONSource::onLowMemory() {
tilePyramid.onLowMemory();
void RenderGeoJSONSource::reduceMemoryUse() {
tilePyramid.reduceMemoryUse();
}
void RenderGeoJSONSource::dumpDebugLogs() const {

View File

@@ -37,7 +37,7 @@ public:
std::vector<Feature>
querySourceFeatures(const SourceQueryOptions&) const final;
void onLowMemory() final;
void reduceMemoryUse() final;
void dumpDebugLogs() const final;
private:

View File

@@ -37,7 +37,7 @@ public:
std::vector<Feature> querySourceFeatures(const SourceQueryOptions&) const final;
void onLowMemory() final {
void reduceMemoryUse() final {
}
void dumpDebugLogs() const final;

View File

@@ -155,8 +155,8 @@ std::vector<Feature> RenderRasterDEMSource::querySourceFeatures(const SourceQuer
return {};
}
void RenderRasterDEMSource::onLowMemory() {
tilePyramid.onLowMemory();
void RenderRasterDEMSource::reduceMemoryUse() {
tilePyramid.reduceMemoryUse();
}
void RenderRasterDEMSource::dumpDebugLogs() const {

View File

@@ -33,7 +33,7 @@ public:
std::vector<Feature>
querySourceFeatures(const SourceQueryOptions&) const final;
void onLowMemory() final;
void reduceMemoryUse() final;
void dumpDebugLogs() const final;
private:

View File

@@ -85,8 +85,8 @@ std::vector<Feature> RenderRasterSource::querySourceFeatures(const SourceQueryOp
return {};
}
void RenderRasterSource::onLowMemory() {
tilePyramid.onLowMemory();
void RenderRasterSource::reduceMemoryUse() {
tilePyramid.reduceMemoryUse();
}
void RenderRasterSource::dumpDebugLogs() const {

View File

@@ -33,7 +33,7 @@ public:
std::vector<Feature>
querySourceFeatures(const SourceQueryOptions&) const final;
void onLowMemory() final;
void reduceMemoryUse() final;
void dumpDebugLogs() const final;
private:

View File

@@ -88,8 +88,8 @@ std::vector<Feature> RenderVectorSource::querySourceFeatures(const SourceQueryOp
return tilePyramid.querySourceFeatures(options);
}
void RenderVectorSource::onLowMemory() {
tilePyramid.onLowMemory();
void RenderVectorSource::reduceMemoryUse() {
tilePyramid.reduceMemoryUse();
}
void RenderVectorSource::dumpDebugLogs() const {

View File

@@ -33,7 +33,7 @@ public:
std::vector<Feature>
querySourceFeatures(const SourceQueryOptions&) const final;
void onLowMemory() final;
void reduceMemoryUse() final;
void dumpDebugLogs() const final;
private:

View File

@@ -303,7 +303,7 @@ void TilePyramid::setCacheSize(size_t size) {
cache.setSize(size);
}
void TilePyramid::onLowMemory() {
void TilePyramid::reduceMemoryUse() {
cache.clear();
}

View File

@@ -59,7 +59,7 @@ public:
std::vector<Feature> querySourceFeatures(const SourceQueryOptions&) const;
void setCacheSize(size_t);
void onLowMemory();
void reduceMemoryUse();
void setObserver(TileObserver*);
void dumpDebugLogs() const;