[core] Do not make pending requests for already requested images.

so that processing for the corresponding tile does not suspend and
the rendering performance is not affected.
This commit is contained in:
Mikhail Pozdnyakov
2019-10-25 15:13:02 +03:00
parent aa36dc87fb
commit 2f00ba7294
2 changed files with 9 additions and 18 deletions

View File

@@ -197,16 +197,13 @@ void ImageManager::checkMissingAndNotify(ImageRequestor& requestor, const ImageR
existingRequestors.emplace(requestorPtr);
continue;
}
// Unlike icons, pattern changes are not caught
// with style-diff meaning that the existing request
// could be from the previous style and we cannot
// coalesce requests for them.
if (dependency.second != ImageType::Pattern) {
continue;
}
// The request for this image has been already delivered
// to the client, so we do not treat it as pending.
existingRequestors.emplace(requestorPtr);
} else {
requestedImages[missingImage].emplace(requestorPtr);
requestor.addPendingRequest(missingImage);
}
requestedImages[missingImage].emplace(requestorPtr);
requestor.addPendingRequest(missingImage);
auto removePendingRequests = [this, missingImage] {
auto existingRequest = requestedImages.find(missingImage);