Lines Matching refs:cache

355         GrResourceCache* cache = fContext->contextPriv().getResourceCache();  in Mock()  local
356 cache->purgeAllUnlocked(); in Mock()
357 SkASSERT(0 == cache->getResourceCount() && 0 == cache->getResourceBytes()); in Mock()
360 GrResourceCache* cache() { return fContext->contextPriv().getResourceCache(); } in cache() function in Mock
375 GrResourceCache* cache = mock.cache(); in test_no_key() local
385 REPORTER_ASSERT(reporter, 4 == cache->getResourceCount()); in test_no_key()
387 d->gpuMemorySize() == cache->getResourceBytes()); in test_no_key()
390 cache->purgeAllUnlocked(); in test_no_key()
397 REPORTER_ASSERT(reporter, 3 == cache->getResourceCount()); in test_no_key()
399 cache->getResourceBytes()); in test_no_key()
403 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_no_key()
405 cache->getResourceBytes()); in test_no_key()
409 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_no_key()
410 REPORTER_ASSERT(reporter, b->gpuMemorySize() == cache->getResourceBytes()); in test_no_key()
414 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_no_key()
415 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_no_key()
429 GrResourceCache* cache = mock.cache(); in test_purge_unlocked() local
455 REPORTER_ASSERT(reporter, 4 == cache->getResourceCount()); in test_purge_unlocked()
457 d->gpuMemorySize() == cache->getResourceBytes()); in test_purge_unlocked()
460 cache->purgeUnlockedResources(false); in test_purge_unlocked()
470 REPORTER_ASSERT(reporter, 4 == cache->getResourceCount()); in test_purge_unlocked()
472 d->gpuMemorySize() == cache->getResourceBytes()); in test_purge_unlocked()
475 cache->purgeUnlockedResources(true); in test_purge_unlocked()
478 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_purge_unlocked()
480 cache->getResourceBytes()); in test_purge_unlocked()
483 cache->purgeUnlockedResources(false); in test_purge_unlocked()
486 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_purge_unlocked()
487 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_purge_unlocked()
493 GrResourceCache* cache = mock.cache(); in test_budgeting() local
516 GrGpuResource* wrappedCacheableViaKey = cache->findAndRefUniqueResource(uniqueKey2); in test_budgeting()
518 GrGpuResource* wrappedUncacheableViaKey = cache->findAndRefUniqueResource(uniqueKey3); in test_budgeting()
526 REPORTER_ASSERT(reporter, 5 == cache->getResourceCount()); in test_budgeting()
531 cache->getResourceBytes()); in test_budgeting()
532 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_budgeting()
534 cache->getBudgetedResourceBytes()); in test_budgeting()
535 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_budgeting()
538 cache->purgeAllUnlocked(); in test_budgeting()
539 REPORTER_ASSERT(reporter, 5 == cache->getResourceCount()); in test_budgeting()
544 cache->getResourceBytes()); in test_budgeting()
545 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_budgeting()
547 cache->getBudgetedResourceBytes()); in test_budgeting()
548 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_budgeting()
554 REPORTER_ASSERT(reporter, 4 == cache->getResourceCount()); in test_budgeting()
558 cache->getResourceBytes()); in test_budgeting()
559 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_budgeting()
564 REPORTER_ASSERT(reporter, 11 == cache->getPurgeableBytes()); in test_budgeting()
567 cache->purgeAllUnlocked(); in test_budgeting()
568 REPORTER_ASSERT(reporter, 4 == cache->getResourceCount()); in test_budgeting()
570 wrappedCacheableViaKey = cache->findAndRefUniqueResource(uniqueKey2); in test_budgeting()
578 REPORTER_ASSERT(reporter, 3 == cache->getResourceCount()); in test_budgeting()
584 cache->getResourceBytes()); in test_budgeting()
585 REPORTER_ASSERT(reporter, 1 == cache->getBudgetedResourceCount()); in test_budgeting()
586 REPORTER_ASSERT(reporter, scratch->gpuMemorySize() == cache->getBudgetedResourceBytes()); in test_budgeting()
587 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_budgeting()
590 REPORTER_ASSERT(reporter, 10 == cache->getPurgeableBytes()); in test_budgeting()
591 cache->purgeAllUnlocked(); in test_budgeting()
592 REPORTER_ASSERT(reporter, 3 == cache->getResourceCount()); in test_budgeting()
595 cache->getResourceBytes()); in test_budgeting()
596 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_budgeting()
597 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_budgeting()
598 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_budgeting()
603 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_budgeting()
604 REPORTER_ASSERT(reporter, unbudgeted->gpuMemorySize() == cache->getResourceBytes()); in test_budgeting()
605 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_budgeting()
606 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_budgeting()
607 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_budgeting()
610 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_budgeting()
611 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_budgeting()
612 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_budgeting()
613 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_budgeting()
614 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_budgeting()
620 GrResourceCache* cache = mock.cache(); in test_unbudgeted() local
636 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_unbudgeted()
637 REPORTER_ASSERT(reporter, 10 == cache->getResourceBytes()); in test_unbudgeted()
638 REPORTER_ASSERT(reporter, 1 == cache->getBudgetedResourceCount()); in test_unbudgeted()
639 REPORTER_ASSERT(reporter, 10 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
640 REPORTER_ASSERT(reporter, 10 == cache->getPurgeableBytes()); in test_unbudgeted()
645 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_unbudgeted()
646 REPORTER_ASSERT(reporter, 21 == cache->getResourceBytes()); in test_unbudgeted()
647 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_unbudgeted()
648 REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
649 REPORTER_ASSERT(reporter, 21 == cache->getPurgeableBytes()); in test_unbudgeted()
651 size_t large = 2 * cache->getResourceBytes(); in test_unbudgeted()
653 REPORTER_ASSERT(reporter, 3 == cache->getResourceCount()); in test_unbudgeted()
654 REPORTER_ASSERT(reporter, 21 + large == cache->getResourceBytes()); in test_unbudgeted()
655 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_unbudgeted()
656 REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
657 REPORTER_ASSERT(reporter, 21 == cache->getPurgeableBytes()); in test_unbudgeted()
660 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_unbudgeted()
661 REPORTER_ASSERT(reporter, 21 == cache->getResourceBytes()); in test_unbudgeted()
662 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_unbudgeted()
663 REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
664 REPORTER_ASSERT(reporter, 21 == cache->getPurgeableBytes()); in test_unbudgeted()
667 REPORTER_ASSERT(reporter, 3 == cache->getResourceCount()); in test_unbudgeted()
668 REPORTER_ASSERT(reporter, 21 + large == cache->getResourceBytes()); in test_unbudgeted()
669 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_unbudgeted()
670 REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
671 REPORTER_ASSERT(reporter, 21 == cache->getPurgeableBytes()); in test_unbudgeted()
674 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_unbudgeted()
675 REPORTER_ASSERT(reporter, 21 == cache->getResourceBytes()); in test_unbudgeted()
676 REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount()); in test_unbudgeted()
677 REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
678 REPORTER_ASSERT(reporter, 21 == cache->getPurgeableBytes()); in test_unbudgeted()
680 cache->purgeAllUnlocked(); in test_unbudgeted()
681 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_unbudgeted()
682 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_unbudgeted()
683 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_unbudgeted()
684 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_unbudgeted()
685 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_unbudgeted()
693 GrResourceCache* cache = mock.cache(); in test_unbudgeted_to_scratch() local
708 …REPORTER_ASSERT(reporter, nullptr == cache->findAndRefScratchResource(key, TestResource::kDefaultS… in test_unbudgeted_to_scratch()
709 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_unbudgeted_to_scratch()
710 REPORTER_ASSERT(reporter, size == cache->getResourceBytes()); in test_unbudgeted_to_scratch()
711 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_unbudgeted_to_scratch()
712 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_unbudgeted_to_scratch()
713 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_unbudgeted_to_scratch()
717 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_unbudgeted_to_scratch()
718 REPORTER_ASSERT(reporter, size == cache->getResourceBytes()); in test_unbudgeted_to_scratch()
719 REPORTER_ASSERT(reporter, 1 == cache->getBudgetedResourceCount()); in test_unbudgeted_to_scratch()
720 REPORTER_ASSERT(reporter, size == cache->getBudgetedResourceBytes()); in test_unbudgeted_to_scratch()
721 REPORTER_ASSERT(reporter, size == cache->getPurgeableBytes()); in test_unbudgeted_to_scratch()
722 …resource = static_cast<TestResource*>(cache->findAndRefScratchResource(key, TestResource::kDefault… in test_unbudgeted_to_scratch()
736 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_unbudgeted_to_scratch()
737 REPORTER_ASSERT(reporter, size == cache->getResourceBytes()); in test_unbudgeted_to_scratch()
738 REPORTER_ASSERT(reporter, 1 == cache->getBudgetedResourceCount()); in test_unbudgeted_to_scratch()
739 REPORTER_ASSERT(reporter, size == cache->getBudgetedResourceBytes()); in test_unbudgeted_to_scratch()
740 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_unbudgeted_to_scratch()
748 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_unbudgeted_to_scratch()
749 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_unbudgeted_to_scratch()
750 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_unbudgeted_to_scratch()
751 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_unbudgeted_to_scratch()
752 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_unbudgeted_to_scratch()
760 GrResourceCache* cache = mock.cache(); in test_duplicate_scratch_key() local
773 …REPORTER_ASSERT(reporter, nullptr == cache->findAndRefScratchResource(scratchKey1, TestResource::k… in test_duplicate_scratch_key()
780 SkDEBUGCODE(REPORTER_ASSERT(reporter, 2 == cache->countScratchEntriesForKey(scratchKey));) in test_duplicate_scratch_key()
781 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_duplicate_scratch_key()
783 cache->getResourceBytes()); in test_duplicate_scratch_key()
786 cache->purgeAllUnlocked(); in test_duplicate_scratch_key()
788 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_duplicate_scratch_key()
794 SkDEBUGCODE(REPORTER_ASSERT(reporter, 2 == cache->countScratchEntriesForKey(scratchKey));) in test_duplicate_scratch_key()
797 cache->purgeAllUnlocked(); in test_duplicate_scratch_key()
799 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_duplicate_scratch_key()
800 SkDEBUGCODE(REPORTER_ASSERT(reporter, 0 == cache->countScratchEntriesForKey(scratchKey));) in test_duplicate_scratch_key()
806 GrResourceCache* cache = mock.cache(); in test_remove_scratch_key() local
821 …REPORTER_ASSERT(reporter, cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize,… in test_remove_scratch_key()
826 SkDEBUGCODE(REPORTER_ASSERT(reporter, 2 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
827 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_remove_scratch_key()
831 …find = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, GrResourceCache::S… in test_remove_scratch_key()
835 SkDEBUGCODE(REPORTER_ASSERT(reporter, 1 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
836 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_remove_scratch_key()
841 SkDEBUGCODE(REPORTER_ASSERT(reporter, 1 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
842 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_remove_scratch_key()
845 …find = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, GrResourceCache::S… in test_remove_scratch_key()
848 SkDEBUGCODE(REPORTER_ASSERT(reporter, 0 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
849 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_remove_scratch_key()
854 SkDEBUGCODE(REPORTER_ASSERT(reporter, 0 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
855 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_remove_scratch_key()
859 SkDEBUGCODE(REPORTER_ASSERT(reporter, 0 == cache->countScratchEntriesForKey(scratchKey));) in test_remove_scratch_key()
860 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_remove_scratch_key()
866 GrResourceCache* cache = mock.cache(); in test_scratch_key_consistency() local
902 …REPORTER_ASSERT(reporter, cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize,… in test_scratch_key_consistency()
906 …GrGpuResource* find = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, GrR… in test_scratch_key_consistency()
911 …find = cache->findAndRefScratchResource(scratchKey2, TestResource::kDefaultSize, GrResourceCache::… in test_scratch_key_consistency()
915 …GrGpuResource* find2 = cache->findAndRefScratchResource(scratchKey2, TestResource::kDefaultSize, G… in test_scratch_key_consistency()
926 GrResourceCache* cache = mock.cache(); in test_duplicate_unique_key() local
937 REPORTER_ASSERT(reporter, a == cache->findAndRefUniqueResource(key)); in test_duplicate_unique_key()
942 REPORTER_ASSERT(reporter, a == cache->findAndRefUniqueResource(key)); in test_duplicate_unique_key()
944 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_duplicate_unique_key()
945 REPORTER_ASSERT(reporter, a->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
951 REPORTER_ASSERT(reporter, b == cache->findAndRefUniqueResource(key)); in test_duplicate_unique_key()
955 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_duplicate_unique_key()
956 REPORTER_ASSERT(reporter, a->gpuMemorySize() + b->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
961 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_duplicate_unique_key()
962 REPORTER_ASSERT(reporter, b->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
972 REPORTER_ASSERT(reporter, 2 == cache->getResourceCount()); in test_duplicate_unique_key()
973 REPORTER_ASSERT(reporter, b->gpuMemorySize() + c->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
977 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_duplicate_unique_key()
978 REPORTER_ASSERT(reporter, c->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
982 cache->purgeAllUnlocked(); in test_duplicate_unique_key()
983 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_duplicate_unique_key()
984 REPORTER_ASSERT(reporter, c->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
989 REPORTER_ASSERT(reporter, 1 == cache->getResourceCount()); in test_duplicate_unique_key()
990 REPORTER_ASSERT(reporter, c->gpuMemorySize() == cache->getResourceBytes()); in test_duplicate_unique_key()
994 REPORTER_ASSERT(reporter, c == cache->findAndRefUniqueResource(key)); in test_duplicate_unique_key()
997 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_duplicate_unique_key()
998 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_duplicate_unique_key()
1012 sk_sp<GrGpuResource> d2(cache->findAndRefUniqueResource(key3)); in test_duplicate_unique_key()
1019 GrResourceCache* cache = mock.cache(); in test_purge_invalidated() local
1039 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key1)); in test_purge_invalidated()
1040 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key2)); in test_purge_invalidated()
1041 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key3)); in test_purge_invalidated()
1050 cache->purgeAsNeeded(); in test_purge_invalidated()
1052 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key1)); in test_purge_invalidated()
1053 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key2)); in test_purge_invalidated()
1055 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key3)); in test_purge_invalidated()
1059 cache->purgeAsNeeded(); in test_purge_invalidated()
1062 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key3)); in test_purge_invalidated()
1071 …GrGpuResource* scratch = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, … in test_purge_invalidated()
1076 cache->purgeAllUnlocked(); in test_purge_invalidated()
1077 …scratch = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, GrResourceCache… in test_purge_invalidated()
1079 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_purge_invalidated()
1080 REPORTER_ASSERT(reporter, 0 == cache->getResourceBytes()); in test_purge_invalidated()
1088 GrResourceCache* cache = mock.cache(); in test_cache_chained_purge() local
1112 cache->purgeAllUnlocked(); in test_cache_chained_purge()
1119 cache->purgeAllUnlocked(); in test_cache_chained_purge()
1135 GrResourceCache* cache = mock.cache(); in test_timestamp_wrap() local
1139 cache->changeTimestamp(UINT32_MAX - random.nextULessThan(kCount + 1)); in test_timestamp_wrap()
1172 GrGpuResource* res = cache->findAndRefUniqueResource(key); in test_timestamp_wrap()
1192 GrResourceCache* cache = mock.cache(); in test_time_purge() local
1223 cache->purgeResourcesNotUsedSince(timeStamps[i]); in test_time_purge()
1224 REPORTER_ASSERT(reporter, cnt - i - 1 == cache->getResourceCount()); in test_time_purge()
1228 GrGpuResource* r = cache->findAndRefUniqueResource(k); in test_time_purge()
1234 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_time_purge()
1235 cache->purgeAllUnlocked(); in test_time_purge()
1258 cache->purgeResourcesNotUsedSince(timeStamps[i]); in test_time_purge()
1259 REPORTER_ASSERT(reporter, cnt - i / 2 - 1 == cache->getResourceCount()); in test_time_purge()
1265 cache->purgeResourcesNotUsedSince(nowish()); in test_time_purge()
1266 REPORTER_ASSERT(reporter, cnt / 2 - i - 1 == cache->getResourceCount()); in test_time_purge()
1269 cache->purgeAllUnlocked(); in test_time_purge()
1272 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_time_purge()
1284 REPORTER_ASSERT(reporter, 10 == cache->getResourceCount()); in test_time_purge()
1286 REPORTER_ASSERT(reporter, 10 == cache->getResourceCount()); in test_time_purge()
1287 cache->purgeResourcesNotUsedSince(nowish()); in test_time_purge()
1288 REPORTER_ASSERT(reporter, 0 == cache->getResourceCount()); in test_time_purge()
1295 GrResourceCache* cache = mock.cache(); in test_partial_purge() local
1332 REPORTER_ASSERT(reporter, 5 == cache->getBudgetedResourceCount()); in test_partial_purge()
1333 REPORTER_ASSERT(reporter, 60 == cache->getBudgetedResourceBytes()); in test_partial_purge()
1334 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_partial_purge()
1343 REPORTER_ASSERT(reporter, 5 == cache->getBudgetedResourceCount()); in test_partial_purge()
1344 REPORTER_ASSERT(reporter, 60 == cache->getBudgetedResourceBytes()); in test_partial_purge()
1345 REPORTER_ASSERT(reporter, 60 == cache->getPurgeableBytes()); in test_partial_purge()
1350 REPORTER_ASSERT(reporter, 3 == cache->getBudgetedResourceCount()); in test_partial_purge()
1351 REPORTER_ASSERT(reporter, 33 == cache->getBudgetedResourceBytes()); in test_partial_purge()
1356 REPORTER_ASSERT(reporter, 4 == cache->getBudgetedResourceCount()); in test_partial_purge()
1357 REPORTER_ASSERT(reporter, 47 == cache->getBudgetedResourceBytes()); in test_partial_purge()
1362 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_partial_purge()
1363 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_partial_purge()
1368 REPORTER_ASSERT(reporter, 3 == cache->getBudgetedResourceCount()); in test_partial_purge()
1369 REPORTER_ASSERT(reporter, 37 == cache->getBudgetedResourceBytes()); in test_partial_purge()
1374 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_partial_purge()
1375 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceBytes()); in test_partial_purge()
1381 REPORTER_ASSERT(reporter, 5 == cache->getBudgetedResourceCount()); in test_partial_purge()
1382 REPORTER_ASSERT(reporter, 60 == cache->getBudgetedResourceBytes()); in test_partial_purge()
1383 REPORTER_ASSERT(reporter, 60 == cache->getPurgeableBytes()); in test_partial_purge()
1390 REPORTER_ASSERT(reporter, 0 == cache->getBudgetedResourceCount()); in test_partial_purge()
1391 REPORTER_ASSERT(reporter, 0 == cache->getPurgeableBytes()); in test_partial_purge()
1404 GrResourceCache* cache = mock.cache(); in test_large_resource_count() local
1424 REPORTER_ASSERT(reporter, cache->getPurgeableBytes() == 2 * kResourceCnt); in test_large_resource_count()
1425 REPORTER_ASSERT(reporter, cache->getBudgetedResourceBytes() == 2 * kResourceCnt); in test_large_resource_count()
1426 REPORTER_ASSERT(reporter, cache->getBudgetedResourceCount() == 2 * kResourceCnt); in test_large_resource_count()
1427 REPORTER_ASSERT(reporter, cache->getResourceBytes() == 2 * kResourceCnt); in test_large_resource_count()
1428 REPORTER_ASSERT(reporter, cache->getResourceCount() == 2 * kResourceCnt); in test_large_resource_count()
1434 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key1)); in test_large_resource_count()
1435 REPORTER_ASSERT(reporter, cache->hasUniqueKey(key2)); in test_large_resource_count()
1438 cache->purgeAllUnlocked(); in test_large_resource_count()
1440 REPORTER_ASSERT(reporter, cache->getPurgeableBytes() == 0); in test_large_resource_count()
1441 REPORTER_ASSERT(reporter, cache->getBudgetedResourceBytes() == 0); in test_large_resource_count()
1442 REPORTER_ASSERT(reporter, cache->getBudgetedResourceCount() == 0); in test_large_resource_count()
1443 REPORTER_ASSERT(reporter, cache->getResourceBytes() == 0); in test_large_resource_count()
1444 REPORTER_ASSERT(reporter, cache->getResourceCount() == 0); in test_large_resource_count()
1451 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key1)); in test_large_resource_count()
1452 REPORTER_ASSERT(reporter, !cache->hasUniqueKey(key2)); in test_large_resource_count()
1507 GrResourceCache* cache = mock.cache(); in test_tags() local
1536 REPORTER_ASSERT(reporter, cache->countUniqueKeysWithTag(tagStr.c_str()) == i); in test_tags()
1544 GrResourceCache* cache = mock.cache(); in test_free_resource_messages() local
1548 cache->insertCrossContextGpuResource(wrapped1); in test_free_resource_messages()
1553 cache->insertCrossContextGpuResource(wrapped2); in test_free_resource_messages()
1559 cache->insertCrossContextGpuResource(wrapped3); in test_free_resource_messages()
1571 cache->purgeAsNeeded(); in test_free_resource_messages()
1576 cache->purgeAsNeeded(); in test_free_resource_messages()
1582 cache->purgeAsNeeded(); in test_free_resource_messages()