Lines Matching full:cache

59     // Set the cache limits so we can fit 10 "src" images and the  in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
256 REPORTER_ASSERT(reporter, adoptedAndCachedIsAlive); // Still alive because it's in the cache in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
260 // We can't delete texHandles[2] - we've given control of the lifetime to the context/cache in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
264 // Purge the cache. This should force texHandles[2] to be deleted in DEF_GPUTEST_FOR_RENDERING_CONTEXTS()
372 GrResourceCache* cache = fContext->getResourceCache(); in Mock() local
373 cache->purgeAllUnlocked(); in Mock()
374 SkASSERT(0 == cache->getResourceCount() && 0 == cache->getResourceBytes()); in Mock()
377 GrResourceCache* cache() { return fContext->getResourceCache(); } in cache() function in Mock
388 GrResourceCache* cache = mock.cache(); in test_no_key() local
401 REPORTER_ASSERT(reporter, 4 == cache->getResourceCount()); in test_no_key()
403 d->gpuMemorySize() == cache->getResourceBytes()); in test_no_key()
406 cache->purgeAllUnlocked(); in test_no_key()
413 REPORTER_ASSERT(reporter, 3 == cache->getResourceCount()); in test_no_key()
415 cache->getResourceBytes()); in test_no_key()
419 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_no_key()
421 cache->getResourceBytes()); in test_no_key()
425 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_no_key()
426 REPORTER_ASSERT(reporter, b->gpuMemorySize() == cache->getResourceBytes()); in test_no_key()
430 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_no_key()
431 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_no_key()
445 GrResourceCache* cache = mock.cache(); in test_budgeting() local
467 REPORTER_ASSERT(reporter, nullptr == cache->findAndRefUniqueResource(uniqueKey2)); in test_budgeting()
470 REPORTER_ASSERT(reporter, 4 == cache->getResourceCount()); in test_budgeting()
473 cache->getResourceBytes()); in test_budgeting()
474 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_budgeting()
476 cache->getBudgetedResourceBytes()); in test_budgeting()
479 cache->purgeAllUnlocked(); in test_budgeting()
480 REPORTER_ASSERT(reporter, 4 == cache->getResourceCount()); in test_budgeting()
483 cache->getResourceBytes()); in test_budgeting()
484 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_budgeting()
486 cache->getBudgetedResourceBytes()); in test_budgeting()
490 REPORTER_ASSERT(reporter, 3 == cache->getResourceCount()); in test_budgeting()
492 unbudgeted->gpuMemorySize() == cache->getResourceBytes()); in test_budgeting()
498 cache->purgeAllUnlocked(); in test_budgeting()
499 REPORTER_ASSERT(reporter, 3 == cache->getResourceCount()); in test_budgeting()
501 unbudgeted->gpuMemorySize() == cache->getResourceBytes()); in test_budgeting()
502 REPORTER_ASSERT(reporter, 1 == cache->getBudgetedResourceCount()); in test_budgeting()
503 REPORTER_ASSERT(reporter, scratch->gpuMemorySize() == cache->getBudgetedResourceBytes()); in test_budgeting()
506 cache->purgeAllUnlocked(); in test_budgeting()
507 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_budgeting()
509 cache->getResourceBytes()); in test_budgeting()
510 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_budgeting()
511 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_budgeting()
514 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_budgeting()
515 REPORTER_ASSERT(reporter, unbudgeted->gpuMemorySize() == cache->getResourceBytes()); in test_budgeting()
516 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_budgeting()
517 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_budgeting()
520 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_budgeting()
521 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_budgeting()
522 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_budgeting()
523 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_budgeting()
529 GrResourceCache* cache = mock.cache(); in test_unbudgeted() local
545 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_unbudgeted()
546 REPORTER_ASSERT(reporter, 10 == cache->getResourceBytes()); in test_unbudgeted()
547 REPORTER_ASSERT(reporter, 1 == cache->getBudgetedResourceCount()); in test_unbudgeted()
548 REPORTER_ASSERT(reporter, 10 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
554 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_unbudgeted()
555 REPORTER_ASSERT(reporter, 21 == cache->getResourceBytes()); in test_unbudgeted()
556 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_unbudgeted()
557 REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
559 size_t large = 2 * cache->getResourceBytes(); in test_unbudgeted()
561 REPORTER_ASSERT(reporter, 3 == cache->getResourceCount()); in test_unbudgeted()
562 REPORTER_ASSERT(reporter, 21 + large == cache->getResourceBytes()); in test_unbudgeted()
563 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_unbudgeted()
564 REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
567 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_unbudgeted()
568 REPORTER_ASSERT(reporter, 21 == cache->getResourceBytes()); in test_unbudgeted()
569 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_unbudgeted()
570 REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
573 REPORTER_ASSERT(reporter, 3 == cache->getResourceCount()); in test_unbudgeted()
574 REPORTER_ASSERT(reporter, 21 + large == cache->getResourceBytes()); in test_unbudgeted()
575 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_unbudgeted()
576 REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
579 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_unbudgeted()
580 REPORTER_ASSERT(reporter, 21 == cache->getResourceBytes()); in test_unbudgeted()
581 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_unbudgeted()
582 REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
584 cache->purgeAllUnlocked(); in test_unbudgeted()
585 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_unbudgeted()
586 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_unbudgeted()
587 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_unbudgeted()
588 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
596 GrResourceCache* cache = mock.cache(); in test_unbudgeted_to_scratch() local
610 …REPORTER_ASSERT(reporter, nullptr == cache->findAndRefScratchResource(key, TestResource::kDefaultS… in test_unbudgeted_to_scratch()
611 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_unbudgeted_to_scratch()
612 REPORTER_ASSERT(reporter, size == cache->getResourceBytes()); in test_unbudgeted_to_scratch()
613 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_unbudgeted_to_scratch()
614 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_unbudgeted_to_scratch()
618 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_unbudgeted_to_scratch()
619 REPORTER_ASSERT(reporter, size == cache->getResourceBytes()); in test_unbudgeted_to_scratch()
620 REPORTER_ASSERT(reporter, 1 == cache->getBudgetedResourceCount()); in test_unbudgeted_to_scratch()
621 REPORTER_ASSERT(reporter, size == cache->getBudgetedResourceBytes()); in test_unbudgeted_to_scratch()
622 …resource = static_cast<TestResource*>(cache->findAndRefScratchResource(key, TestResource::kDefault… in test_unbudgeted_to_scratch()
635 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_unbudgeted_to_scratch()
636 REPORTER_ASSERT(reporter, size == cache->getResourceBytes()); in test_unbudgeted_to_scratch()
637 REPORTER_ASSERT(reporter, 1 == cache->getBudgetedResourceCount()); in test_unbudgeted_to_scratch()
638 REPORTER_ASSERT(reporter, size == cache->getBudgetedResourceBytes()); in test_unbudgeted_to_scratch()
645 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_unbudgeted_to_scratch()
646 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_unbudgeted_to_scratch()
647 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_unbudgeted_to_scratch()
648 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_unbudgeted_to_scratch()
656 GrResourceCache* cache = mock.cache(); in test_duplicate_scratch_key() local
670 …REPORTER_ASSERT(reporter, nullptr == cache->findAndRefScratchResource(scratchKey1, TestResource::k… in test_duplicate_scratch_key()
677 SkDEBUGCODE(REPORTER_ASSERT(reporter, 2 == cache->countScratchEntriesForKey(scratchKey));) in test_duplicate_scratch_key()
678 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_duplicate_scratch_key()
680 cache->getResourceBytes()); in test_duplicate_scratch_key()
683 cache->purgeAllUnlocked(); in test_duplicate_scratch_key()
685 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_duplicate_scratch_key()
691 SkDEBUGCODE(REPORTER_ASSERT(reporter, 2 == cache->countScratchEntriesForKey(scratchKey));) in test_duplicate_scratch_key()
694 cache->purgeAllUnlocked(); in test_duplicate_scratch_key()
696 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_duplicate_scratch_key()
697 SkDEBUGCODE(REPORTER_ASSERT(reporter, 0 == cache->countScratchEntriesForKey(scratchKey));) in test_duplicate_scratch_key()
703 GrResourceCache* cache = mock.cache(); in test_remove_scratch_key() local
717 …REPORTER_ASSERT(reporter, cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize,… in test_remove_scratch_key()
722 SkDEBUGCODE(REPORTER_ASSERT(reporter, 2 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
723 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_remove_scratch_key()
727 find = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, 0); in test_remove_scratch_key()
731 SkDEBUGCODE(REPORTER_ASSERT(reporter, 1 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
732 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_remove_scratch_key()
734 // The cache should immediately delete it when it's unrefed since it isn't accessible. in test_remove_scratch_key()
737 SkDEBUGCODE(REPORTER_ASSERT(reporter, 1 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
738 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_remove_scratch_key()
741 find = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, 0); in test_remove_scratch_key()
744 SkDEBUGCODE(REPORTER_ASSERT(reporter, 0 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
745 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_remove_scratch_key()
750 SkDEBUGCODE(REPORTER_ASSERT(reporter, 0 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
751 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_remove_scratch_key()
755 SkDEBUGCODE(REPORTER_ASSERT(reporter, 0 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
756 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_remove_scratch_key()
762 GrResourceCache* cache = mock.cache(); in test_scratch_key_consistency() local
797 …REPORTER_ASSERT(reporter, cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize,… in test_scratch_key_consistency()
801 … GrGpuResource* find = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, 0); in test_scratch_key_consistency()
806 find = cache->findAndRefScratchResource(scratchKey2, TestResource::kDefaultSize, 0); in test_scratch_key_consistency()
810 …GrGpuResource* find2 = cache->findAndRefScratchResource(scratchKey2, TestResource::kDefaultSize, 0… in test_scratch_key_consistency()
821 GrResourceCache* cache = mock.cache(); in test_duplicate_unique_key() local
832 REPORTER_ASSERT(reporter, a == cache->findAndRefUniqueResource(key)); in test_duplicate_unique_key()
837 REPORTER_ASSERT(reporter, a == cache->findAndRefUniqueResource(key)); in test_duplicate_unique_key()
839 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_duplicate_unique_key()
840 REPORTER_ASSERT(reporter, a->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
843 // Create resource b and set the same key. It should replace a's unique key cache entry. in test_duplicate_unique_key()
847 REPORTER_ASSERT(reporter, b == cache->findAndRefUniqueResource(key)); in test_duplicate_unique_key()
851 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_duplicate_unique_key()
852 REPORTER_ASSERT(reporter, a->gpuMemorySize() + b->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
857 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_duplicate_unique_key()
858 REPORTER_ASSERT(reporter, b->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
869 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_duplicate_unique_key()
870 REPORTER_ASSERT(reporter, b->gpuMemorySize() + c->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
874 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_duplicate_unique_key()
875 REPORTER_ASSERT(reporter, c->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
879 cache->purgeAllUnlocked(); in test_duplicate_unique_key()
880 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_duplicate_unique_key()
881 REPORTER_ASSERT(reporter, c->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
886 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_duplicate_unique_key()
887 REPORTER_ASSERT(reporter, c->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
891 REPORTER_ASSERT(reporter, c == cache->findAndRefUniqueResource(key)); in test_duplicate_unique_key()
894 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_duplicate_unique_key()
895 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_duplicate_unique_key()
909 sk_sp<GrGpuResource> d2(cache->findAndRefUniqueResource(key3)); in test_duplicate_unique_key()
916 GrResourceCache* cache = mock.cache(); in test_purge_invalidated() local
923 // Add three resources to the cache. Only c is usable as scratch. in test_purge_invalidated()
935 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key1)); in test_purge_invalidated()
936 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key2)); in test_purge_invalidated()
937 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key3)); in test_purge_invalidated()
946 cache->purgeAsNeeded(); in test_purge_invalidated()
948 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key1)); in test_purge_invalidated()
949 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key2)); in test_purge_invalidated()
951 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key3)); in test_purge_invalidated()
955 cache->purgeAsNeeded(); in test_purge_invalidated()
958 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key3)); in test_purge_invalidated()
967 …GrGpuResource* scratch = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, … in test_purge_invalidated()
972 cache->purgeAllUnlocked(); in test_purge_invalidated()
973 scratch = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, 0); in test_purge_invalidated()
975 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_purge_invalidated()
976 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_purge_invalidated()
984 GrResourceCache* cache = mock.cache(); in test_cache_chained_purge() local
1006 cache->purgeAllUnlocked(); in test_cache_chained_purge()
1013 cache->purgeAllUnlocked(); in test_cache_chained_purge()
1026 GrResourceCache* cache = mock.cache(); in test_resource_size_changed() local
1036 REPORTER_ASSERT(reporter, 200 == cache->getResourceBytes()); in test_resource_size_changed()
1037 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_resource_size_changed()
1040 static_cast<TestResource*>(cache->findAndRefUniqueResource(key2))); in test_resource_size_changed()
1043 static_cast<TestResource*>(cache->findAndRefUniqueResource(key1))); in test_resource_size_changed()
1047 REPORTER_ASSERT(reporter, 250 == cache->getResourceBytes()); in test_resource_size_changed()
1048 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_resource_size_changed()
1051 // Test increasing a resources size beyond the cache budget. in test_resource_size_changed()
1055 GrResourceCache* cache = mock.cache(); in test_resource_size_changed() local
1067 REPORTER_ASSERT(reporter, 200 == cache->getResourceBytes()); in test_resource_size_changed()
1068 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_resource_size_changed()
1072 cache->findAndRefUniqueResource(key2))); in test_resource_size_changed()
1075 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key1)); in test_resource_size_changed()
1077 REPORTER_ASSERT(reporter, 201 == cache->getResourceBytes()); in test_resource_size_changed()
1078 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_resource_size_changed()
1094 GrResourceCache* cache = mock.cache(); in test_timestamp_wrap() local
1097 cache->changeTimestamp(SK_MaxU32 - random.nextULessThan(kCount + 1)); in test_timestamp_wrap()
1130 GrGpuResource* res = cache->findAndRefUniqueResource(key); in test_timestamp_wrap()
1150 GrResourceCache* cache = mock.cache(); in test_flush() local
1152 // The current cache impl will round the max flush count to the next power of 2. So we choose a in test_flush()
1155 cache->setLimits(1000000, 1000000, kFlushCount); in test_flush()
1165 cache->notifyFlushOccurred(GrResourceCache::kExternal); in test_flush()
1168 // Send flush notifications to the cache. Each flush should purge the oldest resource. in test_flush()
1170 cache->notifyFlushOccurred(GrResourceCache::kExternal); in test_flush()
1171 REPORTER_ASSERT(reporter, kFlushCount - i - 1 == cache->getResourceCount()); in test_flush()
1175 GrGpuResource* r = cache->findAndRefUniqueResource(k); in test_flush()
1181 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_flush()
1182 cache->purgeAllUnlocked(); in test_flush()
1200 cache->notifyFlushOccurred(GrResourceCache::kExternal); in test_flush()
1205 cache->notifyFlushOccurred(GrResourceCache::kExternal); in test_flush()
1206 REPORTER_ASSERT(reporter, kFlushCount - i/2 - 1 == cache->getResourceCount()); in test_flush()
1217 REPORTER_ASSERT(reporter, kFlushCount >> 1 == cache->getResourceCount()); in test_flush()
1218 cache->notifyFlushOccurred(GrResourceCache::kExternal); in test_flush()
1220 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_flush()
1222 cache->purgeAllUnlocked(); in test_flush()
1225 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_flush()
1237 REPORTER_ASSERT(reporter, 10 == cache->getResourceCount()); in test_flush()
1241 REPORTER_ASSERT(reporter, 10 == cache->getResourceCount()); in test_flush()
1247 GrResourceCache* cache = mock.cache(); in test_time_purge() local
1277 cache->purgeResourcesNotUsedSince(timeStamps[i]); in test_time_purge()
1278 REPORTER_ASSERT(reporter, cnt - i - 1 == cache->getResourceCount()); in test_time_purge()
1282 GrGpuResource* r = cache->findAndRefUniqueResource(k); in test_time_purge()
1288 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_time_purge()
1289 cache->purgeAllUnlocked(); in test_time_purge()
1312 cache->purgeResourcesNotUsedSince(timeStamps[i]); in test_time_purge()
1313 REPORTER_ASSERT(reporter, cnt - i / 2 - 1 == cache->getResourceCount()); in test_time_purge()
1319 cache->purgeResourcesNotUsedSince(nowish()); in test_time_purge()
1320 REPORTER_ASSERT(reporter, cnt / 2 - i - 1 == cache->getResourceCount()); in test_time_purge()
1323 cache->purgeAllUnlocked(); in test_time_purge()
1326 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_time_purge()
1338 REPORTER_ASSERT(reporter, 10 == cache->getResourceCount()); in test_time_purge()
1340 REPORTER_ASSERT(reporter, 10 == cache->getResourceCount()); in test_time_purge()
1341 cache->purgeResourcesNotUsedSince(nowish()); in test_time_purge()
1342 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_time_purge()
1347 // Set the cache size to double the resource count because we're going to create 2x that number in test_large_resource_count()
1354 GrResourceCache* cache = mock.cache(); in test_large_resource_count() local
1375 REPORTER_ASSERT(reporter, cache->getBudgetedResourceBytes() == 2 * kResourceCnt); in test_large_resource_count()
1376 REPORTER_ASSERT(reporter, cache->getBudgetedResourceCount() == 2 * kResourceCnt); in test_large_resource_count()
1377 REPORTER_ASSERT(reporter, cache->getResourceBytes() == 2 * kResourceCnt); in test_large_resource_count()
1378 REPORTER_ASSERT(reporter, cache->getResourceCount() == 2 * kResourceCnt); in test_large_resource_count()
1384 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key1)); in test_large_resource_count()
1385 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key2)); in test_large_resource_count()
1388 cache->purgeAllUnlocked(); in test_large_resource_count()
1390 REPORTER_ASSERT(reporter, cache->getBudgetedResourceBytes() == 0); in test_large_resource_count()
1391 REPORTER_ASSERT(reporter, cache->getBudgetedResourceCount() == 0); in test_large_resource_count()
1392 REPORTER_ASSERT(reporter, cache->getResourceBytes() == 0); in test_large_resource_count()
1393 REPORTER_ASSERT(reporter, cache->getResourceCount() == 0); in test_large_resource_count()
1400 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key1)); in test_large_resource_count()
1401 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key2)); in test_large_resource_count()
1455 GrResourceCache* cache = mock.cache(); in test_tags() local
1478 REPORTER_ASSERT(reporter, cache->countUniqueKeysWithTag(tagStr.c_str()) == i); in test_tags()