Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

77 DEF_TEST(SurfaceEmpty, reporter) {
79 REPORTER_ASSERT(reporter, nullptr == SkSurface::MakeRaster(info));
80 REPORTER_ASSERT(reporter, nullptr == SkSurface::MakeRasterDirect(info, nullptr, 0));
84 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceEmpty_Gpu, reporter, ctxInfo) {
86 REPORTER_ASSERT(reporter, nullptr ==
91 static void test_canvas_peek(skiatest::Reporter* reporter,
101 REPORTER_ASSERT(reporter, expectPeekSuccess == success);
107 REPORTER_ASSERT(reporter, requestInfo == pmap.info());
108 REPORTER_ASSERT(reporter, requestInfo.minRowBytes() <= pmap.rowBytes());
109 REPORTER_ASSERT(reporter, pmcolor == *pmap.addr32());
111 REPORTER_ASSERT(reporter, pmap.addr() == pmap2.addr());
112 REPORTER_ASSERT(reporter, pmap.info() == pmap2.info());
113 REPORTER_ASSERT(reporter, pmap.rowBytes() == pmap2.rowBytes());
115 REPORTER_ASSERT(reporter, nullptr == addr2);
118 DEF_TEST(SurfaceCanvasPeek, reporter) {
122 test_canvas_peek(reporter, surface, requestInfo, true);
126 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCanvasPeek_Gpu, reporter, ctxInfo) {
130 test_canvas_peek(reporter, surface, requestInfo, false);
135 static void test_snapshot_alphatype(skiatest::Reporter* reporter, const sk_sp<SkSurface>& surface,
137 REPORTER_ASSERT(reporter, surface);
140 REPORTER_ASSERT(reporter, image);
142 REPORTER_ASSERT(reporter, image->alphaType() == expectedAlphaType);
146 DEF_TEST(SurfaceSnapshotAlphaType, reporter) {
150 test_snapshot_alphatype(reporter, surface, at);
155 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceSnapshotAlphaType_Gpu, reporter, ctxInfo) {
160 test_snapshot_alphatype(reporter, surface, at);
180 skiatest::Reporter* reporter, SkSurface* surface, SkSurface::BackendHandleAccess mode,
189 REPORTER_ASSERT(reporter, (obj1 == obj2) == (snap1 == snap2));
191 DEF_TEST(SurfaceBackendHandleAccessCopyOnWrite, reporter) {
201 test_backend_handle_access_copy_on_write(reporter, surface.get(), accessMode,
207 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBackendHandleAccessCopyOnWrite_Gpu, reporter, ctxInfo) {
218 test_backend_handle_access_copy_on_write(reporter, surface.get(), accessMode,
229 skiatest::Reporter* reporter, SkSurface* surface,
233 REPORTER_ASSERT(reporter, obj != 0);
236 REPORTER_ASSERT(reporter, image0->uniqueID() == image1->uniqueID());
239 REPORTER_ASSERT(reporter, obj != 0);
242 REPORTER_ASSERT(reporter, image0->uniqueID() != image2->uniqueID());
245 REPORTER_ASSERT(reporter, obj != 0);
248 REPORTER_ASSERT(reporter, image0->uniqueID() != image3->uniqueID());
249 REPORTER_ASSERT(reporter, image2->uniqueID() != image3->uniqueID());
252 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBackendHandleAccessIDs_Gpu, reporter, ctxInfo) {
258 test_func(reporter, surface.get(), handle_access_func);
266 static void test_copy_on_write(skiatest::Reporter* reporter, SkSurface* surface) {
320 REPORTER_ASSERT(reporter, imageBefore != imageAfter); \
340 DEF_TEST(SurfaceCopyOnWrite, reporter) {
341 test_copy_on_write(reporter, create_surface().get());
344 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCopyOnWrite_Gpu, reporter, ctxInfo) {
347 test_copy_on_write(reporter, surface.get());
352 static void test_writable_after_snapshot_release(skiatest::Reporter* reporter,
362 DEF_TEST(SurfaceWriteableAfterSnapshotRelease, reporter) {
363 test_writable_after_snapshot_release(reporter, create_surface().get());
366 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceWriteableAfterSnapshotRelease_Gpu, reporter, ctxInfo) {
369 test_writable_after_snapshot_release(reporter, surface.get());
375 static void test_crbug263329(skiatest::Reporter* reporter,
399 REPORTER_ASSERT(reporter, as_IB(image4)->peekTexture() != as_IB(image3)->peekTexture());
401 REPORTER_ASSERT(reporter, as_IB(image4)->peekTexture() != as_IB(image2)->peekTexture());
402 REPORTER_ASSERT(reporter, as_IB(image4)->peekTexture() != as_IB(image1)->peekTexture());
403 REPORTER_ASSERT(reporter, as_IB(image3)->peekTexture() != as_IB(image2)->peekTexture());
404 REPORTER_ASSERT(reporter, as_IB(image3)->peekTexture() != as_IB(image1)->peekTexture());
405 REPORTER_ASSERT(reporter, as_IB(image2)->peekTexture() != as_IB(image1)->peekTexture());
407 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCRBug263329_Gpu, reporter, ctxInfo) {
411 test_crbug263329(reporter, surface1.get(), surface2.get());
416 DEF_TEST(SurfaceGetTexture, reporter) {
419 REPORTER_ASSERT(reporter, !as_IB(image)->isTextureBacked());
421 REPORTER_ASSERT(reporter, !as_IB(image)->isTextureBacked());
424 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacepeekTexture_Gpu, reporter, ctxInfo) {
429 REPORTER_ASSERT(reporter, as_IB(image)->isTextureBacked());
431 REPORTER_ASSERT(reporter, 0 != textureHandle);
433 REPORTER_ASSERT(reporter, as_IB(image)->isTextureBacked());
434 REPORTER_ASSERT(reporter, textureHandle == image->getTextureHandle(false));
461 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBudget, reporter, ctxInfo) {
466 REPORTER_ASSERT(reporter, budgeted == is_budgeted(surface));
472 REPORTER_ASSERT(reporter, budgeted == is_budgeted(surface));
473 REPORTER_ASSERT(reporter, budgeted == is_budgeted(image));
479 REPORTER_ASSERT(reporter, budgeted == is_budgeted(surface));
480 REPORTER_ASSERT(reporter, budgeted == is_budgeted(image));
485 static void test_no_canvas1(skiatest::Reporter* reporter,
492 static void test_no_canvas2(skiatest::Reporter* reporter,
508 REPORTER_ASSERT(reporter, image1 != image2);
510 DEF_TEST(SurfaceNoCanvas, reporter) {
515 test_func(reporter, create_surface().get(), mode);
520 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceNoCanvas_Gpu, reporter, ctxInfo) {
527 test_func(reporter, surface.get(), mode);
534 static void check_rowbytes_remain_consistent(SkSurface* surface, skiatest::Reporter* reporter) {
536 REPORTER_ASSERT(reporter, surface->peekPixels(&surfacePM));
540 REPORTER_ASSERT(reporter, image->peekPixels(&pm));
542 REPORTER_ASSERT(reporter, surfacePM.rowBytes() == pm.rowBytes());
547 REPORTER_ASSERT(reporter, image->uniqueID() != image2->uniqueID());
550 REPORTER_ASSERT(reporter, image2->peekPixels(&pm2));
551 REPORTER_ASSERT(reporter, pm2.rowBytes() == pm.rowBytes());
554 DEF_TEST(surface_rowbytes, reporter) {
558 check_rowbytes_remain_consistent(surf0.get(), reporter);
562 check_rowbytes_remain_consistent(surf1.get(), reporter);
566 REPORTER_ASSERT(reporter, nullptr == s);
568 REPORTER_ASSERT(reporter, nullptr == s);
571 DEF_TEST(surface_raster_zeroinitialized, reporter) {
574 REPORTER_ASSERT(reporter, s->peekPixels(&pixmap));
578 REPORTER_ASSERT(reporter, *pixmap.addr32(i, j) == 0);
631 static void test_surface_clear(skiatest::Reporter* reporter, sk_sp<SkSurface> surface,
635 ERRORF(reporter, "Could not create GPU SkSurface.");
645 ERRORF(reporter, "Could access render target of GPU SkSurface.");
662 ERRORF(reporter,
671 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceClear_Gpu, reporter, ctxInfo) {
692 test_surface_clear(reporter, surface, grSurfaceGetter, 0x0);
700 test_surface_clear(reporter, surface, grSurfaceGetter, kOrigColor);
708 skiatest::Reporter* reporter, sk_sp<SkSurface> surface, uint32_t origColor) {
732 REPORTER_ASSERT(reporter, rectColorPM == pixels[x + y * kW]);
741 REPORTER_ASSERT(reporter, origColorPM == pixels[x + y * kW]);
749 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacePartialDraw_Gpu, reporter, ctxInfo) {
764 test_surface_draw_partially(reporter, surface, kOrigColor);
772 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceAttachStencil_Gpu, reporter, ctxInfo) {
794 REPORTER_ASSERT(reporter,
803 skiatest::Reporter* reporter,
850 REPORTER_ASSERT_MESSAGE(reporter, SkToBool(surface) == shouldWork, fullTestName.c_str());
854 REPORTER_ASSERT_MESSAGE(reporter, image, testConfig.fDescription);
856 REPORTER_ASSERT_MESSAGE(reporter, imageColorSpace == testConfig.fColorSpace.get(),
862 DEF_TEST(SurfaceCreationWithColorSpace, reporter) {
867 test_surface_creation_and_snapshot_with_color_space(reporter, "raster", true, surfaceMaker);
871 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCreationWithColorSpace_Gpu, reporter, ctxInfo) {
878 test_surface_creation_and_snapshot_with_color_space(reporter, "gpu", f16Support, surfaceMaker);
899 test_surface_creation_and_snapshot_with_color_space(reporter, "wrapped", f16Support,
908 static void test_overdraw_surface(skiatest::Reporter* r, SkSurface* surface) {