-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core][android] Provide API to control eviction of cached images #14610
Conversation
/cc @julianrex Would someone from your team have time to implement darwin platform bindings? |
auto it = requestedImages.find(dependency.first); | ||
if (it != requestedImages.end()) { | ||
it->second.emplace(&requestor); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the above code not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it moved to the checkMissingAndNotify
, could you give some details on this?
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
Outdated
Show resolved
Hide resolved
2e5c2f8
to
d9b7936
Compare
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
Outdated
Show resolved
Hide resolved
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
Outdated
Show resolved
Hide resolved
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
Outdated
Show resolved
Hide resolved
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
Outdated
Show resolved
Hide resolved
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
Show resolved
Hide resolved
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
Outdated
Show resolved
Hide resolved
@alexshalamov yes, we can look at the Darwin side :) |
@alexshalamov @tobrun a couple of questions:
|
d9b7936
to
40058ca
Compare
Whenever cumulative size of unused images that were added via
When core notifies SDK / application code and there is developer provided handler for the |
@alexshalamov can this land without the iOS parts? Or would you like a PR to this branch? |
@julianrex not necessary to this branch, could be separate PR, I just want to make sure that the new interface is implementable for darwin platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Darwin side we have all what we need to build the bindings. I just have a question regarding the implementation.
@alexshalamov @julianrex we could pr the iOS bindings here or in a new pr, your call.
@alexshalamov quick point of clarification - when you say
that means all unused images are removed? so this has no direct relationship to least recently used, correct? |
b80ae7c
to
1e7f2b7
Compare
All unused images that were added as a result of |
5d3c26f
to
506c8d6
Compare
@tobrun @fabian-guerra are you fine with the new observer method? I would like to merge PR this week. |
506c8d6
to
cf96963
Compare
This PR introduces following changes:
DEFAULT_ON_DEMAND_IMAGES_CACHE_SIZE
that is equal to ~100 8kB sprites.bool onCanRemoveUnusedStyleImage(const std::string&)
method toMapObserver
interface that is invoked in two cases: OOM and when cumulative size of unused images in the cache goes overDEFAULT_ON_DEMAND_IMAGES_CACHE_SIZE
limit.By default, map will remove *unused images if application returns
true
fromonCanRemoveUnusedStyleImage
method.*Unused images: are images whose requesting tile is destroyed. Map will notify about unused images only if image was provided through
onStyleImageMissing(id)
=>addImage(id)
.Fixes: #14547
TODO: