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

Unified Diff: dm/DMSrcSink.cpp

Issue 978443002: Revert of XPS, DM: add SkDocument::CreateXPS (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « dm/DMSrcSink.h ('k') | gyp/dm.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index cec782e392f780d7da6603dfc901f36b0ceeca85..e67d4355e4ca4caf4f7605422b2bd73f8b91a3ac 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -194,9 +194,12 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-static Error draw_skdocument(const Src& src, SkDocument* doc, SkWStream* dst) {
- // Print the given DM:Src to a document, breaking on 8.5x11 pages.
- SkASSERT(doc);
+PDFSink::PDFSink() {}
+
+Error PDFSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const {
+ // Print the given DM:Src to a PDF, breaking on 8.5x11 pages.
+ SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(dst));
+
int width = src.size().width(),
height = src.size().height();
@@ -228,27 +231,6 @@
return "";
}
-PDFSink::PDFSink() {}
-
-Error PDFSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const {
- SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(dst));
- if (!doc) {
- return "SkDocument::CreatePDF() returned NULL";
- }
- return draw_skdocument(src, doc.get(), dst);
-}
-
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-XPSSink::XPSSink() {}
-
-Error XPSSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const {
- SkAutoTUnref<SkDocument> doc(SkDocument::CreateXPS(dst));
- if (!doc) {
- return "SkDocument::CreateXPS() returned NULL";
- }
- return draw_skdocument(src, doc.get(), dst);
-}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
SKPSink::SKPSink() {}
« no previous file with comments | « dm/DMSrcSink.h ('k') | gyp/dm.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698