Lines Matching defs:reporter

85 DEF_TEST(SurfaceEmpty, reporter) {
87 REPORTER_ASSERT(reporter, nullptr == SkSurface::MakeRaster(info));
88 REPORTER_ASSERT(reporter, nullptr == SkSurface::MakeRasterDirect(info, nullptr, 0));
91 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceEmpty_Gpu, reporter, ctxInfo) {
93 REPORTER_ASSERT(reporter, nullptr ==
97 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsSurface, reporter, ctxInfo) {
109 REPORTER_ASSERT(reporter, can == SkToBool(surf), "ct: %d, can: %d, surf: %d",
117 REPORTER_ASSERT(reporter, can == SkToBool(surf), "ct: %d, can: %d, surf: %d",
128 REPORTER_ASSERT(reporter, can == SkToBool(surf), "ct: %d, can: %d, surf: %d",
133 REPORTER_ASSERT(reporter, can == SkToBool(surf),
143 REPORTER_ASSERT(reporter, storedCnt == allowedCnt,
168 REPORTER_ASSERT(reporter, can == SkToBool(surf), "ct: %d, sc: %d, can: %d, surf: %d",
176 REPORTER_ASSERT(reporter, storedCnt == allowedCnt,
184 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_maxSurfaceSamplesForColorType, reporter, ctxInfo) {
204 ERRORF(reporter, "Could not make surface of color type %d.", colorType);
209 REPORTER_ASSERT(reporter, sampleCnt == maxSampleCnt, "Exected: %d, actual: %d",
214 static void test_canvas_peek(skiatest::Reporter* reporter,
224 REPORTER_ASSERT(reporter, expectPeekSuccess == success);
230 REPORTER_ASSERT(reporter, requestInfo == pmap.info());
231 REPORTER_ASSERT(reporter, requestInfo.minRowBytes() <= pmap.rowBytes());
232 REPORTER_ASSERT(reporter, pmcolor == *pmap.addr32());
234 REPORTER_ASSERT(reporter, pmap.addr() == pmap2.addr());
235 REPORTER_ASSERT(reporter, pmap.info() == pmap2.info());
236 REPORTER_ASSERT(reporter, pmap.rowBytes() == pmap2.rowBytes());
238 REPORTER_ASSERT(reporter, nullptr == addr2);
241 DEF_TEST(SurfaceCanvasPeek, reporter) {
245 test_canvas_peek(reporter, surface, requestInfo, true);
248 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCanvasPeek_Gpu, reporter, ctxInfo) {
252 test_canvas_peek(reporter, surface, requestInfo, false);
256 static void test_snapshot_alphatype(skiatest::Reporter* reporter, const sk_sp<SkSurface>& surface,
258 REPORTER_ASSERT(reporter, surface);
261 REPORTER_ASSERT(reporter, image);
263 REPORTER_ASSERT(reporter, image->alphaType() == expectedAlphaType);
267 DEF_TEST(SurfaceSnapshotAlphaType, reporter) {
271 test_snapshot_alphatype(reporter, surface, at);
275 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceSnapshotAlphaType_Gpu, reporter, ctxInfo) {
280 test_snapshot_alphatype(reporter, surface, at);
286 skiatest::Reporter* reporter, SkSurface* surface, SkSurface::BackendHandleAccess access) {
294 REPORTER_ASSERT(reporter, GrBackendTexture::TestingOnly_Equals(tex1, tex2) == (snap1 == snap2));
298 skiatest::Reporter* reporter, SkSurface* surface, SkSurface::BackendHandleAccess access) {
306 REPORTER_ASSERT(reporter, GrBackendRenderTarget::TestingOnly_Equals(rt1, rt2) ==
310 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBackendSurfaceAccessCopyOnWrite_Gpu, reporter, ctxInfo) {
321 test_backend_texture_access_copy_on_write(reporter, surface.get(), accessMode);
325 test_backend_rendertarget_access_copy_on_write(reporter, surface.get(), accessMode);
332 static void test_backend_unique_id(skiatest::Reporter* reporter, SkSurface* surface) {
336 REPORTER_ASSERT(reporter, obj.isValid());
339 REPORTER_ASSERT(reporter, image0->uniqueID() == image1->uniqueID());
342 REPORTER_ASSERT(reporter, obj.isValid());
345 REPORTER_ASSERT(reporter, image0->uniqueID() != image2->uniqueID());
348 REPORTER_ASSERT(reporter, obj.isValid());
351 REPORTER_ASSERT(reporter, image0->uniqueID() != image3->uniqueID());
352 REPORTER_ASSERT(reporter, image2->uniqueID() != image3->uniqueID());
356 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBackendHandleAccessIDs_Gpu, reporter, ctxInfo) {
360 test_backend_unique_id<GrBackendTexture, &SkSurface::getBackendTexture>(reporter,
366 reporter, surface.get());
372 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceAbandonPostFlush_Gpu, reporter, ctxInfo) {
387 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBackendAccessAbandoned_Gpu, reporter, ctxInfo) {
396 REPORTER_ASSERT(reporter, beRT.isValid());
399 REPORTER_ASSERT(reporter, beTex.isValid());
406 REPORTER_ASSERT(reporter, !beRT.isValid());
408 REPORTER_ASSERT(reporter, !beTex.isValid());
412 static void test_copy_on_write(skiatest::Reporter* reporter, SkSurface* surface) {
453 REPORTER_ASSERT(reporter, imageBefore != imageAfter); \
468 DEF_TEST(SurfaceCopyOnWrite, reporter) {
469 test_copy_on_write(reporter, create_surface().get());
471 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCopyOnWrite_Gpu, reporter, ctxInfo) {
474 test_copy_on_write(reporter, surface.get());
478 static void test_writable_after_snapshot_release(skiatest::Reporter* reporter,
488 DEF_TEST(SurfaceWriteableAfterSnapshotRelease, reporter) {
489 test_writable_after_snapshot_release(reporter, create_surface().get());
491 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceWriteableAfterSnapshotRelease_Gpu, reporter, ctxInfo) {
494 test_writable_after_snapshot_release(reporter, surface.get());
498 static void test_crbug263329(skiatest::Reporter* reporter,
529 REPORTER_ASSERT(reporter, imageProxy(image4.get()) != imageProxy(image3.get()));
531 REPORTER_ASSERT(reporter, imageProxy(image4.get()) != imageProxy(image2.get()));
532 REPORTER_ASSERT(reporter, imageProxy(image4.get()) != imageProxy(image1.get()));
533 REPORTER_ASSERT(reporter, imageProxy(image3.get()) != imageProxy(image2.get()));
534 REPORTER_ASSERT(reporter, imageProxy(image3.get()) != imageProxy(image1.get()));
535 REPORTER_ASSERT(reporter, imageProxy(image2.get()) != imageProxy(image1.get()));
537 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCRBug263329_Gpu, reporter, ctxInfo) {
541 test_crbug263329(reporter, surface1.get(), surface2.get());
545 DEF_TEST(SurfaceGetTexture, reporter) {
548 REPORTER_ASSERT(reporter, !as_IB(image)->isTextureBacked());
550 REPORTER_ASSERT(reporter, !as_IB(image)->isTextureBacked());
552 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacepeekTexture_Gpu, reporter, ctxInfo) {
557 REPORTER_ASSERT(reporter, as_IB(image)->isTextureBacked());
559 REPORTER_ASSERT(reporter, backendTex.isValid());
561 REPORTER_ASSERT(reporter, as_IB(image)->isTextureBacked());
563 REPORTER_ASSERT(reporter, GrBackendTexture::TestingOnly_Equals(backendTex, backendTex2));
578 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBudget, reporter, ctxInfo) {
584 REPORTER_ASSERT(reporter, budgeted == is_budgeted(surface));
590 REPORTER_ASSERT(reporter, budgeted == is_budgeted(surface));
591 REPORTER_ASSERT(reporter, budgeted == is_budgeted(image.get(), dContext));
597 REPORTER_ASSERT(reporter, budgeted == is_budgeted(surface));
598 REPORTER_ASSERT(reporter, budgeted == is_budgeted(image.get(), dContext));
602 static void test_no_canvas1(skiatest::Reporter* reporter,
608 static void test_no_canvas2(skiatest::Reporter* reporter,
618 REPORTER_ASSERT(reporter, image1 != image2);
620 DEF_TEST(SurfaceNoCanvas, reporter) {
625 test_func(reporter, create_surface().get(), mode);
629 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceNoCanvas_Gpu, reporter, ctxInfo) {
636 test_func(reporter, surface.get(), mode);
642 static void check_rowbytes_remain_consistent(SkSurface* surface, skiatest::Reporter* reporter) {
644 REPORTER_ASSERT(reporter, surface->peekPixels(&surfacePM));
648 REPORTER_ASSERT(reporter, image->peekPixels(&pm));
650 REPORTER_ASSERT(reporter, surfacePM.rowBytes() == pm.rowBytes());
655 REPORTER_ASSERT(reporter, image->uniqueID() != image2->uniqueID());
658 REPORTER_ASSERT(reporter, image2->peekPixels(&pm2));
659 REPORTER_ASSERT(reporter, pm2.rowBytes() == pm.rowBytes());
662 DEF_TEST(surface_rowbytes, reporter) {
666 check_rowbytes_remain_consistent(surf0.get(), reporter);
670 check_rowbytes_remain_consistent(surf1.get(), reporter);
674 REPORTER_ASSERT(reporter, nullptr == s);
676 REPORTER_ASSERT(reporter, nullptr == s);
679 DEF_TEST(surface_raster_zeroinitialized, reporter) {
682 REPORTER_ASSERT(reporter, s->peekPixels(&pixmap));
686 REPORTER_ASSERT(reporter, *pixmap.addr32(i, j) == 0);
756 static void test_surface_context_clear(skiatest::Reporter* reporter,
780 ERRORF(reporter,
789 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceClear_Gpu, reporter, ctxInfo) {
804 ERRORF(reporter, "Could not create GPU SkSurface.");
809 ERRORF(reporter, "Could access surface context of GPU SkSurface.");
812 test_surface_context_clear(reporter, dContext, sfc, 0x0);
814 test_surface_context_clear(reporter, dContext, imageSurfaceCtx.get(), 0x0);
823 ERRORF(reporter, "Could not create GPU SkSurface.");
828 ERRORF(reporter, "Could access surface context of GPU SkSurface.");
831 test_surface_context_clear(reporter, dContext, sfc, kOrigColor.toSkColor());
833 test_surface_context_clear(reporter, dContext, imageSurfaceCtx.get(),
839 skiatest::Reporter* reporter, sk_sp<SkSurface> surface, SkColor origColor) {
854 REPORTER_ASSERT(reporter, surface->readPixels(readback.info(), readback.writable_addr(),
869 REPORTER_ASSERT(reporter, rectColorPM == readback.addr32()[x + y * kW]);
880 REPORTER_ASSERT(reporter, origColorPM == readback.addr32()[x + y * kW]);
890 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacePartialDraw_Gpu, reporter, ctxInfo) {
902 test_surface_draw_partially(reporter, surface, kOrigColor.toSkColor());
916 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceWrappedWithRelease_Gpu, reporter, ctxInfo) {
963 ERRORF(reporter, "Failed to create surface");
972 REPORTER_ASSERT(reporter, 0 == releaseChecker.fReleaseCount);
974 REPORTER_ASSERT(reporter, 1 == releaseChecker.fReleaseCount);
982 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceAttachStencil_Gpu, reporter, ctxInfo) {
1008 REPORTER_ASSERT(reporter,
1014 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReplaceSurfaceBackendTexture, reporter, ctxInfo) {
1027 ERRORF(reporter, "Expected to be able to make second texture");
1035 ERRORF(reporter, "Couldn't create different sized texture.");
1052 REPORTER_ASSERT(reporter, replaced);
1062 REPORTER_ASSERT(reporter, !bad, "Could not read surface.");
1069 ERRORF(reporter, "Expected color 0x%08x, found color 0x%08x at %d, %d.",
1079 ERRORF(reporter, "Could not create second surface.");
1083 REPORTER_ASSERT(reporter, !bad, "Could not read second surface.");
1090 ERRORF(reporter, "Expected color 0x%08x, found color 0x%08x at %d, %d.",
1097 REPORTER_ASSERT(reporter,
1100 REPORTER_ASSERT(reporter, !surf->replaceBackendTexture({}, kTopLeft_GrSurfaceOrigin));
1102 REPORTER_ASSERT(reporter,
1106 REPORTER_ASSERT(reporter, surf);
1108 REPORTER_ASSERT(reporter, !surf->replaceBackendTexture(mbet1->texture(),
1153 DEF_TEST(surface_image_unity, reporter) {
1154 auto do_test = [reporter](const SkImageInfo& info) {
1167 REPORTER_ASSERT(reporter, img != nullptr);
1172 REPORTER_ASSERT(reporter, img != nullptr);