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

Unified Diff: tests/CanvasTest.cpp

Issue 941023005: PDF : New factory function for SkPDFDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase on 07d5947 Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/AnnotationTest.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CanvasTest.cpp
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index d1f0abd19f0c6cdd1280244f7ec481461c96743c..c405fcd52c59c7ce51edaa544c0b0e7d29d4d438 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -49,6 +49,7 @@
#include "SkDevice.h"
#include "SkMatrix.h"
#include "SkNWayCanvas.h"
+#include "SkPDFCanon.h"
#include "SkPDFDevice.h"
#include "SkPDFDocument.h"
#include "SkPaint.h"
@@ -558,12 +559,14 @@ static void TestPdfDevice(skiatest::Reporter* reporter,
const TestData& d,
CanvasTestStep* testStep) {
SkISize pageSize = SkISize::Make(d.fWidth, d.fHeight);
- SkPDFDevice device(pageSize, pageSize, SkMatrix::I());
- SkCanvas canvas(&device);
+ SkPDFCanon canon;
+ SkAutoTUnref<SkPDFDevice> pdfDevice(
+ SkPDFDevice::Create(pageSize, 72.0f, &canon));
+ SkCanvas canvas(pdfDevice.get());
testStep->setAssertMessageFormat(kPdfAssertMessageFormat);
testStep->draw(&canvas, d, reporter);
SkPDFDocument doc;
- doc.appendPage(&device);
+ doc.appendPage(pdfDevice.get());
SkDynamicMemoryWStream stream;
doc.emitPDF(&stream);
}
« no previous file with comments | « tests/AnnotationTest.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698