| 232 | } |
| 233 | |
| 234 | void ContinuousPageProvider::deliverDecodedImage(int pageIndex, quint64 generationValue, QImage decoded) |
| 235 | { |
| 236 | pending.remove(pageIndex); |
| 237 | |
| 238 | if (generationValue != generation || decoded.isNull()) { |
| 239 | return; |
| 240 | } |
| 241 | |
| 242 | // Ignore results that fell outside the current window while decoding. |
| 243 | if (pageIndex < std::max(0, requestedFirst - kEvictMargin) || pageIndex > requestedLast + kEvictMargin) { |
| 244 | return; |
| 245 | } |
| 246 | |
| 247 | cache.insert(pageIndex, std::move(decoded)); |
| 248 | emit pageReady(pageIndex); |
| 249 | } |
| 250 | |
| 251 | void ContinuousPageProvider::invalidateAll() |
| 252 | { |