Lines Matching refs:reporter
21 void subheap_test(skiatest::Reporter* reporter, GrContext* context) { in subheap_test() argument
28 REPORTER_ASSERT(reporter, heap.alloc(64 * 1024, &alloc0)); in subheap_test()
29 REPORTER_ASSERT(reporter, alloc0.fOffset == 0); in subheap_test()
30 REPORTER_ASSERT(reporter, alloc0.fSize == 64 * 1024); in subheap_test()
31 REPORTER_ASSERT(reporter, heap.freeSize() == 0 && heap.largestBlockSize() == 0); in subheap_test()
33 REPORTER_ASSERT(reporter, heap.freeSize() == 64*1024 && heap.largestBlockSize() == 64 * 1024); in subheap_test()
36 REPORTER_ASSERT(reporter, heap.alloc(16 * 1024, &alloc0)); in subheap_test()
37 REPORTER_ASSERT(reporter, heap.alloc(23 * 1024, &alloc1)); in subheap_test()
38 REPORTER_ASSERT(reporter, heap.alloc(18 * 1024, &alloc2)); in subheap_test()
39 REPORTER_ASSERT(reporter, heap.freeSize() == 7 * 1024 && heap.largestBlockSize() == 7 * 1024); in subheap_test()
42 REPORTER_ASSERT(reporter, heap.freeSize() == 30 * 1024 && heap.largestBlockSize() == 23 * 1024); in subheap_test()
44 REPORTER_ASSERT(reporter, heap.alloc(6 * 1024, &alloc3)); in subheap_test()
45 REPORTER_ASSERT(reporter, heap.freeSize() == 24 * 1024 && heap.largestBlockSize() == 23 * 1024); in subheap_test()
47 REPORTER_ASSERT(reporter, heap.alloc(23 * 1024, &alloc1)); in subheap_test()
48 REPORTER_ASSERT(reporter, heap.freeSize() == 1 * 1024 && heap.largestBlockSize() == 1 * 1024); in subheap_test()
51 REPORTER_ASSERT(reporter, heap.freeSize() == 19 * 1024 && heap.largestBlockSize() == 18 * 1024); in subheap_test()
54 REPORTER_ASSERT(reporter, heap.freeSize() == 25 * 1024 && heap.largestBlockSize() == 25 * 1024); in subheap_test()
57 REPORTER_ASSERT(reporter, heap.freeSize() == 48 * 1024 && heap.largestBlockSize() == 48 * 1024); in subheap_test()
60 REPORTER_ASSERT(reporter, heap.freeSize() == 64 * 1024 && heap.largestBlockSize() == 64 * 1024); in subheap_test()
63 REPORTER_ASSERT(reporter, heap.alloc(4 * 1024, &alloc0)); in subheap_test()
64 REPORTER_ASSERT(reporter, heap.alloc(35 * 1024, &alloc1)); in subheap_test()
65 REPORTER_ASSERT(reporter, heap.alloc(10 * 1024, &alloc2)); in subheap_test()
66 REPORTER_ASSERT(reporter, heap.freeSize() == 15 * 1024 && heap.largestBlockSize() == 15 * 1024); in subheap_test()
69 REPORTER_ASSERT(reporter, heap.freeSize() == 19 * 1024 && heap.largestBlockSize() == 15 * 1024); in subheap_test()
72 REPORTER_ASSERT(reporter, heap.freeSize() == 54 * 1024 && heap.largestBlockSize() == 39 * 1024); in subheap_test()
75 REPORTER_ASSERT(reporter, heap.freeSize() == 64 * 1024 && heap.largestBlockSize() == 64 * 1024); in subheap_test()
78 REPORTER_ASSERT(reporter, heap.alloc(19 * 1024, &alloc0)); in subheap_test()
79 REPORTER_ASSERT(reporter, heap.alloc(5 * 1024, &alloc1)); in subheap_test()
80 REPORTER_ASSERT(reporter, heap.alloc(15 * 1024, &alloc2)); in subheap_test()
81 REPORTER_ASSERT(reporter, heap.alloc(3 * 1024, &alloc3)); in subheap_test()
82 REPORTER_ASSERT(reporter, heap.freeSize() == 22 * 1024 && heap.largestBlockSize() == 22 * 1024); in subheap_test()
84 REPORTER_ASSERT(reporter, heap.freeSize() == 41 * 1024 && heap.largestBlockSize() == 22 * 1024); in subheap_test()
86 REPORTER_ASSERT(reporter, heap.freeSize() == 56 * 1024 && heap.largestBlockSize() == 22 * 1024); in subheap_test()
87 REPORTER_ASSERT(reporter, !heap.alloc(40 * 1024, &alloc0)); in subheap_test()
89 REPORTER_ASSERT(reporter, heap.freeSize() == 59 * 1024 && heap.largestBlockSize() == 40 * 1024); in subheap_test()
90 REPORTER_ASSERT(reporter, heap.alloc(40 * 1024, &alloc0)); in subheap_test()
91 REPORTER_ASSERT(reporter, heap.freeSize() == 19 * 1024 && heap.largestBlockSize() == 19 * 1024); in subheap_test()
93 REPORTER_ASSERT(reporter, heap.freeSize() == 24 * 1024 && heap.largestBlockSize() == 24 * 1024); in subheap_test()
95 REPORTER_ASSERT(reporter, heap.freeSize() == 64 * 1024 && heap.largestBlockSize() == 64 * 1024); in subheap_test()
98 REPORTER_ASSERT(reporter, heap.alloc(19 * 1024 - 31, &alloc0)); in subheap_test()
99 REPORTER_ASSERT(reporter, heap.alloc(5 * 1024 - 5, &alloc1)); in subheap_test()
100 REPORTER_ASSERT(reporter, heap.alloc(15 * 1024 - 19, &alloc2)); in subheap_test()
101 REPORTER_ASSERT(reporter, heap.alloc(3 * 1024 - 3, &alloc3)); in subheap_test()
102 REPORTER_ASSERT(reporter, heap.freeSize() == 22 * 1024 && heap.largestBlockSize() == 22 * 1024); in subheap_test()
104 REPORTER_ASSERT(reporter, heap.freeSize() == 41 * 1024 && heap.largestBlockSize() == 22 * 1024); in subheap_test()
106 REPORTER_ASSERT(reporter, heap.freeSize() == 56 * 1024 && heap.largestBlockSize() == 22 * 1024); in subheap_test()
107 REPORTER_ASSERT(reporter, !heap.alloc(40 * 1024, &alloc0)); in subheap_test()
109 REPORTER_ASSERT(reporter, heap.freeSize() == 59 * 1024 && heap.largestBlockSize() == 40 * 1024); in subheap_test()
110 REPORTER_ASSERT(reporter, heap.alloc(40 * 1024, &alloc0)); in subheap_test()
111 REPORTER_ASSERT(reporter, heap.freeSize() == 19 * 1024 && heap.largestBlockSize() == 19 * 1024); in subheap_test()
113 REPORTER_ASSERT(reporter, heap.freeSize() == 24 * 1024 && heap.largestBlockSize() == 24 * 1024); in subheap_test()
115 REPORTER_ASSERT(reporter, heap.freeSize() == 64 * 1024 && heap.largestBlockSize() == 64 * 1024); in subheap_test()
118 void suballoc_test(skiatest::Reporter* reporter, GrContext* context) { in suballoc_test() argument
128 REPORTER_ASSERT(reporter, heap.allocSize() == 0 && heap.usedSize() == 0); in suballoc_test()
131 REPORTER_ASSERT(reporter, heap.alloc(19 * 1024 - 3, kAlignment, kMemType, kHeapIndex, &alloc0)); in suballoc_test()
132 REPORTER_ASSERT(reporter, heap.alloc(5 * 1024 - 9, kAlignment, kMemType, kHeapIndex, &alloc1)); in suballoc_test()
133 … REPORTER_ASSERT(reporter, heap.alloc(15 * 1024 - 15, kAlignment, kMemType, kHeapIndex, &alloc2)); in suballoc_test()
134 REPORTER_ASSERT(reporter, heap.alloc(3 * 1024 - 6, kAlignment, kMemType, kHeapIndex, &alloc3)); in suballoc_test()
135 REPORTER_ASSERT(reporter, heap.allocSize() == 64 * 1024 && heap.usedSize() == 42 * 1024); in suballoc_test()
137 REPORTER_ASSERT(reporter, heap.allocSize() == 64 * 1024 && heap.usedSize() == 23 * 1024); in suballoc_test()
139 REPORTER_ASSERT(reporter, heap.allocSize() == 64 * 1024 && heap.usedSize() == 8 * 1024); in suballoc_test()
141 REPORTER_ASSERT(reporter, heap.alloc(40 * 1024, kAlignment, kMemType, kHeapIndex, &alloc0)); in suballoc_test()
142 REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 48 * 1024); in suballoc_test()
144 REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 45 * 1024); in suballoc_test()
146 REPORTER_ASSERT(reporter, heap.alloc(40 * 1024, kAlignment, kMemType, kHeapIndex, &alloc3)); in suballoc_test()
147 REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 85 * 1024); in suballoc_test()
149 REPORTER_ASSERT(reporter, heap.alloc(22 * 1024, kAlignment, kMemType, kHeapIndex, &alloc2)); in suballoc_test()
150 REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 107 * 1024); in suballoc_test()
152 REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 102 * 1024); in suballoc_test()
154 REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 62 * 1024); in suballoc_test()
156 REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 40 * 1024); in suballoc_test()
158 REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 0 * 1024); in suballoc_test()
160 REPORTER_ASSERT(reporter, heap.alloc(128 * 1024, kAlignment, kMemType, kHeapIndex, &alloc0)); in suballoc_test()
161 REPORTER_ASSERT(reporter, 0 == alloc0.fSize); in suballoc_test()
162 REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 0 * 1024); in suballoc_test()
164 REPORTER_ASSERT(reporter, heap.alloc(24 * 1024, kAlignment, kMemType, kHeapIndex, &alloc0)); in suballoc_test()
165 REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 24 * 1024); in suballoc_test()
167 REPORTER_ASSERT(reporter, heap.alloc(24 * 1024, kAlignment, kMemType+1, kHeapIndex, &alloc1)); in suballoc_test()
168 REPORTER_ASSERT(reporter, heap.allocSize() == 192 * 1024 && heap.usedSize() == 48 * 1024); in suballoc_test()
170 REPORTER_ASSERT(reporter, heap.alloc(24 * 1024, 128, kMemType, kHeapIndex, &alloc2)); in suballoc_test()
171 REPORTER_ASSERT(reporter, heap.allocSize() == 256 * 1024 && heap.usedSize() == 72 * 1024); in suballoc_test()
175 REPORTER_ASSERT(reporter, heap.allocSize() == 256 * 1024 && heap.usedSize() == 0 * 1024); in suballoc_test()
178 void singlealloc_test(skiatest::Reporter* reporter, GrContext* context) { in singlealloc_test() argument
188 REPORTER_ASSERT(reporter, heap.allocSize() == 0 && heap.usedSize() == 0); in singlealloc_test()
191 REPORTER_ASSERT(reporter, heap.alloc(49 * 1024 - 3, kAlignment, kMemType, kHeapIndex, &alloc0)); in singlealloc_test()
192 REPORTER_ASSERT(reporter, heap.alloc(5 * 1024 - 37, kAlignment, kMemType, kHeapIndex, &alloc1)); in singlealloc_test()
193 … REPORTER_ASSERT(reporter, heap.alloc(15 * 1024 - 11, kAlignment, kMemType, kHeapIndex, &alloc2)); in singlealloc_test()
194 REPORTER_ASSERT(reporter, heap.alloc(3 * 1024 - 29, kAlignment, kMemType, kHeapIndex, &alloc3)); in singlealloc_test()
195 REPORTER_ASSERT(reporter, heap.allocSize() == 72 * 1024 && heap.usedSize() == 72 * 1024); in singlealloc_test()
197 REPORTER_ASSERT(reporter, heap.allocSize() == 72 * 1024 && heap.usedSize() == 23 * 1024); in singlealloc_test()
199 REPORTER_ASSERT(reporter, heap.allocSize() == 72 * 1024 && heap.usedSize() == 8 * 1024); in singlealloc_test()
201 REPORTER_ASSERT(reporter, heap.alloc(40 * 1024, kAlignment, kMemType, kHeapIndex, &alloc0)); in singlealloc_test()
202 REPORTER_ASSERT(reporter, heap.allocSize() == 72 * 1024 && heap.usedSize() == 48 * 1024); in singlealloc_test()
204 REPORTER_ASSERT(reporter, heap.allocSize() == 72 * 1024 && heap.usedSize() == 45 * 1024); in singlealloc_test()
206 … REPORTER_ASSERT(reporter, heap.alloc(15 * 1024 - 63, kAlignment, kMemType, kHeapIndex, &alloc2)); in singlealloc_test()
207 REPORTER_ASSERT(reporter, heap.allocSize() == 72 * 1024 && heap.usedSize() == 60 * 1024); in singlealloc_test()
209 REPORTER_ASSERT(reporter, heap.allocSize() == 72 * 1024 && heap.usedSize() == 45 * 1024); in singlealloc_test()
211 REPORTER_ASSERT(reporter, heap.alloc(40 * 1024, kAlignment, kMemType, kHeapIndex, &alloc3)); in singlealloc_test()
212 REPORTER_ASSERT(reporter, heap.allocSize() == 112 * 1024 && heap.usedSize() == 85 * 1024); in singlealloc_test()
214 REPORTER_ASSERT(reporter, heap.allocSize() == 112 * 1024 && heap.usedSize() == 80 * 1024); in singlealloc_test()
216 REPORTER_ASSERT(reporter, heap.allocSize() == 112 * 1024 && heap.usedSize() == 40 * 1024); in singlealloc_test()
218 REPORTER_ASSERT(reporter, heap.allocSize() == 112 * 1024 && heap.usedSize() == 0 * 1024); in singlealloc_test()
219 REPORTER_ASSERT(reporter, heap.alloc(24 * 1024, kAlignment, kMemType, kHeapIndex, &alloc0)); in singlealloc_test()
220 REPORTER_ASSERT(reporter, heap.allocSize() == 112 * 1024 && heap.usedSize() == 24 * 1024); in singlealloc_test()
222 REPORTER_ASSERT(reporter, heap.alloc(24 * 1024, kAlignment, kMemType + 1, kHeapIndex, &alloc1)); in singlealloc_test()
223 REPORTER_ASSERT(reporter, heap.allocSize() == 136 * 1024 && heap.usedSize() == 48 * 1024); in singlealloc_test()
225 REPORTER_ASSERT(reporter, heap.alloc(24 * 1024, 128, kMemType, kHeapIndex, &alloc2)); in singlealloc_test()
226 REPORTER_ASSERT(reporter, heap.allocSize() == 160 * 1024 && heap.usedSize() == 72 * 1024); in singlealloc_test()
230 REPORTER_ASSERT(reporter, heap.allocSize() == 160 * 1024 && heap.usedSize() == 0 * 1024); in singlealloc_test()
233 DEF_GPUTEST_FOR_VULKAN_CONTEXT(VkHeapTests, reporter, ctxInfo) { in DEF_GPUTEST_FOR_VULKAN_CONTEXT() argument
234 subheap_test(reporter, ctxInfo.grContext()); in DEF_GPUTEST_FOR_VULKAN_CONTEXT()
235 suballoc_test(reporter, ctxInfo.grContext()); in DEF_GPUTEST_FOR_VULKAN_CONTEXT()
236 singlealloc_test(reporter, ctxInfo.grContext()); in DEF_GPUTEST_FOR_VULKAN_CONTEXT()