Lines Matching refs:TestResource

241 class TestResource : public GrGpuResource {  class
250 TestResource(GrGpu* gpu, size_t size, GrGpuResource::LifeCycle lifeCycle) in TestResource() function in TestResource
259 TestResource(GrGpu* gpu, GrGpuResource::LifeCycle lifeCycle) in TestResource() function in TestResource
268 TestResource(GrGpu* gpu) in TestResource() function in TestResource
277 static TestResource* CreateScratch(GrGpu* gpu, SimulatedProperty property, bool cached = true) { in CreateScratch()
278 return new TestResource(gpu, property, cached, kScratchConstructor); in CreateScratch()
281 ~TestResource() { in ~TestResource()
293 void setUnrefWhenDestroyed(TestResource* resource) { in setUnrefWhenDestroyed()
312 TestResource(GrGpu* gpu, SimulatedProperty property, bool cached, ScratchConstructor) in TestResource() function in TestResource
326 TestResource* fToDelete;
332 int TestResource::fNumAlive = 0;
359 TestResource* a = new TestResource(context->getGpu()); in test_no_key()
360 TestResource* b = new TestResource(context->getGpu()); in test_no_key()
361 TestResource* c = new TestResource(context->getGpu()); in test_no_key()
362 TestResource* d = new TestResource(context->getGpu()); in test_no_key()
368 REPORTER_ASSERT(reporter, 4 == TestResource::NumAlive()); in test_no_key()
375 REPORTER_ASSERT(reporter, 4 == TestResource::NumAlive()); in test_no_key()
380 REPORTER_ASSERT(reporter, 3 == TestResource::NumAlive()); in test_no_key()
386 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_no_key()
392 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_no_key()
397 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_no_key()
418 TestResource* scratch = in test_budgeting()
419 TestResource::CreateScratch(context->getGpu(), TestResource::kB_SimulatedProperty); in test_budgeting()
421 TestResource* unique = new TestResource(context->getGpu()); in test_budgeting()
424 TestResource* wrapped = new TestResource(context->getGpu(), GrGpuResource::kBorrowed_LifeCycle); in test_budgeting()
426 TestResource* unbudgeted = in test_budgeting()
427 new TestResource(context->getGpu(), GrGpuResource::kUncached_LifeCycle); in test_budgeting()
462 wrapped = new TestResource(context->getGpu(), GrGpuResource::kBorrowed_LifeCycle); in test_budgeting()
501 TestResource* scratch; in test_unbudgeted()
502 TestResource* unique; in test_unbudgeted()
503 TestResource* wrapped; in test_unbudgeted()
504 TestResource* unbudgeted; in test_unbudgeted()
507 scratch = TestResource::CreateScratch(context->getGpu(), TestResource::kB_SimulatedProperty); in test_unbudgeted()
515 unique = new TestResource(context->getGpu()); in test_unbudgeted()
525 unbudgeted = new TestResource(context->getGpu(), large, GrGpuResource::kUncached_LifeCycle); in test_unbudgeted()
537 wrapped = new TestResource(context->getGpu(), large, GrGpuResource::kBorrowed_LifeCycle); in test_unbudgeted()
563 TestResource* resource = in test_unbudgeted_to_scratch()
564 TestResource::CreateScratch(context->getGpu(), TestResource::kA_SimulatedProperty, false); in test_unbudgeted_to_scratch()
566 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &key); in test_unbudgeted_to_scratch()
574 …REPORTER_ASSERT(reporter, nullptr == cache->findAndRefScratchResource(key, TestResource::kDefaultS… in test_unbudgeted_to_scratch()
586 …resource = static_cast<TestResource*>(cache->findAndRefScratchResource(key, TestResource::kDefault… in test_unbudgeted_to_scratch()
623 TestResource* a = TestResource::CreateScratch(context->getGpu(), in test_duplicate_scratch_key()
624 TestResource::kB_SimulatedProperty); in test_duplicate_scratch_key()
625 TestResource* b = TestResource::CreateScratch(context->getGpu(), in test_duplicate_scratch_key()
626 TestResource::kB_SimulatedProperty); in test_duplicate_scratch_key()
630 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &scratchKey1); in test_duplicate_scratch_key()
632 …REPORTER_ASSERT(reporter, nullptr == cache->findAndRefScratchResource(scratchKey1, TestResource::k… in test_duplicate_scratch_key()
635 TestResource::ComputeScratchKey(TestResource::kB_SimulatedProperty, &scratchKey); in test_duplicate_scratch_key()
638 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_duplicate_scratch_key()
646 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_duplicate_scratch_key()
652 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_duplicate_scratch_key()
657 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_duplicate_scratch_key()
668 TestResource* a = TestResource::CreateScratch(context->getGpu(), in test_remove_scratch_key()
669 TestResource::kB_SimulatedProperty); in test_remove_scratch_key()
670 TestResource* b = TestResource::CreateScratch(context->getGpu(), in test_remove_scratch_key()
671 TestResource::kB_SimulatedProperty); in test_remove_scratch_key()
677 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &scratchKey); in test_remove_scratch_key()
679 …REPORTER_ASSERT(reporter, cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize,… in test_remove_scratch_key()
682 TestResource::ComputeScratchKey(TestResource::kB_SimulatedProperty, &scratchKey); in test_remove_scratch_key()
683 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_remove_scratch_key()
689 find = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, 0); in test_remove_scratch_key()
692 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_remove_scratch_key()
698 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_remove_scratch_key()
703 find = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, 0); in test_remove_scratch_key()
705 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_remove_scratch_key()
711 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_remove_scratch_key()
716 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_remove_scratch_key()
727 TestResource* a = TestResource::CreateScratch(context->getGpu(), in test_scratch_key_consistency()
728 TestResource::kB_SimulatedProperty); in test_scratch_key_consistency()
729 TestResource* b = TestResource::CreateScratch(context->getGpu(), in test_scratch_key_consistency()
730 TestResource::kB_SimulatedProperty); in test_scratch_key_consistency()
737 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &scratchKey1); in test_scratch_key_consistency()
739 TestResource::ComputeScratchKey(TestResource::kB_SimulatedProperty, &scratchKey2); in test_scratch_key_consistency()
740 REPORTER_ASSERT(reporter, scratchKey1.size() == TestResource::ExpectedScratchKeySize()); in test_scratch_key_consistency()
744 REPORTER_ASSERT(reporter, scratchKey.size() == TestResource::ExpectedScratchKeySize()); in test_scratch_key_consistency()
750 REPORTER_ASSERT(reporter, scratchKey.size() == TestResource::ExpectedScratchKeySize()); in test_scratch_key_consistency()
757 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &scratchKey); in test_scratch_key_consistency()
759 …REPORTER_ASSERT(reporter, cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize,… in test_scratch_key_consistency()
762 TestResource::ComputeScratchKey(TestResource::kB_SimulatedProperty, &scratchKey); in test_scratch_key_consistency()
763 … GrGpuResource* find = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, 0); in test_scratch_key_consistency()
768 find = cache->findAndRefScratchResource(scratchKey2, TestResource::kDefaultSize, 0); in test_scratch_key_consistency()
772 …GrGpuResource* find2 = cache->findAndRefScratchResource(scratchKey2, TestResource::kDefaultSize, 0… in test_scratch_key_consistency()
789 TestResource* a = new TestResource(context->getGpu()); in test_duplicate_unique_key()
803 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_duplicate_unique_key()
806 TestResource* b = new TestResource(context->getGpu()); in test_duplicate_unique_key()
815 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_duplicate_unique_key()
821 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_duplicate_unique_key()
826 TestResource* c = new TestResource(context->getGpu()); in test_duplicate_unique_key()
833 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_duplicate_unique_key()
838 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_duplicate_unique_key()
844 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_duplicate_unique_key()
850 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_duplicate_unique_key()
858 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_duplicate_unique_key()
863 SkAutoTUnref<TestResource> d(new TestResource(context->getGpu())); in test_duplicate_unique_key()
887 TestResource* a = new TestResource(context->getGpu()); in test_purge_invalidated()
888 TestResource* b = new TestResource(context->getGpu()); in test_purge_invalidated()
889 TestResource* c = TestResource::CreateScratch(context->getGpu(), in test_purge_invalidated()
890 TestResource::kA_SimulatedProperty); in test_purge_invalidated()
901 REPORTER_ASSERT(reporter, 3 == TestResource::NumAlive()); in test_purge_invalidated()
913 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_invalidated()
920 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_invalidated()
925 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_purge_invalidated()
929 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &scratchKey); in test_purge_invalidated()
930 …GrGpuResource* scratch = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, … in test_purge_invalidated()
936 scratch = cache->findAndRefScratchResource(scratchKey, TestResource::kDefaultSize, 0); in test_purge_invalidated()
937 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_purge_invalidated()
953 TestResource* a = new TestResource(context->getGpu()); in test_cache_chained_purge()
954 TestResource* b = new TestResource(context->getGpu()); in test_cache_chained_purge()
962 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_cache_chained_purge()
967 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_cache_chained_purge()
970 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_cache_chained_purge()
974 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_cache_chained_purge()
977 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_cache_chained_purge()
991 TestResource* a = new TestResource(context->getGpu()); in test_resource_size_changed()
995 TestResource* b = new TestResource(context->getGpu()); in test_resource_size_changed()
1002 SkAutoTUnref<TestResource> find2( in test_resource_size_changed()
1003 static_cast<TestResource*>(cache->findAndRefUniqueResource(key2))); in test_resource_size_changed()
1005 SkAutoTUnref<TestResource> find1( in test_resource_size_changed()
1006 static_cast<TestResource*>(cache->findAndRefUniqueResource(key1))); in test_resource_size_changed()
1020 TestResource* a = new TestResource(context->getGpu()); in test_resource_size_changed()
1025 TestResource* b = new TestResource(context->getGpu()); in test_resource_size_changed()
1034 SkAutoTUnref<TestResource> find2(static_cast<TestResource*>( in test_resource_size_changed()
1074 TestResource* r = new TestResource(context->getGpu()); in test_timestamp_wrap()
1123 TestResource* r = new TestResource(context->getGpu()); in test_flush()
1154 TestResource* r = new TestResource(context->getGpu()); in test_flush()
1207 TestResource* resource; in test_large_resource_count()
1209 resource = new TestResource(context->getGpu()); in test_large_resource_count()
1214 resource = new TestResource(context->getGpu()); in test_large_resource_count()
1220 REPORTER_ASSERT(reporter, TestResource::NumAlive() == 2 * kResourceCnt); in test_large_resource_count()
1235 REPORTER_ASSERT(reporter, TestResource::NumAlive() == 0); in test_large_resource_count()
1269 SkAutoTUnref<GrGpuResource> resource(new TestResource(context->getGpu())); in test_abandoned()