[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:
@@ -48,7 +48,7 @@ public:
|
||||
void dumpDebugLogs();
|
||||
|
||||
// Memory
|
||||
void onLowMemory();
|
||||
void reduceMemoryUse();
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
|
||||
@@ -77,8 +77,8 @@ void AndroidRendererFrontend::update(std::shared_ptr<UpdateParameters> params) {
|
||||
mapRenderer.requestRender();
|
||||
}
|
||||
|
||||
void AndroidRendererFrontend::onLowMemory() {
|
||||
mapRenderer.actor().invoke(&Renderer::onLowMemory);
|
||||
void AndroidRendererFrontend::reduceMemoryUse() {
|
||||
mapRenderer.actor().invoke(&Renderer::reduceMemoryUse);
|
||||
}
|
||||
|
||||
std::vector<Feature> AndroidRendererFrontend::querySourceFeatures(const std::string& sourceID,
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
AnnotationIDs queryShapeAnnotations(const ScreenBox& box) const;
|
||||
|
||||
// Memory
|
||||
void onLowMemory();
|
||||
void reduceMemoryUse();
|
||||
|
||||
private:
|
||||
MapRenderer& mapRenderer;
|
||||
|
||||
@@ -450,7 +450,7 @@ jni::Array<jni::jlong> NativeMapView::addMarkers(jni::JNIEnv& env, jni::Array<jn
|
||||
}
|
||||
|
||||
void NativeMapView::onLowMemory(JNIEnv&) {
|
||||
rendererFrontend->onLowMemory();
|
||||
rendererFrontend->reduceMemoryUse();
|
||||
}
|
||||
|
||||
using DebugOptions = mbgl::MapDebugOptions;
|
||||
|
||||
@@ -56,9 +56,9 @@ public:
|
||||
return renderer.get();
|
||||
}
|
||||
|
||||
void onLowMemory() {
|
||||
void reduceMemoryUse() {
|
||||
if (!renderer) return;
|
||||
renderer->onLowMemory();
|
||||
renderer->reduceMemoryUse();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -716,7 +716,7 @@ public:
|
||||
{
|
||||
MGLAssertIsMainThread();
|
||||
|
||||
_rendererFrontend->onLowMemory();
|
||||
_rendererFrontend->reduceMemoryUse();
|
||||
}
|
||||
|
||||
#pragma mark - Layout -
|
||||
@@ -2315,7 +2315,7 @@ public:
|
||||
|
||||
- (void)emptyMemoryCache
|
||||
{
|
||||
_rendererFrontend->onLowMemory();
|
||||
_rendererFrontend->reduceMemoryUse();
|
||||
}
|
||||
|
||||
- (void)setZoomEnabled:(BOOL)zoomEnabled
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
std::vector<Feature>
|
||||
querySourceFeatures(const SourceQueryOptions&) const final;
|
||||
|
||||
void onLowMemory() final;
|
||||
void reduceMemoryUse() final;
|
||||
void dumpDebugLogs() const final;
|
||||
|
||||
private:
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
std::vector<Feature>
|
||||
querySourceFeatures(const SourceQueryOptions&) const final;
|
||||
|
||||
void onLowMemory() final;
|
||||
void reduceMemoryUse() final;
|
||||
void dumpDebugLogs() const final;
|
||||
|
||||
private:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
std::vector<Feature>
|
||||
querySourceFeatures(const SourceQueryOptions&) const final;
|
||||
|
||||
void onLowMemory() final;
|
||||
void reduceMemoryUse() final;
|
||||
void dumpDebugLogs() const final;
|
||||
|
||||
private:
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
std::vector<Feature> querySourceFeatures(const SourceQueryOptions&) const final;
|
||||
|
||||
void onLowMemory() final {
|
||||
void reduceMemoryUse() final {
|
||||
}
|
||||
void dumpDebugLogs() const final;
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
std::vector<Feature>
|
||||
querySourceFeatures(const SourceQueryOptions&) const final;
|
||||
|
||||
void onLowMemory() final;
|
||||
void reduceMemoryUse() final;
|
||||
void dumpDebugLogs() const final;
|
||||
|
||||
private:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
std::vector<Feature>
|
||||
querySourceFeatures(const SourceQueryOptions&) const final;
|
||||
|
||||
void onLowMemory() final;
|
||||
void reduceMemoryUse() final;
|
||||
void dumpDebugLogs() const final;
|
||||
|
||||
private:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
std::vector<Feature>
|
||||
querySourceFeatures(const SourceQueryOptions&) const final;
|
||||
|
||||
void onLowMemory() final;
|
||||
void reduceMemoryUse() final;
|
||||
void dumpDebugLogs() const final;
|
||||
|
||||
private:
|
||||
|
||||
@@ -303,7 +303,7 @@ void TilePyramid::setCacheSize(size_t size) {
|
||||
cache.setSize(size);
|
||||
}
|
||||
|
||||
void TilePyramid::onLowMemory() {
|
||||
void TilePyramid::reduceMemoryUse() {
|
||||
cache.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user