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 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); | 806 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); |
807 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); | 807 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); |
808 REPORTER_ASSERT(reporter, clip1 == clip2); | 808 REPORTER_ASSERT(reporter, clip1 == clip2); |
809 | 809 |
810 filterCanvas.clipRect(SkRect::MakeXYWH(30.5f, 30.7f, 100, 100)); | 810 filterCanvas.clipRect(SkRect::MakeXYWH(30.5f, 30.7f, 100, 100)); |
811 filterCanvas.scale(0.75f, 0.5f); | 811 filterCanvas.scale(0.75f, 0.5f); |
812 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); | 812 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); |
813 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); | 813 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); |
814 REPORTER_ASSERT(reporter, clip1 == clip2); | 814 REPORTER_ASSERT(reporter, clip1 == clip2); |
815 } | 815 } |
| 816 |
| 817 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 818 |
| 819 #include "SkDeferredCanvas.h" |
| 820 #include "SkDumpCanvas.h" |
| 821 |
| 822 DEF_TEST(DeferredCanvas, r) { |
| 823 SkDebugfDumper dumper; |
| 824 SkDumpCanvas dumpC(&dumper); |
| 825 |
| 826 SkDeferredCanvas canvas(&dumpC); |
| 827 |
| 828 SkPaint paint; |
| 829 // paint.setShader(SkShader::MakeColorShader(SK_ColorRED)); |
| 830 |
| 831 canvas.save(); |
| 832 canvas.clipRect(SkRect::MakeWH(55, 55)); |
| 833 canvas.translate(10, 20); |
| 834 canvas.drawRect(SkRect::MakeWH(50, 50), paint); |
| 835 canvas.restore(); |
| 836 } |
| 837 |
OLD | NEW |