Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

22  *                                         skiatest::Reporter* reporter,
27 * REPORTER_ASSERT_MESSAGE(reporter, (...), \
70 DEF_TEST(canvas_clipbounds, reporter) {
76 REPORTER_ASSERT(reporter, irect == SkIRect::MakeWH(10, 10));
77 REPORTER_ASSERT(reporter, canvas.getDeviceClipBounds(&irect2));
78 REPORTER_ASSERT(reporter, irect == irect2);
82 REPORTER_ASSERT(reporter, rect.contains(SkRect::MakeWH(10, 10)));
83 REPORTER_ASSERT(reporter, canvas.getLocalClipBounds(&rect2));
84 REPORTER_ASSERT(reporter, rect == rect2);
89 REPORTER_ASSERT(reporter, irect == SkIRect::MakeEmpty());
90 REPORTER_ASSERT(reporter, !canvas.getDeviceClipBounds(&irect2));
91 REPORTER_ASSERT(reporter, irect == irect2);
94 REPORTER_ASSERT(reporter, rect == SkRect::MakeEmpty());
95 REPORTER_ASSERT(reporter, !canvas.getLocalClipBounds(&rect2));
96 REPORTER_ASSERT(reporter, rect == rect2);
101 REPORTER_ASSERT(reporter, c.getBaseLayerSize() == SkISize::MakeEmpty());
121 static void test_restriction(skiatest::Reporter* reporter, SkCanvas* canvas) {
122 REPORTER_ASSERT(reporter, canvas->getDeviceClipBounds() == gBaseRestrictedR);
126 REPORTER_ASSERT(reporter, canvas->getDeviceClipBounds() == restrictionR);
130 REPORTER_ASSERT(reporter, canvas->getDeviceClipBounds() == clipR);
146 REPORTER_ASSERT(reporter, gBaseRestrictedR.contains(canvas->getDeviceClipBounds()));
159 DEF_TEST(canvas_clip_restriction, reporter) {
161 [reporter](SkCanvas* canvas) { test_restriction(reporter, canvas); });
164 DEF_TEST(canvas_empty_clip, reporter) {
165 multi_canvas_driver(50, 50, [reporter](SkCanvas* canvas) {
168 REPORTER_ASSERT(reporter, !canvas->isClipEmpty());
170 REPORTER_ASSERT(reporter, canvas->isClipEmpty());
321 virtual void draw(SkCanvas*, const TestData&, skiatest::Reporter*) = 0;
348 skiatest::Reporter* reporter) { \
349 FUNCTION (canvas, d, reporter, this); \
360 skiatest::Reporter* reporter) { \
361 FUNCTION (canvas, d, reporter, this); \
369 skiatest::Reporter*, CanvasTestStep*) { \
376 skiatest::Reporter*, CanvasTestStep* testStep) { \
377 REPORTER_ASSERT_MESSAGE(reporter, canvas-> CALL , \
402 skiatest::Reporter* reporter, CanvasTestStep* testStep) {
408 REPORTER_ASSERT_MESSAGE(reporter, canvas->getSaveCount() == saveCount,
410 REPORTER_ASSERT_MESSAGE(reporter, canvas->getTotalMatrix().isIdentity(),
412 // REPORTER_ASSERT_MESSAGE(reporter, canvas->getTotalClip() != kTestRegion, testStep->assertMessage());
417 skiatest::Reporter* reporter, CanvasTestStep* testStep) {
421 REPORTER_ASSERT_MESSAGE(reporter, canvas->getSaveCount() == saveCount,
427 skiatest::Reporter* reporter, CanvasTestStep* testStep) {
431 REPORTER_ASSERT_MESSAGE(reporter, canvas->getSaveCount() == saveCount,
437 skiatest::Reporter* reporter, CanvasTestStep* testStep) {
441 REPORTER_ASSERT_MESSAGE(reporter, canvas->getSaveCount() == saveCount,
447 skiatest::Reporter*, CanvasTestStep*) {
460 skiatest::Reporter*, CanvasTestStep*) {
470 skiatest::Reporter*, CanvasTestStep*) {
486 skiatest::Reporter*, CanvasTestStep*) {
499 skiatest::Reporter* reporter, CanvasTestStep* testStep) {
502 REPORTER_ASSERT_MESSAGE(reporter, baseSaveCount == n, testStep->assertMessage());
503 REPORTER_ASSERT_MESSAGE(reporter, baseSaveCount + 1 == canvas->getSaveCount(),
507 REPORTER_ASSERT_MESSAGE(reporter, baseSaveCount + 3 == canvas->getSaveCount(),
510 REPORTER_ASSERT_MESSAGE(reporter, baseSaveCount + 1 == canvas->getSaveCount(),
515 REPORTER_ASSERT_MESSAGE(reporter, 1 == canvas->getSaveCount(),
521 skiatest::Reporter*, CanvasTestStep*) {
542 skiatest::Reporter*, CanvasTestStep*) {
562 skiatest::Reporter* reporter,
570 REPORTER_ASSERT_MESSAGE(reporter, m.isIdentity(), testStep->assertMessage());
571 REPORTER_ASSERT_MESSAGE(reporter, r == SkIRect::MakeXYWH(0, 0, 2, 2),
578 REPORTER_ASSERT_MESSAGE(reporter, m.isIdentity(), testStep->assertMessage());
579 REPORTER_ASSERT_MESSAGE(reporter, r == SkIRect::MakeXYWH(0, 0, 2, 2),
589 REPORTER_ASSERT_MESSAGE(reporter, m == SkMatrix::MakeTrans(-1.f, -1.f),
591 REPORTER_ASSERT_MESSAGE(reporter, r == SkIRect::MakeXYWH(0, 0, 1, 1),
599 static void TestPdfDevice(skiatest::Reporter* reporter, const TestData& d, CanvasTestStep* step) {
602 REPORTER_ASSERT(reporter, doc);
608 REPORTER_ASSERT(reporter, canvas);
610 step->draw(canvas, d, reporter);
619 static void TestOverrideStateConsistency(skiatest::Reporter* reporter, const TestData& d,
625 testStep->draw(&referenceCanvas, d, reporter);
628 static void test_newraster(skiatest::Reporter* reporter) {
637 REPORTER_ASSERT(reporter, canvas);
641 REPORTER_ASSERT(reporter, addr);
642 REPORTER_ASSERT(reporter, info == pmap.info());
643 REPORTER_ASSERT(reporter, minRowBytes == pmap.rowBytes());
646 REPORTER_ASSERT(reporter, 0 == addr[x]);
653 REPORTER_ASSERT(reporter, nullptr == SkCanvas::MakeRasterDirect(info, baseAddr, minRowBytes));
657 REPORTER_ASSERT(reporter, nullptr == SkCanvas::MakeRasterDirect(info, baseAddr, minRowBytes));
661 REPORTER_ASSERT(reporter, nullptr == SkCanvas::MakeRasterDirect(info, baseAddr, minRowBytes));
666 REPORTER_ASSERT(reporter, canvas);
669 DEF_TEST(Canvas, reporter) {
673 TestOverrideStateConsistency(reporter, d, testStepArray()[testStep]);
675 TestPdfDevice(reporter, d, testStepArray()[testStep]);
679 test_newraster(reporter);
682 DEF_TEST(Canvas_SaveState, reporter) {
684 REPORTER_ASSERT(reporter, 1 == canvas.getSaveCount());
687 REPORTER_ASSERT(reporter, 1 == n);
688 REPORTER_ASSERT(reporter, 2 == canvas.getSaveCount());
691 REPORTER_ASSERT(reporter, 2 == n);
692 REPORTER_ASSERT(reporter, 3 == canvas.getSaveCount());
695 REPORTER_ASSERT(reporter, 2 == canvas.getSaveCount());
697 REPORTER_ASSERT(reporter, 1 == canvas.getSaveCount());
700 DEF_TEST(Canvas_ClipEmptyPath, reporter) {
721 SkShadowTestCanvas(int x, int y, skiatest::Reporter* reporter)
723 , fReporter(reporter) {}
731 void testUpdateDepth(skiatest::Reporter *reporter) {
734 REPORTER_ASSERT(reporter, this->getZ() == 0);
736 REPORTER_ASSERT(reporter, this->getZ() == -10);
740 REPORTER_ASSERT(reporter, this->getZ() == 10);
743 REPORTER_ASSERT(reporter, this->getZ() == -10);
746 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(this->getZ(), 3.14f));
750 skiatest::Reporter* fReporter;
772 DEF_TEST(PaintFilterCanvas_ConsistentState, reporter) {
778 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMatrix());
779 REPORTER_ASSERT(reporter, canvas.getLocalClipBounds() == filterCanvas.getLocalClipBounds());
783 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMatrix());
784 REPORTER_ASSERT(reporter, filterCanvas.getLocalClipBounds().contains(canvas.getLocalClipBounds()));
787 SkShadowTestCanvas* tCanvas = new SkShadowTestCanvas(100,100, reporter);
788 tCanvas->testUpdateDepth(reporter);
792 SkShadowTestCanvas *tSCanvas = new SkShadowTestCanvas(100, 100, reporter);
872 static void test_cliptype(SkCanvas* canvas, skiatest::Reporter* r) {