Lines Matching refs:TestResource
235 class TestResource : public GrGpuResource { class
244 TestResource(GrGpu* gpu, SkBudgeted budgeted = SkBudgeted::kYes, size_t size = kDefaultSize) in TestResource() function in TestResource
254 static TestResource* CreateScratch(GrGpu* gpu, SkBudgeted budgeted, in CreateScratch()
256 return new TestResource(gpu, budgeted, property, kScratchConstructor, size); in CreateScratch()
258 static TestResource* CreateWrapped(GrGpu* gpu, GrWrapCacheable cacheable, in CreateWrapped()
260 return new TestResource(gpu, cacheable, size); in CreateWrapped()
263 ~TestResource() override { in ~TestResource()
269 void setUnrefWhenDestroyed(sk_sp<TestResource> resource) { in setUnrefWhenDestroyed()
287 TestResource(GrGpu* gpu, SkBudgeted budgeted, SimulatedProperty property, ScratchConstructor, in TestResource() function in TestResource
299 TestResource(GrGpu* gpu, GrWrapCacheable cacheable, size_t size) in TestResource() function in TestResource
318 sk_sp<TestResource> fToDelete;
325 int TestResource::fNumAlive = 0;
356 TestResource* a = new TestResource(gpu, SkBudgeted::kYes, 11); in test_no_key()
357 TestResource* b = new TestResource(gpu, SkBudgeted::kYes, 12); in test_no_key()
358 TestResource* c = new TestResource(gpu, SkBudgeted::kYes, 13 ); in test_no_key()
359 TestResource* d = new TestResource(gpu, SkBudgeted::kYes, 14 ); in test_no_key()
361 REPORTER_ASSERT(reporter, 4 == TestResource::NumAlive()); in test_no_key()
368 REPORTER_ASSERT(reporter, 4 == TestResource::NumAlive()); in test_no_key()
373 REPORTER_ASSERT(reporter, 3 == TestResource::NumAlive()); in test_no_key()
379 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_no_key()
385 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_no_key()
390 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_no_key()
409 TestResource* a = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_purge_unlocked()
410 TestResource::kA_SimulatedProperty, 11); in test_purge_unlocked()
415 TestResource* b = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_purge_unlocked()
416 TestResource::kA_SimulatedProperty, 12); in test_purge_unlocked()
419 TestResource* c = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_purge_unlocked()
420 TestResource::kA_SimulatedProperty, 13); in test_purge_unlocked()
425 TestResource* d = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_purge_unlocked()
426 TestResource::kA_SimulatedProperty, 14); in test_purge_unlocked()
430 REPORTER_ASSERT(reporter, 4 == TestResource::NumAlive()); in test_purge_unlocked()
437 REPORTER_ASSERT(reporter, 4 == TestResource::NumAlive()); in test_purge_unlocked()
445 REPORTER_ASSERT(reporter, 4 == TestResource::NumAlive()); in test_purge_unlocked()
453 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_unlocked()
461 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_purge_unlocked()
472 TestResource* a = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_purge_command_buffer_usage()
473 TestResource::kA_SimulatedProperty, 11); in test_purge_command_buffer_usage()
475 TestResource* b = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_purge_command_buffer_usage()
476 TestResource::kA_SimulatedProperty, 12); in test_purge_command_buffer_usage()
478 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_command_buffer_usage()
484 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_command_buffer_usage()
493 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_command_buffer_usage()
497 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_command_buffer_usage()
504 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_command_buffer_usage()
509 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_command_buffer_usage()
516 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_purge_command_buffer_usage()
522 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_purge_command_buffer_usage()
529 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_purge_command_buffer_usage()
543 TestResource* scratch = in test_budgeting()
544 TestResource::CreateScratch(gpu, SkBudgeted::kYes, TestResource::kB_SimulatedProperty, in test_budgeting()
546 TestResource* unique = new TestResource(gpu, SkBudgeted::kYes, 11); in test_budgeting()
548 TestResource* wrappedCacheable = TestResource::CreateWrapped(gpu, GrWrapCacheable::kYes, 12); in test_budgeting()
549 TestResource* wrappedUncacheable = TestResource::CreateWrapped(gpu, GrWrapCacheable::kNo, 13); in test_budgeting()
550 TestResource* unbudgeted = new TestResource(gpu, SkBudgeted::kNo, 14); in test_budgeting()
605 wrappedUncacheable = TestResource::CreateWrapped(gpu, GrWrapCacheable::kNo); in test_budgeting()
623 wrappedCacheable = TestResource::CreateWrapped(gpu, GrWrapCacheable::kYes); in test_budgeting()
668 TestResource* scratch; in test_unbudgeted()
669 TestResource* unique; in test_unbudgeted()
670 TestResource* wrapped; in test_unbudgeted()
671 TestResource* unbudgeted; in test_unbudgeted()
674 scratch = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_unbudgeted()
675 TestResource::kB_SimulatedProperty, 10); in test_unbudgeted()
684 unique = new TestResource(gpu, SkBudgeted::kYes, 11); in test_unbudgeted()
694 unbudgeted = new TestResource(gpu, SkBudgeted::kNo, large); in test_unbudgeted()
708 wrapped = TestResource::CreateWrapped(gpu, GrWrapCacheable::kYes, large); in test_unbudgeted()
737 TestResource* resource = in test_unbudgeted_to_scratch()
738 TestResource::CreateScratch(gpu, SkBudgeted::kNo, TestResource::kA_SimulatedProperty); in test_unbudgeted_to_scratch()
740 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &key); in test_unbudgeted_to_scratch()
763 resource = static_cast<TestResource*>(cache->findAndRefScratchResource(key)); in test_unbudgeted_to_scratch()
804 TestResource* a = TestResource::CreateScratch(gpu, in test_duplicate_scratch_key()
806 TestResource::kB_SimulatedProperty, 11); in test_duplicate_scratch_key()
807 TestResource* b = TestResource::CreateScratch(gpu, in test_duplicate_scratch_key()
809 TestResource::kB_SimulatedProperty, 12); in test_duplicate_scratch_key()
811 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &scratchKey1); in test_duplicate_scratch_key()
816 TestResource::ComputeScratchKey(TestResource::kB_SimulatedProperty, &scratchKey); in test_duplicate_scratch_key()
819 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_duplicate_scratch_key()
828 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_duplicate_scratch_key()
834 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_duplicate_scratch_key()
840 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_duplicate_scratch_key()
851 TestResource* a = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_remove_scratch_key()
852 TestResource::kB_SimulatedProperty); in test_remove_scratch_key()
853 TestResource* b = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_remove_scratch_key()
854 TestResource::kB_SimulatedProperty); in test_remove_scratch_key()
860 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &scratchKey); in test_remove_scratch_key()
865 TestResource::ComputeScratchKey(TestResource::kB_SimulatedProperty, &scratchKey); in test_remove_scratch_key()
866 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_remove_scratch_key()
874 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_remove_scratch_key()
880 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_remove_scratch_key()
887 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_remove_scratch_key()
893 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_remove_scratch_key()
898 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_remove_scratch_key()
909 TestResource* a = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_scratch_key_consistency()
910 TestResource::kB_SimulatedProperty); in test_scratch_key_consistency()
911 TestResource* b = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_scratch_key_consistency()
912 TestResource::kB_SimulatedProperty); in test_scratch_key_consistency()
919 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &scratchKey1); in test_scratch_key_consistency()
921 TestResource::ComputeScratchKey(TestResource::kB_SimulatedProperty, &scratchKey2); in test_scratch_key_consistency()
922 REPORTER_ASSERT(reporter, scratchKey1.size() == TestResource::ExpectedScratchKeySize()); in test_scratch_key_consistency()
926 REPORTER_ASSERT(reporter, scratchKey.size() == TestResource::ExpectedScratchKeySize()); in test_scratch_key_consistency()
932 REPORTER_ASSERT(reporter, scratchKey.size() == TestResource::ExpectedScratchKeySize()); in test_scratch_key_consistency()
939 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &scratchKey); in test_scratch_key_consistency()
944 TestResource::ComputeScratchKey(TestResource::kB_SimulatedProperty, &scratchKey); in test_scratch_key_consistency()
971 TestResource* a = new TestResource(gpu, SkBudgeted::kYes, 11); in test_duplicate_unique_key()
984 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_duplicate_unique_key()
987 TestResource* b = new TestResource(gpu, SkBudgeted::kYes, 12); in test_duplicate_unique_key()
995 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_duplicate_unique_key()
1001 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_duplicate_unique_key()
1006 TestResource* c = new TestResource(gpu, SkBudgeted::kYes, 13); in test_duplicate_unique_key()
1012 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_duplicate_unique_key()
1017 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_duplicate_unique_key()
1023 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_duplicate_unique_key()
1029 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_duplicate_unique_key()
1037 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_duplicate_unique_key()
1042 sk_sp<TestResource> d(new TestResource(gpu)); in test_duplicate_unique_key()
1066 TestResource* a = new TestResource(gpu); in test_purge_invalidated()
1067 TestResource* b = new TestResource(gpu); in test_purge_invalidated()
1068 TestResource* c = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_purge_invalidated()
1069 TestResource::kA_SimulatedProperty); in test_purge_invalidated()
1080 REPORTER_ASSERT(reporter, 3 == TestResource::NumAlive()); in test_purge_invalidated()
1092 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_invalidated()
1099 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_purge_invalidated()
1104 REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive()); in test_purge_invalidated()
1108 TestResource::ComputeScratchKey(TestResource::kA_SimulatedProperty, &scratchKey); in test_purge_invalidated()
1116 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_purge_invalidated()
1132 sk_sp<TestResource> a(new TestResource(gpu)); in test_cache_chained_purge()
1133 sk_sp<TestResource> b(new TestResource(gpu)); in test_cache_chained_purge()
1141 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_cache_chained_purge()
1143 TestResource* unownedA = a.release(); in test_cache_chained_purge()
1147 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_cache_chained_purge()
1150 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_cache_chained_purge()
1154 REPORTER_ASSERT(reporter, 2 == TestResource::NumAlive()); in test_cache_chained_purge()
1157 REPORTER_ASSERT(reporter, 0 == TestResource::NumAlive()); in test_cache_chained_purge()
1188 TestResource* r = new TestResource(gpu); in test_timestamp_wrap()
1247 TestResource* r = new TestResource(gpu); in test_time_purge()
1278 TestResource* r = new TestResource(gpu); in test_time_purge()
1315 const TestResource::SimulatedProperty property = TestResource::kA_SimulatedProperty; in test_time_purge()
1316 TestResource* r = isScratch ? TestResource::CreateScratch(gpu, budgeted, property) in test_time_purge()
1317 : new TestResource(gpu, budgeted, property); in test_time_purge()
1343 TestResource* r = new TestResource(gpu); in test_time_purge()
1381 TestResource *unique1 = new TestResource(gpu, SkBudgeted::kYes, 10); in test_partial_purge()
1382 TestResource *unique2 = new TestResource(gpu, SkBudgeted::kYes, 11); in test_partial_purge()
1383 TestResource *unique3 = new TestResource(gpu, SkBudgeted::kYes, 12); in test_partial_purge()
1390 TestResource *scratch1 = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_partial_purge()
1391 TestResource::kA_SimulatedProperty, in test_partial_purge()
1393 TestResource *scratch2 = TestResource::CreateScratch(gpu, SkBudgeted::kYes, in test_partial_purge()
1394 TestResource::kB_SimulatedProperty, in test_partial_purge()
1480 sk_sp<GrGpuResource> resource(new TestResource(gpu)); in test_abandoned()
1510 Mock mock(kNumResources * TestResource::kDefaultSize); in test_tags()
1523 sk_sp<GrGpuResource> resource(new TestResource(gpu)); in test_tags()