Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

52 static void TestDeferredCanvasBitmapAccess(skiatest::Reporter* reporter) {
61 REPORTER_ASSERT(reporter, 0xFFFFFFFF == read_pixel(surface, 0, 0));
66 REPORTER_ASSERT(reporter, 0 == read_pixel(surface, 0, 0));
105 static void TestDeferredCanvasWritePixelsToSurface(skiatest::Reporter* reporter) {
117 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
118 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
122 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
123 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
129 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
130 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
134 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
135 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
139 REPORTER_ASSERT(reporter, 1 == surface->fDiscardCount);
140 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
145 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
146 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
151 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
152 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
158 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
159 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
163 REPORTER_ASSERT(reporter, 1 == surface->fDiscardCount);
164 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
168 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
169 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
175 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
176 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
180 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
181 REPORTER_ASSERT(reporter, 1 == surface->fRetainCount);
185 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
186 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
192 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
193 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
197 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
198 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
202 REPORTER_ASSERT(reporter, 1 == surface->fDiscardCount);
203 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
207 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
208 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
214 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
215 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
219 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
220 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
224 REPORTER_ASSERT(reporter, 1 == surface->fDiscardCount); // because of the clear
225 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
229 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
230 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
237 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
238 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
243 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
244 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
248 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
249 REPORTER_ASSERT(reporter, 1 == surface->fRetainCount);
253 REPORTER_ASSERT(reporter, 0 == surface->fDiscardCount);
254 REPORTER_ASSERT(reporter, 0 == surface->fRetainCount);
257 static void TestDeferredCanvasFlush(skiatest::Reporter* reporter) {
264 REPORTER_ASSERT(reporter, 0xFFFFFFFF == read_pixel(surface, 0, 0));
269 REPORTER_ASSERT(reporter, 0 == read_pixel(surface, 0, 0));
272 static void TestDeferredCanvasFreshFrame(skiatest::Reporter* reporter) {
284 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
286 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
290 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
296 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
302 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
310 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
319 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
327 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
339 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
349 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
365 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
377 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
386 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
399 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
411 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
420 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
430 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
478 static void TestDeferredCanvasMemoryLimit(skiatest::Reporter* reporter) {
496 REPORTER_ASSERT(reporter, 1 == notificationCounter.fFlushedDrawCommandsCount);
499 static void TestDeferredCanvasSilentFlush(skiatest::Reporter* reporter) {
508 REPORTER_ASSERT(reporter, 0 == notificationCounter.fFlushedDrawCommandsCount);
509 REPORTER_ASSERT(reporter, 1 == notificationCounter.fSkippedPendingDrawCommandsCount);
512 static void TestDeferredCanvasBitmapCaching(skiatest::Reporter* reporter) {
528 REPORTER_ASSERT(reporter, 1 == notificationCounter.fStorageAllocatedChangedCount);
530 REPORTER_ASSERT(reporter, canvas->storageAllocatedForRecording() > bitmapSize);
533 REPORTER_ASSERT(reporter, 0 == canvas->freeMemoryIfPossible(~0U));
536 REPORTER_ASSERT(reporter, 0 == notificationCounter.fFlushedDrawCommandsCount);
537 REPORTER_ASSERT(reporter, 0 == notificationCounter.fPrepareForDrawCount);
539 REPORTER_ASSERT(reporter, 1 == notificationCounter.fFlushedDrawCommandsCount);
540 REPORTER_ASSERT(reporter, 1 == notificationCounter.fPrepareForDrawCount);
541 REPORTER_ASSERT(reporter, canvas->storageAllocatedForRecording() >= bitmapSize);
544 REPORTER_ASSERT(reporter, canvas->freeMemoryIfPossible(~0U) >= bitmapSize);
548 REPORTER_ASSERT(reporter, 2 == notificationCounter.fStorageAllocatedChangedCount);
550 REPORTER_ASSERT(reporter, 3 == notificationCounter.fStorageAllocatedChangedCount);
551 REPORTER_ASSERT(reporter, 1 == notificationCounter.fFlushedDrawCommandsCount);
552 REPORTER_ASSERT(reporter, canvas->storageAllocatedForRecording() < 2 * bitmapSize);
556 REPORTER_ASSERT(reporter, 1 == notificationCounter.fFlushedDrawCommandsCount);
558 REPORTER_ASSERT(reporter, 2 == notificationCounter.fFlushedDrawCommandsCount);
559 REPORTER_ASSERT(reporter, canvas->storageAllocatedForRecording() > 2 * bitmapSize);
561 REPORTER_ASSERT(reporter, 2 == notificationCounter.fFlushedDrawCommandsCount);
562 REPORTER_ASSERT(reporter, bytesFreed >= bitmapSize);
563 REPORTER_ASSERT(reporter, bytesFreed < 2*bitmapSize);
568 REPORTER_ASSERT(reporter, 2 == notificationCounter.fFlushedDrawCommandsCount);
574 REPORTER_ASSERT(reporter, bytesFreed >= bitmapSize);
575 REPORTER_ASSERT(reporter, bytesFreed < 2*bitmapSize);
579 REPORTER_ASSERT(reporter, canvas->storageAllocatedForRecording() < bitmapSize);
585 REPORTER_ASSERT(reporter, canvas->storageAllocatedForRecording() > 2*bitmapSize);
588 REPORTER_ASSERT(reporter, 0 == notificationCounter.fSkippedPendingDrawCommandsCount);
591 static void TestDeferredCanvasSkip(skiatest::Reporter* reporter) {
598 REPORTER_ASSERT(reporter, 1 == notificationCounter.fSkippedPendingDrawCommandsCount);
599 REPORTER_ASSERT(reporter, 0 == notificationCounter.fFlushedDrawCommandsCount);
601 REPORTER_ASSERT(reporter, 1 == notificationCounter.fSkippedPendingDrawCommandsCount);
602 REPORTER_ASSERT(reporter, 1 == notificationCounter.fFlushedDrawCommandsCount);
606 static void TestDeferredCanvasBitmapShaderNoLeak(skiatest::Reporter* reporter) {
632 REPORTER_ASSERT(reporter, newBytesAllocated > bytesAllocated);
635 REPORTER_ASSERT(reporter, newBytesAllocated == bytesAllocated);
641 REPORTER_ASSERT(reporter, 0 == canvas->storageAllocatedForRecording());
644 static void TestDeferredCanvasBitmapSizeThreshold(skiatest::Reporter* reporter) {
657 REPORTER_ASSERT(reporter, newBytesAllocated == 0);
666 REPORTER_ASSERT(reporter, newBytesAllocated > 0);
675 REPORTER_ASSERT(reporter, newBytesAllocated > 0);
689 static void TestDeferredCanvasSurface(skiatest::Reporter* reporter, GrContextFactory* factory) {
724 REPORTER_ASSERT(reporter, image1->uniqueID() == image2->uniqueID());
729 REPORTER_ASSERT(reporter, image1->uniqueID() != image3->uniqueID());
733 REPORTER_ASSERT(reporter, pixels1 != pixels2);
740 REPORTER_ASSERT(reporter, image4->uniqueID() != image3->uniqueID());
742 REPORTER_ASSERT(reporter, pixels2 != pixels3);
752 REPORTER_ASSERT(reporter, pixels4 == pixels5);
755 static void TestDeferredCanvasSetSurface(skiatest::Reporter* reporter, GrContextFactory* factory) {
787 REPORTER_ASSERT(reporter, image1->uniqueID() != image2->uniqueID());
789 REPORTER_ASSERT(reporter, getSurfacePixelPtr(surface, useGpu) == pixels1);
790 REPORTER_ASSERT(reporter, getSurfacePixelPtr(alternateSurface, useGpu) == pixels2);
794 REPORTER_ASSERT(reporter, getSurfacePixelPtr(surface, useGpu) == pixels1);
795 REPORTER_ASSERT(reporter, getSurfacePixelPtr(alternateSurface, useGpu) != pixels2);
798 static void TestDeferredCanvasCreateCompatibleDevice(skiatest::Reporter* reporter) {
813 REPORTER_ASSERT(reporter, notificationCounter.fStorageAllocatedChangedCount == 0);
816 REPORTER_ASSERT(reporter, notificationCounter.fStorageAllocatedChangedCount == 1);
819 DEF_TEST(DeferredCanvas_CPU, reporter) {
820 TestDeferredCanvasBitmapAccess(reporter);
821 TestDeferredCanvasFlush(reporter);
822 TestDeferredCanvasSilentFlush(reporter);
823 TestDeferredCanvasFreshFrame(reporter);
824 TestDeferredCanvasMemoryLimit(reporter);
825 reporter);
826 TestDeferredCanvasSkip(reporter);
827 TestDeferredCanvasBitmapShaderNoLeak(reporter);
828 TestDeferredCanvasBitmapSizeThreshold(reporter);
829 TestDeferredCanvasCreateCompatibleDevice(reporter);
830 TestDeferredCanvasWritePixelsToSurface(reporter);
831 TestDeferredCanvasSurface(reporter, NULL);
832 TestDeferredCanvasSetSurface(reporter, NULL);
835 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) {
837 TestDeferredCanvasSurface(reporter, factory);
838 TestDeferredCanvasSetSurface(reporter, factory);