aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CanvasTest.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-02-20 06:17:26 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-20 06:17:26 -0800
commita1f1ee98a1f6d0770f6243270ca2f0e6c92efaba (patch)
tree427609a03b889602589a698834b96ea0035e6e8a /tests/CanvasTest.cpp
parent07d5947b886bef06621e830e9f8bf253f9bad703 (diff)
PDF : New factory function for SkPDFDevice
SkPDFDevice now has factory function that matches what callers need. Review URL: https://codereview.chromium.org/941023005
Diffstat (limited to 'tests/CanvasTest.cpp')
-rw-r--r--tests/CanvasTest.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index d1f0abd19f..c405fcd52c 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);
}