OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 /* Description: | 8 /* Description: |
9 * This test defines a series of elementatry test steps that perform | 9 * This test defines a series of elementatry test steps that perform |
10 * a single or a small group of canvas API calls. Each test step is | 10 * a single or a small group of canvas API calls. Each test step is |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 SkIRect deviceBounds1, deviceBounds2; | 593 SkIRect deviceBounds1, deviceBounds2; |
594 REPORTER_ASSERT_MESSAGE(reporter, | 594 REPORTER_ASSERT_MESSAGE(reporter, |
595 canvas1->getClipDeviceBounds(&deviceBounds1) == | 595 canvas1->getClipDeviceBounds(&deviceBounds1) == |
596 canvas2->getClipDeviceBounds(&deviceBounds2), | 596 canvas2->getClipDeviceBounds(&deviceBounds2), |
597 testStep->assertMessage()); | 597 testStep->assertMessage()); |
598 REPORTER_ASSERT_MESSAGE(reporter, deviceBounds1 == deviceBounds2, testStep->
assertMessage()); | 598 REPORTER_ASSERT_MESSAGE(reporter, deviceBounds1 == deviceBounds2, testStep->
assertMessage()); |
599 REPORTER_ASSERT_MESSAGE(reporter, canvas1->getTotalMatrix() == | 599 REPORTER_ASSERT_MESSAGE(reporter, canvas1->getTotalMatrix() == |
600 canvas2->getTotalMatrix(), testStep->assertMessage()); | 600 canvas2->getTotalMatrix(), testStep->assertMessage()); |
601 REPORTER_ASSERT_MESSAGE(reporter, equal_clips(*canvas1, *canvas2), testStep-
>assertMessage()); | 601 REPORTER_ASSERT_MESSAGE(reporter, equal_clips(*canvas1, *canvas2), testStep-
>assertMessage()); |
602 | 602 |
603 // The following test code is commented out because the test fails when | |
604 // the canvas is an SkPictureRecord or SkDeferredCanvas | |
605 // Issue: http://code.google.com/p/skia/issues/detail?id=498 | |
606 // Also, creating a LayerIter on an SkProxyCanvas crashes | |
607 // Issue: http://code.google.com/p/skia/issues/detail?id=499 | |
608 /* | |
609 SkCanvas::LayerIter layerIter1(const_cast<SkCanvas*>(canvas1), false); | 603 SkCanvas::LayerIter layerIter1(const_cast<SkCanvas*>(canvas1), false); |
610 SkCanvas::LayerIter layerIter2(const_cast<SkCanvas*>(canvas2), false); | 604 SkCanvas::LayerIter layerIter2(const_cast<SkCanvas*>(canvas2), false); |
611 while (!layerIter1.done() && !layerIter2.done()) { | 605 while (!layerIter1.done() && !layerIter2.done()) { |
612 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.matrix() == | 606 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.matrix() == |
613 layerIter2.matrix(), testStep->assertMessage()); | 607 layerIter2.matrix(), testStep->assertMessage()); |
614 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.clip() == | 608 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.clip() == |
615 layerIter2.clip(), testStep->assertMessage()); | 609 layerIter2.clip(), testStep->assertMessage()); |
616 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.paint() == | 610 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.paint() == |
617 layerIter2.paint(), testStep->assertMessage()); | 611 layerIter2.paint(), testStep->assertMessage()); |
618 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.x() == | 612 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.x() == |
619 layerIter2.x(), testStep->assertMessage()); | 613 layerIter2.x(), testStep->assertMessage()); |
620 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.y() == | 614 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.y() == |
621 layerIter2.y(), testStep->assertMessage()); | 615 layerIter2.y(), testStep->assertMessage()); |
622 layerIter1.next(); | 616 layerIter1.next(); |
623 layerIter2.next(); | 617 layerIter2.next(); |
624 } | 618 } |
625 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.done(), | 619 REPORTER_ASSERT_MESSAGE(reporter, layerIter1.done(), |
626 testStep->assertMessage()); | 620 testStep->assertMessage()); |
627 REPORTER_ASSERT_MESSAGE(reporter, layerIter2.done(), | 621 REPORTER_ASSERT_MESSAGE(reporter, layerIter2.done(), |
628 testStep->assertMessage()); | 622 testStep->assertMessage()); |
629 */ | 623 |
630 } | 624 } |
631 | 625 |
632 // The following class groups static functions that need to access | 626 // The following class groups static functions that need to access |
633 // the privates members of SkPictureRecord | 627 // the privates members of SkPictureRecord |
634 class SkPictureTester { | 628 class SkPictureTester { |
635 private: | 629 private: |
636 static int EQ(const SkFlatData* a, const SkFlatData* b) { | 630 static int EQ(const SkFlatData* a, const SkFlatData* b) { |
637 return *a == *b; | 631 return *a == *b; |
638 } | 632 } |
639 | 633 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 | 862 |
869 for (int testStep = 0; testStep < testStepArray().count(); testStep++) { | 863 for (int testStep = 0; testStep < testStepArray().count(); testStep++) { |
870 TestOverrideStateConsistency(reporter, d, testStepArray()[testStep]); | 864 TestOverrideStateConsistency(reporter, d, testStepArray()[testStep]); |
871 if (testStepArray()[testStep]->enablePdfTesting()) { | 865 if (testStepArray()[testStep]->enablePdfTesting()) { |
872 TestPdfDevice(reporter, d, testStepArray()[testStep]); | 866 TestPdfDevice(reporter, d, testStepArray()[testStep]); |
873 } | 867 } |
874 } | 868 } |
875 | 869 |
876 test_newraster(reporter); | 870 test_newraster(reporter); |
877 } | 871 } |
OLD | NEW |