aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/xps/SkXPSDocument.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/xps/SkXPSDocument.h')
-rw-r--r--src/xps/SkXPSDocument.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/xps/SkXPSDocument.h b/src/xps/SkXPSDocument.h
new file mode 100644
index 0000000000..fbaf57b36f
--- /dev/null
+++ b/src/xps/SkXPSDocument.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkXPSDocument_DEFINED
+#define SkXPSDocument_DEFINED
+
+#include "SkTypes.h"
+
+#ifdef SK_BUILD_FOR_WIN
+
+#include "SkDocument.h"
+#include "SkXPSDevice.h"
+#include "SkTScopedComPtr.h"
+
+#include <XpsObjectModel.h>
+
+class SkXPSDocument final : public SkDocument {
+public:
+ SkXPSDocument(SkWStream*, void (*doneProc)(SkWStream*, bool abort),
+ SkScalar dpi, SkTScopedComPtr<IXpsOMObjectFactory>);
+ virtual ~SkXPSDocument();
+
+protected:
+ SkCanvas* onBeginPage(SkScalar w, SkScalar h, const SkRect&) override;
+ void onEndPage() override;
+ void onClose(SkWStream*) override;
+ void onAbort() override;
+
+private:
+ SkTScopedComPtr<IXpsOMObjectFactory> fXpsFactory;
+ SkXPSDevice fDevice;
+ std::unique_ptr<SkCanvas> fCanvas;
+ SkVector fUnitsPerMeter;
+ SkVector fPixelsPerMeter;
+};
+
+#endif // SK_BUILD_FOR_WIN
+#endif // SkXPSDocument_DEFINED