| 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 | 563 |
| 564 REPORTER_ASSERT_MESSAGE(reporter, | 564 REPORTER_ASSERT_MESSAGE(reporter, |
| 565 CanvasTestingAccess::SameState(canvas1, canvas2), | 565 CanvasTestingAccess::SameState(canvas1, canvas2), |
| 566 testStep->assertMessage()); | 566 testStep->assertMessage()); |
| 567 } | 567 } |
| 568 | 568 |
| 569 static void TestPdfDevice(skiatest::Reporter* reporter, | 569 static void TestPdfDevice(skiatest::Reporter* reporter, |
| 570 const TestData& d, | 570 const TestData& d, |
| 571 CanvasTestStep* testStep) { | 571 CanvasTestStep* testStep) { |
| 572 SkDynamicMemoryWStream outStream; | 572 SkDynamicMemoryWStream outStream; |
| 573 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&outStream)); | 573 sk_sp<SkDocument> doc(SkDocument::MakePDF(&outStream)); |
| 574 #if SK_SUPPORT_PDF | 574 #if SK_SUPPORT_PDF |
| 575 REPORTER_ASSERT(reporter, doc); | 575 REPORTER_ASSERT(reporter, doc); |
| 576 #else | 576 #else |
| 577 REPORTER_ASSERT(reporter, !doc); | 577 REPORTER_ASSERT(reporter, !doc); |
| 578 #endif // SK_SUPPORT_PDF | 578 #endif // SK_SUPPORT_PDF |
| 579 if (!doc) { | 579 if (!doc) { |
| 580 return; | 580 return; |
| 581 } | 581 } |
| 582 SkCanvas* canvas = doc->beginPage(SkIntToScalar(d.fWidth), | 582 SkCanvas* canvas = doc->beginPage(SkIntToScalar(d.fWidth), |
| 583 SkIntToScalar(d.fHeight)); | 583 SkIntToScalar(d.fHeight)); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); | 765 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); |
| 766 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); | 766 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); |
| 767 REPORTER_ASSERT(reporter, clip1 == clip2); | 767 REPORTER_ASSERT(reporter, clip1 == clip2); |
| 768 | 768 |
| 769 filterCanvas.clipRect(SkRect::MakeXYWH(30.5f, 30.7f, 100, 100)); | 769 filterCanvas.clipRect(SkRect::MakeXYWH(30.5f, 30.7f, 100, 100)); |
| 770 filterCanvas.scale(0.75f, 0.5f); | 770 filterCanvas.scale(0.75f, 0.5f); |
| 771 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); | 771 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa
trix()); |
| 772 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); | 772 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl
ipBounds(&clip2)); |
| 773 REPORTER_ASSERT(reporter, clip1 == clip2); | 773 REPORTER_ASSERT(reporter, clip1 == clip2); |
| 774 } | 774 } |
| OLD | NEW |