Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1649)

Side by Side Diff: tests/CanvasTest.cpp

Issue 1916093002: SkDocument/PDF: new API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-04-26 (Tuesday) 15:55:33 EDT Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/AnnotationTest.cpp ('k') | tests/PDFDocumentTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tests/AnnotationTest.cpp ('k') | tests/PDFDocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698