| 313 | void GrLayerCache::purge(uint32_t pictureID) { |
| 314 | |
| 315 | SkDEBUGCODE(GrAutoValidateCache avc(this);) |
| 316 | |
| 317 | // We need to find all the layers associated with 'picture' and remove them. |
| 318 | SkTDArray<GrCachedLayer*> toBeRemoved; |
| 319 | |
| 320 | SkTDynamicHash<GrCachedLayer, GrCachedLayer::Key>::Iter iter(&fLayerHash); |
| 321 | for (; !iter.done(); ++iter) { |
| 322 | if (pictureID == (*iter).pictureID()) { |
| 323 | *toBeRemoved.append() = &(*iter); |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | for (int i = 0; i < toBeRemoved.count(); ++i) { |
| 328 | this->unlock(toBeRemoved[i]); |
no test coverage detected