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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 SkCanvas canvas(10, 10); | 693 SkCanvas canvas(10, 10); |
694 REPORTER_ASSERT(reporter, 1 == canvas.getSaveCount()); | 694 REPORTER_ASSERT(reporter, 1 == canvas.getSaveCount()); |
695 | 695 |
696 int n = canvas.save(); | 696 int n = canvas.save(); |
697 REPORTER_ASSERT(reporter, 1 == n); | 697 REPORTER_ASSERT(reporter, 1 == n); |
698 REPORTER_ASSERT(reporter, 2 == canvas.getSaveCount()); | 698 REPORTER_ASSERT(reporter, 2 == canvas.getSaveCount()); |
699 | 699 |
700 n = canvas.saveLayer(nullptr, nullptr); | 700 n = canvas.saveLayer(nullptr, nullptr); |
701 REPORTER_ASSERT(reporter, 2 == n); | 701 REPORTER_ASSERT(reporter, 2 == n); |
702 REPORTER_ASSERT(reporter, 3 == canvas.getSaveCount()); | 702 REPORTER_ASSERT(reporter, 3 == canvas.getSaveCount()); |
703 | 703 |
704 canvas.restore(); | 704 canvas.restore(); |
705 REPORTER_ASSERT(reporter, 2 == canvas.getSaveCount()); | 705 REPORTER_ASSERT(reporter, 2 == canvas.getSaveCount()); |
706 canvas.restore(); | 706 canvas.restore(); |
707 REPORTER_ASSERT(reporter, 1 == canvas.getSaveCount()); | 707 REPORTER_ASSERT(reporter, 1 == canvas.getSaveCount()); |
708 } | 708 } |
709 | 709 |
710 DEF_TEST(Canvas_ClipEmptyPath, reporter) { | 710 DEF_TEST(Canvas_ClipEmptyPath, reporter) { |
711 SkCanvas canvas(10, 10); | 711 SkCanvas canvas(10, 10); |
712 canvas.save(); | 712 canvas.save(); |
713 SkPath path; | 713 SkPath path; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); | 750 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); |
751 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); | 751 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); |
752 REPORTER_ASSERT(reporter, clip1 == clip2); | 752 REPORTER_ASSERT(reporter, clip1 == clip2); |
753 | 753 |
754 filterCanvas.clipRect(SkRect::MakeXYWH(30.5f, 30.7f, 100, 100)); | 754 filterCanvas.clipRect(SkRect::MakeXYWH(30.5f, 30.7f, 100, 100)); |
755 filterCanvas.scale(0.75f, 0.5f); | 755 filterCanvas.scale(0.75f, 0.5f); |
756 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); | 756 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); |
757 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); | 757 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); |
758 REPORTER_ASSERT(reporter, clip1 == clip2); | 758 REPORTER_ASSERT(reporter, clip1 == clip2); |
759 } | 759 } |
OLD | NEW |